/* House of Windsor — App shell */ const { useState: useStateA, useEffect: useEffectA, useRef: useRefA } = React; const HOWJ_TWEAKS = /*EDITMODE-BEGIN*/{ "palette": "Royal Blue + Champagne", "displayFont": "Cormorant Garamond", "showBrowserChrome": true, "density": "Generous" }/*EDITMODE-END*/; const PALETTES = { 'Royal Blue + Champagne': { '--royal-blue': '#1B2A4A', '--midnight': '#0E1626', '--champagne-gold': '#C9A86A', '--gold-deep': '#A8843E', '--gold-soft': '#E4D2A8', '--ivory': '#F7F4EF', '--cream-card': '#FBF9F5', }, 'Signature Teal': { '--royal-blue': '#1E7A86', '--midnight': '#0F3A41', '--champagne-gold': '#D4B470', '--gold-deep': '#A8843E', '--gold-soft': '#E4D2A8', '--ivory': '#F5F3EE', '--cream-card': '#FAF8F2', }, 'Charcoal + Bronze': { '--royal-blue': '#2A2A2D', '--midnight': '#161617', '--champagne-gold': '#B98D5E', '--gold-deep': '#8E6936', '--gold-soft': '#D9B98C', '--ivory': '#F4F1EA', '--cream-card': '#F9F6EE', }, }; const DISPLAY_FONTS = { 'Cormorant Garamond': "'Cormorant Garamond', 'Times New Roman', serif", 'Marcellus': "'Marcellus', 'Cormorant Garamond', serif", 'Tenor (system fallback)': "'Tenor Sans', 'Cormorant Garamond', serif", }; function App() { const initialRoute = window.__BYTESGLUE_SHOWCASE_ROUTE || 'home'; const [route, setRoute] = useStateA(initialRoute); const [scrolled, setScrolled] = useStateA(false); const [bookOpen, setBookOpen] = useStateA(false); const [bookCollection, setBookCollection] = useStateA(null); const siteRef = useRefA(null); const [t, setTweak] = useTweaks(HOWJ_TWEAKS); // Apply tweaks to CSS vars useEffectA(() => { const palette = PALETTES[t.palette] || PALETTES['Royal Blue + Champagne']; Object.entries(palette).forEach(([k, v]) => document.documentElement.style.setProperty(k, v)); document.documentElement.style.setProperty('--font-serif', DISPLAY_FONTS[t.displayFont] || DISPLAY_FONTS['Cormorant Garamond']); }, [t.palette, t.displayFont]); // Scroll listener for sticky-nav style change useEffectA(() => { const el = siteRef.current; if (!el) return; const onScroll = () => setScrolled(el.scrollTop > 24); el.addEventListener('scroll', onScroll, { passive: true }); return () => el.removeEventListener('scroll', onScroll); }, []); // Reset scroll on route change useEffectA(() => { if (siteRef.current) siteRef.current.scrollTo({ top: 0, behavior: 'instant' }); }, [route]); // Lock body scroll while modal open useEffectA(() => { document.body.classList.toggle('locked', bookOpen); }, [bookOpen]); const onBook = (collection) => { setBookCollection(typeof collection === 'string' ? collection : null); setBookOpen(true); }; const goRoute = (r) => setRoute(r); // Routing: collection: const collMatch = route.startsWith('collection:') && route.slice(11); const screen = (() => { if (collMatch) return ; switch (route) { case 'collections': return ; case 'bespoke': return ; case 'diamonds': return ; case 'about': return ; case 'testimonials': return ; case 'visit': return ; case 'home': default: return ; } })(); const navRoute = collMatch ? 'collections' : route; const siteContent = (
); return ( <> {t.showBrowserChrome ? (
🔒houseofwindsorjewellers.com{routePath(route)}
{siteContent}
) : siteContent} setBookOpen(false)} defaultCollection={bookCollection} /> setTweak('palette', v)} /> setTweak('displayFont', v)} /> setTweak('showBrowserChrome', v)} /> {HOWJ.navItems.map(n => ( goRoute(n.id)} /> ))} onBook()} /> ); } function routePath(r) { if (r === 'home') return '/'; if (r.startsWith('collection:')) return `/collections/${r.slice(11)}`; return `/${r}`; } ReactDOM.createRoot(document.getElementById('root')).render();