// ============================================ // APP — Direction A // Routing + Tweaks panel // ============================================ const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{ "primaryColor": "#B5532A", "inkColor": "#1F1611", "bgColor": "#F5EFE6", "displayFont": "Fraunces", "bodyFont": "DM Sans", "brandName": "Atlas Construction", "brandTagline": "" }/*EDITMODE-END*/; const App = () => { const [page, setPage] = React.useState(() => { const h = window.location.hash.replace("#", ""); return ["home", "kitchen", "bath", "basement", "about", "contact"].includes(h) ? h : "home"; }); const [tweaks, setTweak] = useTweaks(TWEAK_DEFAULTS); React.useEffect(() => { window.location.hash = page; window.scrollTo({ top: 0, behavior: "instant" }); }, [page]); React.useEffect(() => { const onHash = () => { const h = window.location.hash.replace("#", ""); if (["home", "kitchen", "bath", "basement", "about", "contact"].includes(h)) { setPage(h); } }; window.addEventListener("hashchange", onHash); return () => window.removeEventListener("hashchange", onHash); }, []); // Apply tweaks live as CSS vars React.useEffect(() => { const root = document.documentElement; root.style.setProperty("--clay", tweaks.primaryColor); root.style.setProperty("--ink", tweaks.inkColor); root.style.setProperty("--bg-deep", tweaks.inkColor); root.style.setProperty("--bg", tweaks.bgColor); root.style.setProperty("--font-display", `"${tweaks.displayFont}", Georgia, serif`); root.style.setProperty("--font-body", `"${tweaks.bodyFont}", system-ui, sans-serif`); }, [tweaks]); let body; if (page === "home") body = ; else if (page === "kitchen") body = ; else if (page === "bath") body = ; else if (page === "basement") body = ; else if (page === "about") body = ; else if (page === "contact") body = ; return ( <>