// waiv-nfc-scene.jsx โ€” pinned scroll scene: the card's surface dissolves to // reveal the copper antenna + NTAG 424 DNA chip, scrubbed by scroll progress. function NFCScene() { const trackRef = React.useRef(null); const stickyRef = React.useRef(null); const cardRef = React.useRef(null); const faceRef = React.useRef(null); const xrayRef = React.useRef(null); const chipRef = React.useRef(null); const scanRef = React.useRef(null); const coilRef = React.useRef(null); const annoChipRef = React.useRef(null); const annoCoilRef = React.useRef(null); const capRefs = React.useRef([]); const dotRefs = React.useRef([]); React.useEffect(() => { const clamp = (v, a, b) => Math.min(b, Math.max(a, v)); const smooth = (e0, e1, x) => { const t = clamp((x - e0) / (e1 - e0), 0, 1); return t * t * (3 - 2 * t); }; let raf; const tick = () => { const track = trackRef.current, sticky = stickyRef.current; if (track && sticky) { const r = track.getBoundingClientRect(); const vh = window.innerHeight; const p = clamp(-r.top / (r.height - vh), 0, 1); // card rotation const card = cardRef.current; const ry = -20 + p * 34; const rx = 9 - p * 6; const rz = 2 - p * 3; if (card) card.style.transform = `rotateX(${rx.toFixed(2)}deg) rotateY(${ry.toFixed(2)}deg) rotateZ(${rz.toFixed(2)}deg)`; // surface dissolve / xray rise if (faceRef.current) faceRef.current.style.opacity = (1 - smooth(0.1, 0.36, p)).toFixed(3); if (xrayRef.current) xrayRef.current.style.opacity = smooth(0.16, 0.42, p).toFixed(3); // antenna coil draws in ring by ring if (coilRef.current) { const rings = coilRef.current.children; for (let i = 0; i < rings.length; i++) { const o = smooth(0.26 + i * 0.028, 0.40 + i * 0.028, p); rings[i].style.opacity = (o * (0.55 + 0.45 * (1 - i / rings.length))).toFixed(3); } } // chip arrives + glows if (chipRef.current) { const c = smooth(0.5, 0.66, p); chipRef.current.style.opacity = c.toFixed(3); chipRef.current.style.transform = `scale(${(0.7 + 0.3 * c).toFixed(3)})`; } if (scanRef.current) { const s = smooth(0.18, 0.3, p) * (1 - smooth(0.9, 1, p)); scanRef.current.style.opacity = s.toFixed(3); scanRef.current.style.top = (-18 + p * 118) + '%'; } // annotations annoCoilRef.current && annoCoilRef.current.classList.toggle('is-on', p > 0.34 && p < 0.99); annoChipRef.current && annoChipRef.current.classList.toggle('is-on', p > 0.56); // live pulse near the end sticky.classList.toggle('is-live', p > 0.74); // captions + dots (4 phases) const phase = p >= 0.78 ? 3 : p >= 0.54 ? 2 : p >= 0.28 ? 1 : 0; capRefs.current.forEach((el, i) => el && el.classList.toggle('is-on', i === phase)); dotRefs.current.forEach((el, i) => el && el.classList.toggle('is-on', i <= phase)); } raf = requestAnimationFrame(tick); }; raf = requestAnimationFrame(tick); return () => cancelAnimationFrame(raf); }, []); const caps = [ <>It looks like an ordinary premium card., <>Beneath the finish โ€” a full-card copper antenna., <>At its heart, an NTAG 424 DNA secure chip., <>13.56 MHz. AES-encrypted. Impossible to clone., ]; return (
); } window.NFCScene = NFCScene;