// tweaks-app.jsx — typography + accent explorer for the Frances site. // Persists to localStorage so the choice carries across every page. const FR_DEFAULTS = /*EDITMODE-BEGIN*/{ "heading": "serif", "accent": "#2f6fd0" }/*EDITMODE-END*/; function readStored() { let h = FR_DEFAULTS.heading, a = FR_DEFAULTS.accent; try { h = localStorage.getItem('frances-heading') || h; a = localStorage.getItem('frances-accent') || a; } catch (e) {} return { heading: h, accent: a }; } function applyAll(t) { const root = document.documentElement; root.setAttribute('data-heading', t.heading); root.style.setProperty('--blue', t.accent); try { localStorage.setItem('frances-heading', t.heading); localStorage.setItem('frances-accent', t.accent); } catch (e) {} } function FrancesTweaks() { const [t, setT] = React.useState(readStored); React.useEffect(() => { applyAll(t); }, [t]); const set = (k, v) => setT(prev => ({ ...prev, [k]: v })); return ( set('heading', v)} /> set('accent', v)} /> ); } (function mount() { const el = document.getElementById('tweaks-root'); if (el && window.ReactDOM) { ReactDOM.createRoot(el).render(); } })();