/* Candela — Tweaks panel (drives the vanilla page via window.__candela + CSS vars) */ const { useState, useEffect } = React; const CANDELA_TWEAK_DEFAULTS = { "heroImage": "candela1", "accent": "#b14431", "motion": true }; const HERO_OPTIONS = [ { value: "candela1", label: "The Bar" }, { value: "candela5", label: "The Lounge" }, { value: "candela3", label: "The Mezzanine" } ]; function heroSrc(key) { return 'uploads/' + key + '.jpeg'; } function CandelaTweaks() { const [t, setTweak] = useTweaks(CANDELA_TWEAK_DEFAULTS); useEffect(() => { if (window.__candela) window.__candela.setHero(heroSrc(t.heroImage)); }, [t.heroImage]); useEffect(() => { document.documentElement.style.setProperty('--accent', t.accent); }, [t.accent]); useEffect(() => { if (window.__candela) window.__candela.setMotion(!!t.motion); }, [t.motion]); return ( setTweak('heroImage', v)} /> setTweak('accent', v)} /> setTweak('motion', v)} /> ); } ReactDOM.createRoot(document.getElementById('tweaks-root')).render();