/* Tweaks panel — accent color picker for the Archeve site. Loaded as a Babel/JSX script. Persists the chosen accent via the host's __edit_mode_set_keys protocol (writes back to the EDITMODE block). */ const { useState, useEffect } = React; const ACCENT_OPTIONS = [ { id: 'coral', label: 'Brand coral', swatch: '#F75F49', sub: 'Default · sampled from the logo' }, { id: 'ink', label: 'Ink only', swatch: '#15110F', sub: 'Monochrome · maximum restraint' }, { id: 'indigo', label: 'Drafting indigo', swatch: '#3A4FB2', sub: 'Engineering-blue alt' }, { id: 'forest', label: 'Civic forest', swatch: '#1F6E54', sub: 'Sustainability alt' }, ]; function ArcheveTweaks() { const initial = (window.ARCHEVE_TWEAKS && window.ARCHEVE_TWEAKS.accent) || 'coral'; const [accent, setAccent] = useState(initial); useEffect(() => { if (window.ArcheveAccent) window.ArcheveAccent.apply(accent); }, [accent]); const onPick = (id) => { setAccent(id); try { window.parent.postMessage( { type: '__edit_mode_set_keys', edits: { accent: id } }, '*' ); } catch (_) {} }; return (
Applies across nav, arches, CTAs, project pins, and the closing line.
{ACCENT_OPTIONS.map((opt) => { const active = opt.id === accent; return ( ); })}
); } const tweaksHost = document.createElement('div'); document.body.appendChild(tweaksHost); ReactDOM.createRoot(tweaksHost).render();