/* global React, ReactDOM, TweaksPanel, TweakSection, TweakColor, TweakSlider, TweakToggle, TweakRadio, useTweaks */
const { useEffect } = React;
function applyTweaks(t) {
const r = document.documentElement;
r.style.setProperty('--c-gold', t.accent);
r.style.setProperty('--c-cream', t.background);
r.style.setProperty('--c-dark', t.ink);
// Heading scale
document.querySelectorAll('.h1').forEach(el => {
el.style.fontSize = `clamp(${40 * t.headingScale}px, ${6 * t.headingScale}vw, ${84 * t.headingScale}px)`;
});
document.querySelectorAll('.h-section').forEach(el => {
el.style.fontSize = `clamp(${36 * t.headingScale}px, ${4.5 * t.headingScale}vw, ${64 * t.headingScale}px)`;
});
// Quote
const q = document.querySelector('.quote');
if (q) q.style.display = t.showQuote ? '' : 'none';
// Dots
const d = document.querySelector('.dots');
if (d) d.style.display = t.showDots ? '' : 'none';
// Round buttons
document.querySelectorAll('.btn').forEach(el => {
el.style.borderRadius = t.roundButtons ? '999px' : '10px';
});
// Photo bg shape
const bg = document.querySelector('.about__photo-bg');
if (bg) {
if (t.photoBgShape === 'rounded') bg.style.borderRadius = '50% 50% 0 0 / 60% 60% 0 0';
else if (t.photoBgShape === 'square') bg.style.borderRadius = '12px 12px 0 0';
else if (t.photoBgShape === 'circle') bg.style.borderRadius = '50%';
}
}
function App() {
const [tweaks, setTweak] = useTweaks(window.TWEAK_DEFAULTS);
useEffect(() => { applyTweaks(tweaks); }, [tweaks]);
return (
setTweak('accent', v)} />
setTweak('background', v)} />
setTweak('ink', v)} />
setTweak('headingScale', v)} />
setTweak('photoBgShape', v)} />
setTweak('roundButtons', v)} />
setTweak('showQuote', v)} />
setTweak('showDots', v)} />
);
}
const root = document.createElement('div');
root.id = 'tweaks-root';
document.body.appendChild(root);
ReactDOM.createRoot(root).render();