/* Orlina tweaks panel — exposes color/typography/layout knobs */ const ORLINA_TWEAK_DEFAULTS = window.__ORLINA_TWEAKS; const OrlinaTweaks = () => { const [t, setTweak] = useTweaks(ORLINA_TWEAK_DEFAULTS); // apply tweaks to CSS variables React.useEffect(() => { const r = document.documentElement; if (t.primaryColor) { r.style.setProperty('--orange-500', t.primaryColor); const shift = (hex, amt) => { const n = parseInt(hex.slice(1), 16); let R = (n >> 16) + amt, G = ((n >> 8) & 0xff) + amt, B = (n & 0xff) + amt; R = Math.max(0, Math.min(255, R)); G = Math.max(0, Math.min(255, G)); B = Math.max(0, Math.min(255, B)); return '#' + ((R << 16) | (G << 8) | B).toString(16).padStart(6, '0'); }; r.style.setProperty('--orange-400', shift(t.primaryColor, 30)); r.style.setProperty('--orange-600', shift(t.primaryColor, -20)); r.style.setProperty('--orange-700', shift(t.primaryColor, -40)); } if (t.background) r.style.setProperty('--cream-50', t.background); if (t.displayFont) r.style.setProperty('--font-display', `'${t.displayFont}', serif`); if (t.bodyFont) r.style.setProperty('--font-body', `'${t.bodyFont}', system-ui, sans-serif`); }, [t.primaryColor, t.background, t.displayFont, t.bodyFont]); React.useEffect(() => { const sb = document.querySelector('.sticky-buy'); if (sb) sb.style.display = t.showStickyBuy ? '' : 'none'; }, [t.showStickyBuy]); React.useEffect(() => { document.querySelectorAll('.berry-cluster').forEach(el => { el.style.display = t.showBerries ? '' : 'none'; }); }, [t.showBerries]); return ( setTweak('primaryColor', v)} /> setTweak('background', v)} /> setTweak('displayFont', v)} /> setTweak('bodyFont', v)} /> setTweak('showStickyBuy', v)} /> setTweak('showBerries', v)} /> ); }; window.OrlinaTweaks = OrlinaTweaks; // Inject Google Fonts for the alternative typeface options (function () { const link = document.createElement('link'); link.rel = 'stylesheet'; link.href = 'https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=DM+Serif+Display&family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Libre+Caslon+Text:wght@400;700&family=DM+Sans:wght@400;500;600;700&family=Work+Sans:wght@400;500;600;700&family=Nunito+Sans:wght@400;600;700&family=Karla:wght@400;500;600;700&display=swap'; document.head.appendChild(link); })();