/* artsol-app.jsx — orquestrador + tweaks de tema */ const ART_TWEAKS = /*EDITMODE-BEGIN*/{ "theme": "athena", "accent": "#E94A2E", "showAvatars": true, "showWhatsApp": true }/*EDITMODE-END*/; const THEME_ACCENTS = { athena: "#E94A2E", editorial: "#C9381F", nocturnal: "#F9B922", }; const ART_THEME_KEY = "artsol-theme"; const ART_ACCENT_KEY = "artsol-accent"; // pre-mount: avoid theme flash on subsequent loads (function preloadArtTheme() { try { const t = localStorage.getItem(ART_THEME_KEY) || "athena"; document.documentElement.classList.add("theme-" + t); const a = localStorage.getItem(ART_ACCENT_KEY); if (a) document.documentElement.style.setProperty("--accent", a); } catch {} })(); function App() { const initial = (() => { try { const storedTheme = localStorage.getItem(ART_THEME_KEY); const storedAccent = localStorage.getItem(ART_ACCENT_KEY); return { ...ART_TWEAKS, ...(storedTheme ? { theme: storedTheme } : {}), ...(storedAccent ? { accent: storedAccent, _accentTouched: true } : {}) }; } catch { return ART_TWEAKS; } })(); const [t, setTweak] = useTweaks(initial); // apply theme class on React.useEffect(() => { const html = document.documentElement; html.classList.remove("theme-athena", "theme-editorial", "theme-nocturnal"); html.classList.add("theme-" + t.theme); try { localStorage.setItem(ART_THEME_KEY, t.theme); } catch {} // each theme has its own preferred accent — sync accent to theme default // unless the user has explicitly picked a different one if (!t._accentTouched) { const newAccent = THEME_ACCENTS[t.theme] || "#E94A2E"; if (newAccent !== t.accent) setTweak("accent", newAccent); } }, [t.theme]); // apply accent custom color React.useEffect(() => { document.documentElement.style.setProperty("--accent", t.accent); try { localStorage.setItem(ART_ACCENT_KEY, t.accent); } catch {} }, [t.accent]); React.useEffect(() => { const io = new IntersectionObserver((entries) => { entries.forEach((e) => { if (e.isIntersecting) { e.target.classList.add("is-visible"); io.unobserve(e.target); } }); }, { threshold: 0.12 }); document.querySelectorAll(".reveal").forEach((el) => io.observe(el)); return () => io.disconnect(); }, []); return ( <>