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:
2026-09-01 20:57:50 +08:00
parent 13e2a7a674
commit e4ee38175e
4 changed files with 60 additions and 24 deletions
+6 -6
View File
@@ -1,10 +1,7 @@
"use client";
import {
useEffect,
useState,
useSyncExternalStore,
} from "react";
import { useEffect, useState, useSyncExternalStore } from "react";
import { usePathname } from "next/navigation";
import { loadingBus } from "@/lib/loadingBus";
import LoadingCurtain from "@/components/canvas/LoadingCurtain";
@@ -71,6 +68,9 @@ export function useAppReady(): boolean {
export function LoadingOverlay() {
const heavy = useHeavyLoad();
const fontsReady = useFontsReady();
// Original useHomeLoadingGate: the entry curtain is a "/"-only flow —
// detail routes render with no loading curtain at all.
const pathname = usePathname();
// wait → fading → reveal → (unmount when reveal completes)
const [phase, setPhase] = useState<"wait" | "fading" | "reveal">("wait");
@@ -92,7 +92,7 @@ export function LoadingOverlay() {
return () => window.clearTimeout(t2);
}, [phase]);
if (!mounted) return null;
if (!mounted || pathname !== "/") return null;
return (
<>