// main.jsx — App composition + tweaks
const { useState: __ms, useEffect: __me } = React;
const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{
"accent": "#FF3EA5",
"speed": 1,
"density": "regular",
"dark": false,
"hero": "orb"
}/*EDITMODE-END*/;
const ACCENT_OPTIONS = [
'#FF3EA5', // magenta
'#4361FF', // azure
'#C8FF3E', // lime
'#FF6B1A', // tangerine
'#9D5BFF', // violet
'#2DD4FF', // cyan
];
function App() {
const [t, setTweak] = useTweaks(TWEAK_DEFAULTS);
const [lang, setLang] = __ms('es');
const dict = COPY[lang];
// El panel de Tweaks solo aparece en modo dev (?dev=1) o en localhost
const isDev = typeof window !== 'undefined' && (
/[?&]dev=1\b/.test(window.location.search) ||
/^(localhost|127\.|192\.168\.|0\.0\.0\.0)/.test(window.location.hostname)
);
useCustomCursor();
useReveal();
// Refrescar íconos Lucide cuando React re-renderiza
__me(() => {
const id = setTimeout(() => { if (window.refreshLucide) window.refreshLucide(); }, 50);
return () => clearTimeout(id);
});
__me(() => {
const root = document.documentElement;
root.style.setProperty('--accent', t.accent);
root.style.setProperty('--magenta', t.accent);
const speed = Number(t.speed) || 1;
root.style.setProperty('--speed', String(speed));
const dens = { compact: 0.7, regular: 1, comfy: 1.3 }[t.density] || 1;
root.style.setProperty('--density', String(dens));
root.setAttribute('data-theme', t.dark ? 'dark' : 'light');
}, [t]);
__me(() => {
requestAnimationFrame(() => {
document.querySelectorAll('.reveal, .reveal-word').forEach(el => el.classList.add('in'));
});
}, [lang]);
return (
<>