// Petzone — main app shell const { useState: useStateA, useEffect: useEffectA, useMemo: useMemoA } = React; const PALETTES = { teal: { "--teal": "#2BB9C0", "--teal-deep": "#146A6F", "--teal-soft": "#E8F7F8", "--coral": "#F08A5D", "--ink": "#14272C", "--slate": "#5F7178", "--cream": "#FAF6F0", }, sage: { "--teal": "#5BA17F", "--teal-deep": "#2E5E45", "--teal-soft": "#EAF3EC", "--coral": "#D97757", "--ink": "#1E2A24", "--slate": "#5B6A63", "--cream": "#F6F2EB", }, ocean: { "--teal": "#3A7BD5", "--teal-deep": "#1C4E8C", "--teal-soft": "#E8F0FA", "--coral": "#F7A35C", "--ink": "#16242B", "--slate": "#5C6B72", "--cream": "#F7F5EF", }, warm: { "--teal": "#C97B5C", "--teal-deep": "#7C3D24", "--teal-soft": "#FBEFE7", "--coral": "#2BB9C0", "--ink": "#2A1D17", "--slate": "#6E5C53", "--cream": "#FAF4EC", }, }; const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{ "palette": "teal", "density": "comfortable", "heroVariant": "care", "rtl": false, "showBookSheetDemo": false }/*EDITMODE-END*/; const App = () => { // ---- routing (custom hash) ---- const [page, setPage] = useStateA(() => (window.location.hash.replace("#","") || "home")); useEffectA(() => { const onHash = () => setPage(window.location.hash.replace("#","") || "home"); window.addEventListener("hashchange", onHash); return () => window.removeEventListener("hashchange", onHash); }, []); const go = (p) => { window.location.hash = p; window.scrollTo({ top: 0, behavior: "instant" }); }; // ---- booking sheet ---- const [book, setBook] = useStateA({ open: false, service: null }); const openBook = (service) => setBook({ open: true, service: typeof service === "string" ? service : null }); const closeBook = () => setBook({ open: false, service: null }); // ---- tweaks ---- const [tweaks, setTweaks] = window.useTweaks(TWEAK_DEFAULTS); // apply palette useEffectA(() => { const p = PALETTES[tweaks.palette] || PALETTES.teal; Object.entries(p).forEach(([k, v]) => document.documentElement.style.setProperty(k, v)); document.documentElement.dir = tweaks.rtl ? "rtl" : "ltr"; }, [tweaks.palette, tweaks.rtl]); // demo: auto-open book sheet useEffectA(() => { if (tweaks.showBookSheetDemo) setBook({ open: true, service: null }); }, [tweaks.showBookSheetDemo]); // density useEffectA(() => { document.documentElement.style.setProperty("--density-scale", tweaks.density === "compact" ? "0.92" : tweaks.density === "spacious" ? "1.08" : "1"); }, [tweaks.density]); const renderPage = () => { if (page.startsWith("service/")) return ; if (page.startsWith("vet/")) return ; if (page === "services") return ; if (page === "vets") return ; if (page === "about") return ; if (page === "contact") return ; return ; }; const { TweaksPanel, TweakSection, TweakRadio, TweakToggle, TweakSelect } = window; return (
); }; ReactDOM.createRoot(document.getElementById("root")).render();