// Main app function App() { const [bookingOpen, setBookingOpen] = useState(false); const [scrolled, setScrolled] = useState(false); const [overHero, setOverHero] = useState(true); const [section, setSection] = useState(""); const defaults = /*EDITMODE-BEGIN*/{ "palette": "default", "roomStyle": "classic", "heroLayout": "full" }/*EDITMODE-END*/; const [t, setTweak] = useTweaks(defaults); useEffect(() => { document.documentElement.setAttribute("data-palette", t.palette); document.body.setAttribute("data-roomstyle", t.roomStyle); }, [t.palette, t.roomStyle]); useEffect(() => { const onScroll = () => { setScrolled(window.scrollY > 30); setOverHero(window.scrollY < (window.innerHeight - 100)); // detect current section const ids = ["stays", "amenities", "dine", "events", "gallery", "area", "contact"]; for (const id of ids) { const el = document.getElementById(id); if (el) { const r = el.getBoundingClientRect(); if (r.top < 200 && r.bottom > 200) { setSection(id); return; } } } setSection(""); }; window.addEventListener("scroll", onScroll); onScroll(); return () => window.removeEventListener("scroll", onScroll); }, []); const openBooking = () => { setBookingOpen(true); document.body.style.overflow = "hidden"; }; const closeBooking = () => { setBookingOpen(false); document.body.style.overflow = ""; }; return (