/* global React, ReactDOM */ // ============================================================ // Tweaks // ============================================================ const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{ "palette": "warm", "heroStyle": "soft", "showAnnouncement": true }/*EDITMODE-END*/; const PALETTES = { warm: { "--ivory": "#F8F4EC", "--ivory-deep": "#F1EBDD", "--cream-card": "#FCFAF4", "--gold": "#C9A24B", "--gold-deep": "#A8853A", "--gold-soft": "#E4CE9A", "--espresso": "#3B2C24", "--espresso-soft":"#5A463A", "--charcoal": "#211C19", "--blush": "#E7C9C2", }, cool: { "--ivory": "#F4F6F1", "--ivory-deep": "#E8ECE4", "--cream-card": "#FAFBF7", "--gold": "#B79B5C", "--gold-deep": "#8E7434", "--gold-soft": "#D7C28B", "--espresso": "#2D3530", "--espresso-soft":"#4E5651", "--charcoal": "#1A1F1C", "--blush": "#C7D2C1", }, midnight: { "--ivory": "#0F0E10", "--ivory-deep": "#1A171A", "--cream-card": "#1A171A", "--gold": "#D4A85A", "--gold-deep": "#E4C684", "--gold-soft": "#A8853A", "--espresso": "#F4EDDF", "--espresso-soft":"rgba(244,237,223,0.65)", "--charcoal": "#F8F4EC", "--blush": "#C99A8E", "--line": "rgba(244,237,223,0.10)", "--line-strong": "rgba(244,237,223,0.22)", "--white": "#1A171A", }, blush: { "--ivory": "#FBF4F2", "--ivory-deep": "#F4E6E2", "--cream-card": "#FEF8F6", "--gold": "#C9A24B", "--gold-deep": "#A8853A", "--gold-soft": "#E4CE9A", "--espresso": "#4A2F2A", "--espresso-soft":"#6D4A43", "--charcoal": "#2A1A17", "--blush": "#E7C9C2", }, }; const PALETTE_LIST = [ { name: "warm", label: "Warm ivory", swatches: ["#F8F4EC", "#C9A24B", "#3B2C24"] }, { name: "cool", label: "Cool sage", swatches: ["#F4F6F1", "#B79B5C", "#2D3530"] }, { name: "midnight", label: "Midnight", swatches: ["#0F0E10", "#D4A85A", "#F4EDDF"] }, { name: "blush", label: "Blush rose", swatches: ["#FBF4F2", "#C9A24B", "#4A2F2A"] }, ]; const TweaksUI = () => { const [t, setTweak] = useTweaks(TWEAK_DEFAULTS); // Apply palette to :root React.useEffect(() => { const root = document.documentElement; const palette = PALETTES[t.palette] || PALETTES.warm; ["--line", "--line-strong", "--white"].forEach(k => root.style.removeProperty(k)); Object.entries(palette).forEach(([k, v]) => root.style.setProperty(k, v)); }, [t.palette]); React.useEffect(() => { document.documentElement.dataset.heroStyle = t.heroStyle; document.documentElement.dataset.announcement = t.showAnnouncement ? "on" : "off"; }, [t.heroStyle, t.showAnnouncement]); return (
{PALETTE_LIST.map(p => { const on = t.palette === p.name; return ( ); })}
setTweak("heroStyle", v)} /> setTweak("showAnnouncement", v)} />
Try the 4-step booking flow at #/book — real form with validation and confetti on submit.
); }; // ============================================================ // Router root // ============================================================ const App = () => { const route = useHashRoute(); const path = route.path; const sub = route.sub; let page; if (path === "home" || path === "") page = ; else if (path === "treatments" && !sub) page = ; else if (path === "treatments" && sub) page = ; else if (path === "about") page = ; else if (path === "reviews") page = ; else if (path === "pricing") page = ; else if (path === "contact") page = ; else if (path === "book") { // ?treatment=slug const search = window.location.hash.split("?")[1] || ""; const params = new URLSearchParams(search); page = ; } else page = ; return ( <>
{page}