/* App shell: routing, theme directions, page-transition wipe, Tweaks */ const { useState: uS, useEffect: uE, useRef: uR } = React; const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{ "direction": "noir", "grain": true, "cursor": true, "display": "cormorant" }/*EDITMODE-END*/; const FONTS = { cormorant: '"Cormorant Garamond", Georgia, serif', playfair: '"Playfair Display", Georgia, serif', pt: '"PT Serif", Georgia, serif', }; function App() { const [t, setTweak] = useTweaks(TWEAK_DEFAULTS); const [route, setRoute] = uS(() => (location.hash.replace("#", "") || "home")); const [wipeKey, setWipeKey] = uS(0); const [wiping, setWiping] = uS(false); const contentRef = uR(null); // theme + font vars uE(() => { document.documentElement.dataset.theme = t.direction === "film" ? "film" : "noir"; }, [t.direction]); uE(() => { document.documentElement.style.setProperty("--serif", FONTS[t.display] || FONTS.cormorant); }, [t.display]); uE(() => { document.documentElement.style.setProperty("--grain-show", t.grain ? "1" : "0"); }, [t.grain]); const navigate = (id) => { if (id === route) { window.scrollTo({ top: 0, behavior: "smooth" }); return; } setWipeKey((k) => k + 1); setWiping(true); setTimeout(() => { setRoute(id); location.hash = id; window.scrollTo(0, 0); }, 380); setTimeout(() => setWiping(false), 900); }; window.__navigate = navigate; uE(() => { const onHash = () => { const r = location.hash.replace("#", "") || "home"; setRoute(r); }; window.addEventListener("hashchange", onHash); return () => window.removeEventListener("hashchange", onHash); }, []); const pages = { home: , people: , food: , predmet: , services: , contacts: , }; return ( {t.cursor && } {t.grain &&
}
{window.SITE.banner}{window.SITE.banner}
{wiping &&
}
{pages[route] || pages.home}
setTweak("direction", v)} />

«Кинематограф» — тёмная подача с исходного сайта. «Плёнка» — тёплая светлая editorial-версия.

setTweak("display", v)} /> setTweak("grain", v)} /> setTweak("cursor", v)} />
); } ReactDOM.createRoot(document.getElementById("root")).render();