/* ============================================================ 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 (
{t.showcase.slides.map((s, i) => (
))}
{t.showcase.slides.map((s, i) => )}
{t.showcase.slides.map((s, i) => (
(panelRefs.current[i] = el)} className={`showcase-panel ${active === i ? 'on' : ''}`}> {String(i + 1).padStart(2, '0')} / {String(t.showcase.slides.length).padStart(2, '0')}

{s.title}

{s.body}

))}
); } /* ---- Education / onboarding ---- */ function Education({ t }) { const e = t.education; const [i, setI] = useState(0); return (
{e.title[0]} {e.title[1]} {e.sub} {e.points.map((p, idx) => (
{p}
))}
{e.translateLabel}
{e.terms.map((term, idx) => ( ))}
{e.terms[i].term}{e.humanLabel}

{e.terms[i].plain}

); } function HowItWorks({ t }) { const loop = t.dir === 'zh' ? ['发现', '理解', '上链', '交流', '追踪'] : ['Discover', 'Understand', 'Tokenize', 'Discuss', 'Track']; return (
ChainUs
{loop.map((l, i) => {l})}
{t.how.steps.map((s, i) => (
{s.n}

{s.title}

{s.body}

))}
); } Object.assign(window, { InterfaceLayers, Showcase, Education, HowItWorks });