// Uvie tweaks panel — brand & visual knobs.
// Loaded as a Babel script. Uses TweaksPanel from the starter.
const { useEffect } = React;
function UvieTweaks() {
const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{
"accent": "emerald",
"background": "midnight",
"headline": "molecular",
"showBg": true,
"serifWeight": 300,
"density": "spacious",
"monoChips": true
}/*EDITMODE-END*/;
const [t, setTweak] = useTweaks(TWEAK_DEFAULTS);
useEffect(() => {
const root = document.documentElement;
// accent palettes
const accents = {
emerald: { primary: '#1FB87A', alt: '#0F8A8A' },
copper: { primary: '#C97B4F', alt: '#8A4A2C' },
cobalt: { primary: '#5BA0E0', alt: '#2A6FDB' },
gold: { primary: '#D4A85F', alt: '#8E6E2E' },
ivory: { primary: '#F5F1E8', alt: '#A8A398' }
};
const a = accents[t.accent] || accents.emerald;
root.style.setProperty('--emerald', a.primary);
root.style.setProperty('--teal-deep', a.alt);
root.style.setProperty('--accent-1', a.primary);
// background mood
const bgs = {
midnight: { ink: '#04101E', mid: '#0A1A2E', navy: '#0F2438' },
slate: { ink: '#0F1419', mid: '#1A2129', navy: '#242C36' },
cream: { ink: '#F5F1E8', mid: '#FAF6ED', navy: '#EDE7D8' },
bone: { ink: '#1F1B17', mid: '#2A2620', navy: '#34302A' }
};
const b = bgs[t.background] || bgs.midnight;
root.style.setProperty('--ink', b.ink);
root.style.setProperty('--midnight', b.mid);
root.style.setProperty('--navy-2', b.navy);
// flip ivory/text on light backgrounds
if (t.background === 'cream') {
root.style.setProperty('--ivory', '#1A1A1A');
root.style.setProperty('--bone', '#3A3A3A');
root.style.setProperty('--mist', '#7A7A7A');
root.style.setProperty('--steel', '#B8B8B8');
root.style.setProperty('--hairline', 'rgba(0,0,0,0.08)');
root.style.setProperty('--hairline-strong', 'rgba(0,0,0,0.15)');
} else if (t.background === 'bone') {
root.style.setProperty('--ivory', '#F5F1E8');
root.style.setProperty('--bone', '#D8CFC0');
root.style.setProperty('--mist', '#9A8F80');
root.style.setProperty('--steel', '#6E6358');
} else {
root.style.setProperty('--ivory', '#F5F1E8');
root.style.setProperty('--bone', '#D8D2C5');
root.style.setProperty('--mist', '#6B7E96');
root.style.setProperty('--steel', '#4A5C73');
}
// serif weight
document.querySelectorAll('.display, .h1, .h2, .h3, .pdp-title, .panel-title, [class*="display"]').forEach(el => {
el.style.fontWeight = t.serifWeight;
});
// density
root.style.setProperty('--section-pad', t.density === 'tight' ? '80px' : t.density === 'lush' ? '180px' : '120px');
// hero molecule visibility
document.querySelectorAll('.hero-molecule, .content-hero-bg').forEach(el => {
el.style.display = t.showBg ? '' : 'none';
});
// mono chips style toggle
document.querySelectorAll('.eyebrow').forEach(el => {
el.style.fontFamily = t.monoChips ? '' : 'var(--serif)';
el.style.textTransform = t.monoChips ? '' : 'none';
el.style.letterSpacing = t.monoChips ? '' : '0';
el.style.fontStyle = t.monoChips ? '' : 'italic';
el.style.fontSize = t.monoChips ? '' : '15px';
});
}, [t]);
return (
v === 300 ? 'Light' : v === 400 ? 'Regular' : 'Medium'}
/>
);
}
const tweakRoot = document.createElement('div');
tweakRoot.id = 'uvie-tweaks-root';
document.body.appendChild(tweakRoot);
ReactDOM.createRoot(tweakRoot).render();