This commit is contained in:
yixu
2025-12-26 20:15:03 +08:00
parent 66d387409b
commit 6cb28b1401

View File

@@ -20,7 +20,10 @@
> >
<div <div
class="carousel-track" class="carousel-track"
:style="{ transform: `translateX(calc(-${currentIndex * 104}% + ${currentIndex * 60}px))`, transition: isTransitioning ? 'transform 0.3s ease' : 'none' }" :style="{
transform: `translateX(calc(-${currentIndex * 104}% + ${currentIndex * 13.2}vw))`,
transition: isTransitioning ? 'transform 0.3s ease' : 'none'
}"
> >
<div <div
@@ -269,7 +272,8 @@ onUnmounted(() => {
transform: translateY(0); transform: translateY(0);
} }
50% { 50% {
transform: translateY(-6px); /* 上浮一点点 */ /* 6px -> 6/375*100 ≈ 1.6vw */
transform: translateY(-1.6vw);
} }
} }
@@ -294,7 +298,8 @@ onUnmounted(() => {
opacity: 0.6; opacity: 0.6;
} }
50% { 50% {
transform: translateX(-6px); /* 往左移动一点 */ /* 6px -> 1.6vw */
transform: translateX(-1.6vw);
opacity: 1; opacity: 1;
} }
} }
@@ -311,29 +316,35 @@ onUnmounted(() => {
opacity: 0.6; opacity: 0.6;
} }
50% { 50% {
transform: translateX(6px); /* 往右移动一点 */ /* 6px -> 1.6vw */
transform: translateX(1.6vw);
opacity: 1; opacity: 1;
} }
} }
.show-position { .show-position {
position: relative; position: relative;
} }
.shou-dev { .shou-dev {
position: absolute; position: absolute;
top: 50vw; top: 50vw;
left: 11vw; left: 11vw;
} }
.shou-dev .shou-btn { .shou-dev .shou-btn {
width: 25vw; width: 25vw;
position: absolute; position: absolute;
top: 7vw; top: 7vw;
left: 20vw; left: 20vw;
} }
.action-btn { .action-btn {
display: flex; display: flex;
flex-flow: row; flex-flow: row;
justify-content: center; justify-content: center;
} }
.action-btn .shou-click { .action-btn .shou-click {
width: 24vw; width: 24vw;
} }
@@ -344,6 +355,7 @@ onUnmounted(() => {
left: 2vw; left: 2vw;
top: -2vw; top: -2vw;
} }
.scene-item { .scene-item {
position: fixed; position: fixed;
cursor: pointer; cursor: pointer;
@@ -351,15 +363,18 @@ onUnmounted(() => {
overflow: hidden; overflow: hidden;
animation: float 4s ease-in-out infinite; animation: float 4s ease-in-out infinite;
} }
.scene-item:hover { .scene-item:hover {
transform: scale(1.05); transform: scale(1.05);
} }
.scene-item img { .scene-item img {
width: 100%; width: 100%;
height: 100%; height: 100%;
object-fit: cover; object-fit: cover;
display: block; display: block;
} }
.item-1 { .item-1 {
width: 14vw; width: 14vw;
height: 14vw; height: 14vw;
@@ -367,6 +382,7 @@ onUnmounted(() => {
left: 3vw; left: 3vw;
animation-delay: 0s; animation-delay: 0s;
} }
.item-2 { .item-2 {
width: 12vw; width: 12vw;
height: 12vw; height: 12vw;
@@ -393,7 +409,8 @@ onUnmounted(() => {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding: 20px; /* 20px -> 5.33vw */
padding: 5.33vw;
box-sizing: border-box; box-sizing: border-box;
background-image: url('../assets/images/new/swiper-page-bg.webp'); background-image: url('../assets/images/new/swiper-page-bg.webp');
background-size: cover; background-size: cover;
@@ -405,7 +422,8 @@ onUnmounted(() => {
width: 100%; width: 100%;
max-width: 100vw; max-width: 100vw;
position: relative; position: relative;
padding: 0 20px; /* 0 20px -> 0 5.33vw */
padding: 0 5.33vw;
box-sizing: border-box; box-sizing: border-box;
} }
@@ -420,7 +438,8 @@ onUnmounted(() => {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
width: 100%; width: 100%;
padding: 20px 0; /* 20px 0 -> 5.33vw 0 */
padding: 5.33vw 0;
} }
.carousel-slide { .carousel-slide {
@@ -430,9 +449,14 @@ onUnmounted(() => {
background-size: cover; background-size: cover;
background-position: center; background-position: center;
background-image: url('../assets/images/new/border-img.webp'); background-image: url('../assets/images/new/border-img.webp');
min-width: calc(100% - 160px);
width: calc(100% - 160px); /* 100% - 160px -> 100% - 42.67vw (160/375*100) */
margin: 0 20px; min-width: calc(100% - 42.67vw);
width: calc(100% - 42.67vw);
/* 0 20px -> 0 5.33vw */
margin: 0 5.33vw;
flex-shrink: 0; flex-shrink: 0;
cursor: pointer; cursor: pointer;
user-select: none; user-select: none;
@@ -469,6 +493,7 @@ onUnmounted(() => {
transform: translateX(-50%); transform: translateX(-50%);
display: flex; display: flex;
gap: 2vw; gap: 2vw;
/* 2vw 4vw 保持不变,这里本来就是 vw */
padding: 2vw 4vw; padding: 2vw 4vw;
background: rgba(0, 0, 0, 0.3); background: rgba(0, 0, 0, 0.3);
border-radius: 4vw; border-radius: 4vw;
@@ -476,13 +501,15 @@ onUnmounted(() => {
} }
.indicator { .indicator {
width: 10px; /* 10px -> 2.67vw */
height: 10px; width: 2.67vw;
height: 2.67vw;
border-radius: 50%; border-radius: 50%;
background: rgba(255, 255, 255, 0.6); background: rgba(255, 255, 255, 0.6);
cursor: pointer; cursor: pointer;
transition: all 0.3s ease; transition: all 0.3s ease;
border: 2px solid transparent; /* 2px -> 0.53vw */
border: 0.53vw solid transparent;
} }
.indicator:hover { .indicator:hover {
@@ -492,7 +519,8 @@ onUnmounted(() => {
.indicator.active { .indicator.active {
background: #fff; background: #fff;
width: 28px; /* 28px -> 7.47vw */
width: 7.47vw;
border-radius: 5px; border-radius: 5px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
} }
@@ -500,21 +528,24 @@ onUnmounted(() => {
/* 移动端适配 */ /* 移动端适配 */
@media (max-width: 768px) { @media (max-width: 768px) {
.game-page { .game-page {
padding: 10px; /* 10px -> 2.67vw */
padding: 2.67vw;
} }
.carousel-container { .carousel-container {
padding: 0 10px; /* 0 10px -> 0 2.67vw */
padding: 0 2.67vw;
} }
.carousel-slide { .carousel-slide {
min-width: calc(100% - 12vw); min-width: calc(100% - 12vw);
width: calc(100% - 12vw); width: calc(100% - 12vw);
margin: 0 10px; margin: 0 2.67vw;
} }
.carousel-track { .carousel-track {
padding: 10px 0; /* 10px 0 -> 2.67vw 0 */
padding: 2.67vw 0;
} }
} }
</style> </style>