/* Tweaks app — three expressive controls that reshape the feel of the page. Mood (palette), Voice (typography), Texture (grain + glow atmosphere). */ const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{ "mood": "editorial", "voice": "editorial", "texture": "editorial" }/*EDITMODE-END*/; const MOODS = [ { value: 'editorial', label: 'Editorial' }, { value: 'midnight', label: 'Midnight' }, { value: 'library', label: 'Library' }, ]; const VOICES = [ { value: 'editorial', label: 'Editorial' }, { value: 'modern', label: 'Modern' }, { value: 'manuscript', label: 'Manuscript' }, ]; const TEXTURES = [ { value: 'subtle', label: 'Subtle' }, { value: 'editorial', label: 'Editorial' }, { value: 'lush', label: 'Lush' }, ]; function applyClass(prefix, value){ const b = document.body; // Remove any existing class with this prefix [...b.classList].forEach(c => { if (c.startsWith(prefix + '-')) b.classList.remove(c); }); b.classList.add(`${prefix}-${value}`); } function TweaksApp(){ const [t, setTweak] = useTweaks(TWEAK_DEFAULTS); React.useEffect(() => { applyClass('mood', t.mood); }, [t.mood]); React.useEffect(() => { applyClass('voice', t.voice); }, [t.voice]); React.useEffect(() => { applyClass('texture', t.texture); }, [t.texture]); return ( setTweak('mood', v)} /> setTweak('voice', v)} /> setTweak('texture', v)} /> ); } ReactDOM.createRoot(document.getElementById('tweaks-root')).render();