/* Tweaks layer · Anthony & Mellie landing Vanilla page is the production deliverable; this only attaches when host activates edit mode. */ const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{ "heroLayout": "stacked", "manifestoStyle": "centered", "portfolioDensity": "4col", "priceWeight": "regular", "showTicker": true, "showStikyMention": true, "remainingSlots": 7, "heroTitleSize": 100 }/*EDITMODE-END*/; const { useEffect } = React; function App() { const [t, setTweak] = useTweaks(TWEAK_DEFAULTS); // ── Apply tweaks to DOM ────────────────────────────────────────── useEffect(() => { // Ticker visibility const ticker = document.querySelector('.ticker'); if (ticker) ticker.style.display = t.showTicker ? '' : 'none'; // Hero title size const ht = document.querySelector('.hero-title'); if (ht) ht.style.fontSize = `clamp(46px, 9.5vw, ${t.heroTitleSize}px)`; // Hero layout: stacked vs split (image right of title) const hero = document.querySelector('.hero'); if (hero) hero.dataset.layout = t.heroLayout; // Manifesto style const manifeste = document.querySelector('.manifeste'); if (manifeste) manifeste.dataset.style = t.manifestoStyle; // Portfolio density const pg = document.querySelector('.portfolio-grid'); if (pg) { pg.style.gridTemplateColumns = t.portfolioDensity === '3col' ? 'repeat(3, 1fr)' : t.portfolioDensity === '5col' ? 'repeat(5, 1fr)' : 'repeat(4, 1fr)'; } // Price weight const price = document.querySelector('.price'); if (price) price.style.fontWeight = t.priceWeight === 'bold' ? '600' : '400'; // Stiky mention const stiky = document.querySelector('.duo-stiky'); if (stiky) stiky.style.display = t.showStikyMention ? '' : 'none'; // Remaining slots — sync ticker + booking badge const slotsTicker = document.getElementById('slots-count'); if (slotsTicker) slotsTicker.textContent = `${t.remainingSlots} / 10 créneaux disponibles`; const badge = document.querySelector('.booking-badge span:last-child'); if (badge) badge.textContent = `${t.remainingSlots} créneaux restants sur 10`; }, [t]); return ( setTweak('showTicker', v)} /> setTweak('remainingSlots', v)} /> setTweak('heroTitleSize', v)} /> setTweak('manifestoStyle', v)} /> setTweak('portfolioDensity', v)} /> setTweak('priceWeight', v)} /> setTweak('showStikyMention', v)} /> ); } ReactDOM.createRoot(document.getElementById('tweaks-root')).render();