fix: restore in-view class assignment so pain-point content is visible on mobile

This commit is contained in:
Omega 2026-04-20 23:53:19 +08:00
parent c705bc96e9
commit 9accd17836
1 changed files with 8 additions and 0 deletions

View File

@ -1030,6 +1030,10 @@
} else { } else {
isAnimating = false; isAnimating = false;
currentIndex = index; currentIndex = index;
// 给当前及之前所有卡片加 in-view确保内容可见
snapTargets.forEach((t, i) => {
if (i <= index) t.classList.add('in-view');
});
} }
} }
animFrame = requestAnimationFrame(step); animFrame = requestAnimationFrame(step);
@ -1037,6 +1041,10 @@
// 初始化 // 初始化
currentIndex = findCurrentIndex(); currentIndex = findCurrentIndex();
// 初始就给当前屏加 in-view
snapTargets.forEach((t, i) => {
if (i <= currentIndex) t.classList.add('in-view');
});
// 完全接管触摸滚动 - 禁止原生滚动 // 完全接管触摸滚动 - 禁止原生滚动
let canScroll = true; let canScroll = true;