/* Root — compõe o site, observa reveal e expõe as variações via Tweaks */ const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{ "heroVariant": "D", "createVariant": "B", "dFill": 0.5, "dDensity": 39, "dReveal": 150 }/*EDITMODE-END*/; function useMotion(deps) { React.useEffect(() => { // novos nós podem ter sido injetados (troca de variante) const id = requestAnimationFrame(() => window.Motion && window.Motion.refreshMotion()); return () => cancelAnimationFrame(id); }, deps); React.useEffect(() => { if (window.Motion) window.Motion.initParallax(); }, []); } function App() { const [t, setTweak] = useTweaks(TWEAK_DEFAULTS); const isD = t.heroVariant === "D"; useMotion([t.heroVariant, t.createVariant]); const heroLabels = { D: "Confete revela o logo (interativo)", A: "Editorial (foto à direita)", B: "Manifesto (centralizado)", C: "Assimétrico (com sorriso)" }; const createLabels = { A: "Lista vertical", B: "Linha do tempo (scroll)" }; return (
{isD ? : }
setTweak("heroVariant", v)} />
{heroLabels[t.heroVariant]}
{isD ? ( setTweak("dFill", v)} /> setTweak("dDensity", v)} /> setTweak("dReveal", v)} /> ) : null} setTweak("createVariant", v)} />
{createLabels[t.createVariant]}
); } ReactDOM.createRoot(document.getElementById("root")).render();