Skip to content

Commit e595984

Browse files
hotfix: mobile reading issue
1 parent 7797386 commit e595984

3 files changed

Lines changed: 24 additions & 4 deletions

File tree

site/.vitepress/theme/components/HomeHeroVisual.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,9 @@ onBeforeUnmount(() => {
249249
250250
@media (max-width: 639px) {
251251
.hero-visual {
252-
max-width: 100%;
252+
/* 手机端父容器(.image-container)是 width:auto 按内容撑开,max-width:100% 会相对它而非视口,
253+
故直接按视口约束:100vw - 48px(= 手机端 hero 左右各 24px 内边距后的内容宽度)。 */
254+
max-width: calc(100vw - 48px);
253255
}
254256
.terminal__body {
255257
font-size: 13px;

site/.vitepress/theme/custom.css

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,8 +475,14 @@
475475
display: none !important;
476476
}
477477

478+
/* 移动端把标题(.container)置于终端(.image)上方:order 1 < 2(桌面本就是 container 在左,不受影响) */
479+
.VPHero .container {
480+
order: 1 !important;
481+
}
482+
478483
.VPHero .image {
479-
margin: 24px auto 0 !important;
484+
order: 2 !important;
485+
margin: 40px auto 0 !important;
480486
}
481487

482488
.VPHero .image-container {
@@ -486,7 +492,7 @@
486492

487493
@media (min-width: 640px) {
488494
.VPHero .image {
489-
margin: 32px auto 0 !important;
495+
margin: 40px auto 0 !important;
490496
}
491497
}
492498

@@ -508,6 +514,17 @@
508514
}
509515
}
510516

517+
/* ── Proof 条:移动端(<960,hero 堆叠)夹在标题与终端之间;桌面端(≥960)仍在 hero 下方 ──
518+
两个实例按视口切换显隐。移动端那条放在 home-hero-actions-after(标题块末尾、终端之前),
519+
底边距归零——终端的 margin-top 提供 proof→终端 的间隙。 */
520+
.proof-on-mobile { display: none; }
521+
.proof-on-desktop { display: block; }
522+
.proof-on-mobile .proof-strip { margin-bottom: 0 !important; }
523+
@media (max-width: 959px) {
524+
.proof-on-mobile { display: block; }
525+
.proof-on-desktop { display: none; }
526+
}
527+
511528
/* ── Feature Card Entrance Animation ────────────────────────── */
512529

513530
@keyframes feature-fade-up {

site/.vitepress/theme/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ export default {
2020
Layout() {
2121
return h(DefaultTheme.Layout, null, {
2222
'home-hero-image': () => h(HomeHeroVisual),
23-
'home-hero-after': () => h(ProofStrip),
23+
'home-hero-actions-after': () => h('div', { class: 'proof-on-mobile' }, [h(ProofStrip)]),
24+
'home-hero-after': () => h('div', { class: 'proof-on-desktop' }, [h(ProofStrip)]),
2425
'home-features-before': () => h(HomeTipBanner),
2526
'home-features-after': () => h(HomeRoadmap),
2627
})

0 commit comments

Comments
 (0)