// Shared hooks and small utilities const { useState, useEffect, useRef, useCallback, useMemo } = React; function useScrollY() { const [y, setY] = useState(0); useEffect(() => { let raf = 0; const onScroll = () => { if (raf) return; raf = requestAnimationFrame(() => { setY(window.scrollY); raf = 0; }); }; window.addEventListener('scroll', onScroll, { passive: true }); return () => window.removeEventListener('scroll', onScroll); }, []); return y; } function useMouse() { const [m, setM] = useState({ x: 0.5, y: 0.5 }); useEffect(() => { const on = (e) => setM({ x: e.clientX / window.innerWidth, y: e.clientY / window.innerHeight }); window.addEventListener('mousemove', on); return () => window.removeEventListener('mousemove', on); }, []); return m; } // Small sparkle/ornament SVGs const Ornament = ({ className }) => (
); // Delicate sigil SVG — used as repeating motif const Sigil = ({ size = 80, stroke = 1 }) => ( ); Object.assign(window, { useScrollY, useMouse, Ornament, Sigil });