// tweaks-app.jsx — mounts the Tweaks overlay and maps tweak values onto
// the plain-HTML page via CSS custom properties + body data-attributes.
const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{
"palette": ["#17285e", "#c08e34", "#f4f3ef"],
"headingFont": "Marcellus",
"motion": "immersive"
}/*EDITMODE-END*/;
const HEADING_STACKS = {
"Marcellus": "'Marcellus', serif",
"Cormorant Garamond": "'Cormorant Garamond', serif",
"Playfair Display": "'Playfair Display', serif"
};
function TweaksApp() {
const [t, setTweak] = useTweaks(TWEAK_DEFAULTS);
React.useEffect(() => {
const root = document.documentElement;
const pal = t.palette || TWEAK_DEFAULTS.palette;
root.style.setProperty('--primary', pal[0]);
root.style.setProperty('--accent', pal[1]);
root.style.setProperty('--bg', pal[2]);
root.style.setProperty('--font-display', HEADING_STACKS[t.headingFont] || HEADING_STACKS.Marcellus);
document.body.setAttribute('data-motion', t.motion || 'immersive');
}, [t.palette, t.headingFont, t.motion]);
return (
setTweak('palette', v)}
/>
setTweak('headingFont', v)}
/>
setTweak('motion', v)}
/>
);
}
ReactDOM.createRoot(document.getElementById('tweaks-root')).render();