/* ============================================================ CHAINUS — Showcase (sticky scroll story), Education, How ============================================================ */ function InterfaceLayers({ t }) { const layers = t.dir === 'zh' ? ['社区层', '资产层', '行情层'] : ['Community layer', 'Asset layer', 'Market layer']; return (
); } function Showcase({ t }) { const [active, setActive] = useState(0); const panelRefs = useRef([]); useEffect(() => { const pickNearestPanel = () => { const center = window.innerHeight / 2; let next = 0; let best = Infinity; panelRefs.current.forEach((el, idx) => { if (!el) return; const rect = el.getBoundingClientRect(); if (rect.bottom < 0 || rect.top > window.innerHeight) return; const dist = Math.abs(rect.top + rect.height / 2 - center); if (dist < best) { best = dist; next = idx; } }); setActive(next); }; const io = new IntersectionObserver(pickNearestPanel, { threshold: [0, 0.25, 0.55, 0.8], rootMargin: '-18% 0px -18% 0px' }); panelRefs.current.forEach((el) => el && io.observe(el)); pickNearestPanel(); return () => io.disconnect(); }, []); return ({s.body}
{e.terms[i].plain}
{s.body}