/* Performance 8M — Root app */ function App() { const [t, setTweak] = window.useTweaks(window.TWEAK_DEFAULTS); // Apply CSS variables from tweaks React.useEffect(() => { document.documentElement.style.setProperty('--accent', t.accent); // Derive supporting tones const hex = t.accent.replace('#', ''); const r = parseInt(hex.substring(0, 2), 16); const g = parseInt(hex.substring(2, 4), 16); const b = parseInt(hex.substring(4, 6), 16); document.documentElement.style.setProperty('--accent-glow', `rgba(${r}, ${g}, ${b}, 0.35)`); // pick black or white ink based on luminance const lum = (0.2126 * r + 0.7152 * g + 0.0722 * b) / 255; document.documentElement.style.setProperty('--accent-ink', lum > 0.6 ? '#0a0f00' : '#f4f4ef'); // density if (t.density === 'compact') { document.documentElement.style.setProperty('--gap-section', 'clamp(60px, 8vw, 110px)'); } else { document.documentElement.style.setProperty('--gap-section', 'clamp(80px, 12vw, 160px)'); } }, [t.accent, t.density]); return ( setTweak('accent', v)} options={['#d4ff3a', '#39ff88', '#ff4d2e', '#3aa3ff', '#ffd23a']} /> setTweak('density', v)} options={[ { value: 'default', label: 'Arejado' }, { value: 'compact', label: 'Compacto' }, ]} /> setTweak('stickyCta', v)} /> document.getElementById('modulos').scrollIntoView({ behavior: 'smooth' })} /> document.getElementById('oferta').scrollIntoView({ behavior: 'smooth' })} /> ); } const root = ReactDOM.createRoot(document.getElementById('root')); root.render();