// Elegancy Glass — App const { useEffect } = React; const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{ "accent": "#25447b", "darkMode": false, "showGalleryTags": true }/*EDITMODE-END*/; const ACCENT_PRESETS = { "Elegancy Blue": "#25447b", "Azul escuro": "#1d3561", "Azul médio": "#2e5fa3", "Grafite": "#3a4a5c", "Champagne": "#b08555", }; function App() { const [tweaks, setTweak] = useTweaks(TWEAK_DEFAULTS); // Apply theme + accent useEffect(() => { const root = document.documentElement; root.setAttribute('data-theme', tweaks.darkMode ? 'dark' : 'light'); root.style.setProperty('--accent', tweaks.accent); // derive deep variant root.style.setProperty('--accent-deep', shade(tweaks.accent, -15)); }, [tweaks.accent, tweaks.darkMode]); // Reveal-on-scroll useEffect(() => { const obs = new IntersectionObserver((entries) => { entries.forEach(e => { if (e.isIntersecting) { e.target.classList.add('in'); obs.unobserve(e.target); } }); }, { threshold: 0.12 }); document.querySelectorAll('.section, .testimonial, .service, .why-cell, .process-item, .gallery-item, .faq-item, .hero-meta-item').forEach(el => { el.classList.add('reveal'); obs.observe(el); }); return () => obs.disconnect(); }, []); return ( <> setTweak('darkMode', v)} /> {Object.entries(ACCENT_PRESETS).map(([name, color]) => ( setTweak('accent', color)} title={name} style={{ height: 36, borderRadius: 6, background: color, border: tweaks.accent === color ? '2px solid #000' : '1px solid #e5e5e5', cursor: 'pointer', }}/> ))} setTweak('accent', v)} /> setTweak('showGalleryTags', v)} /> > ); } function shade(hex, percent) { const c = hex.replace('#',''); const r = parseInt(c.slice(0,2),16); const g = parseInt(c.slice(2,4),16); const b = parseInt(c.slice(4,6),16); const f = (1 + percent/100); const cap = (n) => Math.max(0, Math.min(255, Math.round(n*f))); return '#' + [cap(r), cap(g), cap(b)].map(x => x.toString(16).padStart(2,'0')).join(''); } ReactDOM.createRoot(document.getElementById('root')).render();