// app.jsx — main app shell, routing, tweaks const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{ "heroVariant": "signature", "density": "regular", "fontPair": "editorial", "palette": "terracotta", "dark": false }/*EDITMODE-END*/; function applyTweaks(t) { const root = document.documentElement; root.setAttribute('data-density', t.density); root.setAttribute('data-fontpair', t.fontPair); root.setAttribute('data-palette', t.palette); root.setAttribute('data-mode', t.dark ? 'dark' : 'light'); } const PALETTES = { // Terracotta — paleta-mãe Humanāre (real). Cream + queimado + ocre + tinta profunda. terracotta: { bg:'#F4ECE0', paper:'#EADDC9', soft:'#E3C7A6', line:'#D4B898', clay:'#B5784A', terracotta:'#A04D2E', terracottaSoft:'#C2683E', lime:'#C9994C', limeDeep:'#A8803A', ink:'#1F1815', inkSoft:'#5C4A3E', inkMute:'#8E7763' }, // Cream profundo — variação mais delicada (linho, papelaria fina) earth: { bg:'#F8F1E4', paper:'#EFE3CD', soft:'#DCC9A7', line:'#C8B89C', clay:'#A88B6E', terracotta:'#B5562E', terracottaSoft:'#C77550', lime:'#C9994C', limeDeep:'#A8803A', ink:'#28221C', inkSoft:'#5C5147', inkMute:'#8A7E6E' }, // Floresta — alternativa institucional forest: { bg:'#F0EDE2', paper:'#DBD7C5', soft:'#B8BBA0', line:'#9AA081', clay:'#5E6B47', terracotta:'#2C3D14', terracottaSoft:'#4F6B22', lime:'#C9994C', limeDeep:'#A8803A', ink:'#181C10', inkSoft:'#3D4A2C', inkMute:'#6B7560' }, // Noir — alto contraste editorial noir: { bg:'#F1ECE4', paper:'#E2DCD0', soft:'#CFC6B6', line:'#B5AB99', clay:'#7A6E5C', terracotta:'#A04D2E', terracottaSoft:'#C2683E', lime:'#C9994C', limeDeep:'#A8803A', ink:'#0F0C08', inkSoft:'#403930', inkMute:'#867A6C' }, }; function applyPalette(name) { const p = PALETTES[name] || PALETTES.earth; const r = document.documentElement; r.style.setProperty('--bg', p.bg); r.style.setProperty('--paper', p.paper); r.style.setProperty('--soft', p.soft); r.style.setProperty('--line', p.line); r.style.setProperty('--clay', p.clay); r.style.setProperty('--terracotta', p.terracotta); r.style.setProperty('--terracotta-soft', p.terracottaSoft); r.style.setProperty('--lime', p.lime); r.style.setProperty('--lime-deep', p.limeDeep); r.style.setProperty('--ink', p.ink); r.style.setProperty('--ink-soft', p.inkSoft); r.style.setProperty('--ink-mute', p.inkMute); } function App() { const [tweaks, setTweak] = useTweaks(TWEAK_DEFAULTS); const [route, setRoute] = React.useState(() => { const h = window.location.hash.replace('#', ''); return ['home','sobre','palestras','conteudo','contato'].includes(h) ? h : 'home'; }); // sync hash with route React.useEffect(() => { if (route !== 'home') window.location.hash = route; else if (window.location.hash) window.history.replaceState(null, '', window.location.pathname); }, [route]); // listen to back/forward React.useEffect(() => { const onHash = () => { const h = window.location.hash.replace('#', ''); setRoute(['home','sobre','palestras','conteudo','contato'].includes(h) ? h : 'home'); }; window.addEventListener('hashchange', onHash); return () => window.removeEventListener('hashchange', onHash); }, []); // apply tweaks React.useEffect(() => { applyTweaks(tweaks); }, [tweaks.density, tweaks.fontPair, tweaks.dark]); React.useEffect(() => { applyPalette(tweaks.palette); }, [tweaks.palette, tweaks.dark]); let page; if (route === 'sobre') page = ; else if (route === 'palestras') page = ; else if (route === 'conteudo') page = ; else if (route === 'contato') page = ; else page = ; return ( <> {page} { setTweak('heroVariant', v); setRoute('home'); window.scrollTo({top:0,behavior:'instant'}); }} /> setTweak('density', v)} /> setTweak('palette', v)} /> setTweak('dark', v)} /> setTweak('fontPair', v)} /> {[['home','Início'],['sobre','Sobre'],['palestras','Palestras'],['conteudo','Conteúdo'],['contato','Contato']].map(([k,l]) => ( { setRoute(k); window.scrollTo({top:0,behavior:'instant'}); }} style={{ fontFamily: 'var(--font-mono)', fontSize: '0.62rem', letterSpacing: '0.16em', textTransform: 'uppercase', padding: '8px 10px', border: '1px solid var(--line)', background: route === k ? 'var(--ink)' : 'transparent', color: route === k ? 'var(--bg)' : 'var(--ink-soft)', cursor: 'pointer', borderRadius: 6, }}>{l} ))} > ); } ReactDOM.createRoot(document.getElementById('root')).render();