style: 移动端适配

This commit is contained in:
2026-03-19 15:15:38 +08:00
parent 4989bb7156
commit 6a08f2cede
11 changed files with 59 additions and 45 deletions

View File

@@ -569,8 +569,10 @@ ul {
padding: 0 6rem 6.4rem;
font-size: 2rem;
margin-top: 2rem;
.list-items li::before {
border-radius: 50%;
.list-items {
li::before {
border-radius: 50%;
}
}
}
.context {

View File

@@ -191,7 +191,8 @@ p {
&.mobile {
background: url('@/assets/images/mobile_version_background/bloom_bg.png') no-repeat;
background-size: 100% 100%;
height: 83.1rem;
// height: 83.1rem;
height: 110vw;
padding-top: 6rem;
.title {
font-size: 3.2rem;
@@ -202,7 +203,8 @@ p {
margin-bottom: 6.2rem;
}
.desc {
padding: 0 6.5rem 0 6.7rem;
// padding: 0 6.5rem 0 6.7rem;
padding: 0 8.5vw;
font-size: 2rem;
line-height: 3rem;
}

View File

@@ -191,7 +191,7 @@ onBeforeUnmount(() => {
grid-column-gap: 6rem;
grid-row-gap: 7rem;
.item {
width: 21rem;
width: initial;
height: initial;
&:nth-of-type(3) {
width: 30rem;

View File

@@ -2,14 +2,14 @@
<div
ref="containerRef"
class="timeline-container container flex flex-col align-center"
:class="{ mobile: isMobileOrNarrow, vertical: showVertical }"
:class="{ mobile: isMobileOrNarrow, vertical: isMobile }"
>
<div class="timeline-title">{{ $t('AwardsPage.competitionTimeline') }}</div>
<div class="desc">{{ $t('AwardsPage.shapingTheFuture') }}</div>
<!-- 纵向时间线移动端或宽度 <= 1200px -->
<div
v-if="showVertical"
v-if="isMobile"
class="timeline-point timeline-vertical flex flex-col"
ref="timelineRef"
>
@@ -73,8 +73,7 @@ const { t } = useI18n()
const isMobile = inject<boolean>('isMobile')
const windowWidth = ref(typeof window !== 'undefined' ? window.innerWidth : 1201)
const showVertical = computed(() => !!isMobile || windowWidth.value <= 1200)
const isMobileOrNarrow = computed(() => showVertical.value)
const isMobileOrNarrow = computed(() => isMobile.value)
const updateWindowWidth = () => {
windowWidth.value = window.innerWidth
@@ -123,7 +122,7 @@ const playAnimation = () => {
const subtitle = containerRef.value.querySelector('.desc')
const timeline = containerRef.value.querySelector('.timeline-point')
const line = containerRef.value.querySelector(
showVertical.value ? '.vertical-line' : '.timeline-line'
isMobile.value ? '.vertical-line' : '.timeline-line'
)
const tl = gsap.timeline()
@@ -131,7 +130,7 @@ const playAnimation = () => {
// 整体 timeline 的裁剪展开(仅横向使用)
// 纵向时跳过裁剪动画,改用每个 item 从上方落下的动画
if (timeline && !showVertical.value) {
if (timeline && !isMobile.value) {
tl.fromTo(
timeline,
{
@@ -149,7 +148,7 @@ const playAnimation = () => {
// 线条动画:横向 scaleX纵向 scaleY
// 纵向时线条与 item 动画同步进行
if (line) {
if (showVertical.value) {
if (isMobile.value) {
tl.from(
line,
{
@@ -192,11 +191,11 @@ const playAnimation = () => {
// 行内内容:桌面端用 .grid-cell纵向用 .vertical-item
// 纵向时,每个 item 从上方落下 + 渐显
const textItems = showVertical.value
const textItems = isMobile.value
? containerRef.value.querySelectorAll('.vertical-item')
: containerRef.value.querySelectorAll('.grid-cell')
if (textItems && textItems.length) {
if (showVertical.value) {
if (isMobile.value) {
// 纵向:每个 item 从上方落下 + 渐显
tl.from(
textItems,