fix: 详情页滚动与多余背景 — 对齐原站路由级 canvas 生命周期
- HeroScene/LoadingOverlay 仅在 "/" 渲染(原 canvas/set:详情页 reveal 后 卸载 canvas;entry 幕布是主页专属流程)——详情页不再有贴纸/背景 FX/玻璃 模型等"多余背景",也没有 loading 幕布 - 详情页滚动容器改为常规文档流:我们的 Lenis 是 window 级,原版的嵌套 overflow-y-auto 容器会吞掉滚轮导致页面不能滚动;窗口原生滚动接管 - SmoothScroller 按路由启停 Lenis(原 95212:主页 ReactLenis、详情页原生 滚动),路由切换时滚动复位到顶部(转场遮罩盖住跳变) - CDP 实测:详情页 wheel/End 滚动 ✅、canvas=0、幕布=0;返回主页后 canvas/Lenis/滚动条恢复、wheel 平滑滚动 ✅
This commit is contained in:
+15
-15
@@ -124,9 +124,8 @@ function Article({ slug }: { slug: string }) {
|
||||
const article = WORK_ARTICLES[slug];
|
||||
if (!article) {
|
||||
return (
|
||||
<div className="fixed inset-0 w-full h-full">
|
||||
<div className="w-full h-full overflow-y-auto overscroll-contain no-scrollbar">
|
||||
<article className="mx-auto px-6 py-18 lg:py-24 w-full max-w-[880px] text-l1">
|
||||
<>
|
||||
<article className="mx-auto px-6 py-18 lg:py-24 w-full max-w-[880px] text-l1">
|
||||
<header className="pt-[10vh]">
|
||||
<h1 className="font-bold text-3xl! text-l1 lg:text-5xl! leading-tight tracking-tight">
|
||||
404
|
||||
@@ -141,18 +140,20 @@ function Article({ slug }: { slug: string }) {
|
||||
</Link>
|
||||
</p>
|
||||
</header>
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
</>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<div className="fixed inset-0 w-full h-full">
|
||||
<div className="w-full h-full overflow-y-auto overscroll-contain no-scrollbar">
|
||||
<article
|
||||
data-mdx-article="true"
|
||||
className="mx-auto px-6 py-18 lg:py-24 w-full max-w-[880px] text-l1"
|
||||
>
|
||||
<>
|
||||
{/* The window (Lenis) is the scroller — the original nests its own
|
||||
overflow container per route because its Lenis wraps <main>; our
|
||||
Lenis is window-level, so a nested overflow div would swallow the
|
||||
wheel and kill scrolling. */}
|
||||
<article
|
||||
data-mdx-article="true"
|
||||
className="mx-auto px-6 py-18 lg:py-24 w-full max-w-[880px] text-l1"
|
||||
>
|
||||
<header className="pt-[10vh]">
|
||||
<h1 className="font-bold text-3xl! text-l1 lg:text-5xl! leading-tight tracking-tight" style={{ fontVariationSettings: '"wdth" 120' }}>
|
||||
{article.title}
|
||||
@@ -222,9 +223,8 @@ function Article({ slug }: { slug: string }) {
|
||||
</div>
|
||||
</footer>
|
||||
)}
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user