/* Tweaks island — drives the landing via attributes/CSS vars on .
The landing itself is plain HTML/CSS; this only flips switches. */
const VQR_DEFAULTS = /*EDITMODE-BEGIN*/{
"headline": "fraunces",
"hero": "split",
"accent": "#E2552E"
}/*EDITMODE-END*/;
function VqrTweaks() {
const [t, setTweak] = useTweaks(VQR_DEFAULTS);
const root = document.documentElement;
React.useEffect(() => { root.setAttribute('data-headline', t.headline); }, [t.headline]);
React.useEffect(() => { root.setAttribute('data-hero', t.hero); }, [t.hero]);
React.useEffect(() => {
root.style.setProperty('--accent', t.accent);
// keep shadows/glows roughly in tune by deriving rgba from hex
const hex = t.accent.replace('#', '');
const r = parseInt(hex.substr(0, 2), 16), g = parseInt(hex.substr(2, 2), 16), b = parseInt(hex.substr(4, 2), 16);
document.querySelectorAll('.btn-primary').forEach(el => {
el.style.boxShadow = `0 6px 18px rgba(${r},${g},${b},.28)`;
});
}, [t.accent]);
return (
setTweak('headline', v)}
/>
setTweak('hero', v)}
/>
setTweak('accent', v)}
/>
);
}
ReactDOM.createRoot(document.getElementById('tweaks-root')).render();