/* global React, ReactDOM, TweaksPanel, TweakSection, TweakRadio, TweakSlider, useTweaks */ const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{ "palette": "violet", "intensity": 0, "wash": 20, "particles": true }/*EDITMODE-END*/; const PALETTES = { // Restrained, single-hue family — recommended default violet: { label: "Violeta sereno", c1: "#a5b4fc", c2: "#c4b5fd", c3: "#93c5fd", c4: "#ddd6fe", p1: "rgba(124, 58, 237, .28)", p2: "rgba(59, 130, 246, .18)", p3: "rgba(99, 102, 241, .10)", }, // Almost no color — Vercel/Linear style mono: { label: "Neutro mineral", c1: "#cbd5e1", c2: "#e2e8f0", c3: "#94a3b8", c4: "#cbd5e1", p1: "rgba(71, 85, 105, .18)", p2: "rgba(100, 116, 139, .12)", p3: "rgba(148, 163, 184, .08)", }, // Soft tech — peach + lavender warm: { label: "Cálido suave", c1: "#fecaca", c2: "#fbcfe8", c3: "#ddd6fe", c4: "#fde68a", p1: "rgba(244, 114, 182, .22)", p2: "rgba(251, 146, 60, .18)", p3: "rgba(167, 139, 250, .12)", }, // Original — full brand spectrum brand: { label: "Marca completa", c1: "#ff2d20", c2: "#7a2dbf", c3: "#1e1ee0", c4: "#c0224a", p1: "rgba(122, 45, 191, .32)", p2: "rgba(30, 30, 224, .22)", p3: "rgba(255, 45, 32, .12)", }, // Cold, sober — graphite + deep blue cool: { label: "Acero profundo", c1: "#1e293b", c2: "#3b82f6", c3: "#64748b", c4: "#1e40af", p1: "rgba(59, 130, 246, .22)", p2: "rgba(30, 64, 175, .14)", p3: "rgba(100, 116, 139, .08)", }, }; function App() { const [t, setTweak] = useTweaks(TWEAK_DEFAULTS); React.useEffect(() => { const bg = document.querySelector('.hero-bg'); if (!bg) return; const p = PALETTES[t.palette] || PALETTES.violet; bg.style.setProperty('--c1', p.c1); bg.style.setProperty('--c2', p.c2); bg.style.setProperty('--c3', p.c3); bg.style.setProperty('--c4', p.c4); bg.style.setProperty('--p1', p.p1); bg.style.setProperty('--p2', p.p2); bg.style.setProperty('--p3', p.p3); bg.style.setProperty('--intensity', (t.intensity / 100).toFixed(2)); // wash maps inversely — higher wash = more white veil = less color const top = 0.30 + (t.wash / 100) * 0.55; const bot = 0.65 + (t.wash / 100) * 0.30; bg.style.setProperty('--wash-top', top.toFixed(2)); bg.style.setProperty('--wash-bot', bot.toFixed(2)); bg.style.setProperty('--particles', t.particles ? '1' : '0'); }, [t]); // Build palette options as small SVG swatches (a horizontal gradient of the 4 blob colors) const swatch = (p) => ` `; return (
{Object.entries(PALETTES).map(([key, p]) => { const active = t.palette === key; return ( ); })}
setTweak('particles', v)} /> setTweak('intensity', v)} min={10} max={100} step={5} unit="%" /> setTweak('wash', v)} min={0} max={100} step={5} unit="%" />
); } const mount = document.getElementById('tweaks-root'); if (mount) { ReactDOM.createRoot(mount).render(); }