// main.jsx — bootstrap para madresia.space // // Monta el Sol tejido dentro de #hero-canvas (hero de 100vh). No incluye // overlay de pregunta — el texto del manifiesto vive en las secciones // editoriales del HTML (flujo Glasswing). function HeroStage({ duration = 24, children }) { const [time, setTime] = React.useState(0); const rafRef = React.useRef(null); const lastTsRef = React.useRef(null); React.useEffect(() => { const step = (ts) => { if (lastTsRef.current == null) lastTsRef.current = ts; const dt = (ts - lastTsRef.current) / 1000; lastTsRef.current = ts; // El Sol no hace loop — solo progresa. Cap a 1000s para que los cálculos // de shimmer/breath no exploten numéricamente en sesiones muy largas. setTime((t) => Math.min(t + dt, 1000)); rafRef.current = requestAnimationFrame(step); }; rafRef.current = requestAnimationFrame(step); return () => { if (rafRef.current) cancelAnimationFrame(rafRef.current); lastTsRef.current = null; }; }, [duration]); const ctxValue = React.useMemo( () => ({ time, duration, playing: true }), [time, duration] ); return (
{children}
); } const heroHost = document.getElementById('hero-canvas'); if (heroHost) { const root = ReactDOM.createRoot(heroHost); root.render( ); }