/* eslint-disable */ // Шапка, подвал, роутер. Хеш-роутинг. const NAV = [ { href: "#/", label: "Главная" }, { href: "#/services", label: "Услуги" }, { href: "#/products", label: "Продукты" }, { href: "#/approach", label: "Подход" }, { href: "#/team", label: "Команда" }, { href: "#/about", label: "О компании" }, { href: "#/contacts", label: "Контакты" } ]; const useHashRoute = () => { const [hash, setHash] = React.useState(window.location.hash || "#/"); React.useEffect(() => { const onChange = () => { setHash(window.location.hash || "#/"); window.scrollTo({ top: 0, behavior: "instant" }); }; window.addEventListener("hashchange", onChange); return () => window.removeEventListener("hashchange", onChange); }, []); return hash; }; const useTheme = () => { const [theme, setTheme] = React.useState(() => { return localStorage.getItem("wm-theme") || "light"; }); React.useEffect(() => { document.documentElement.setAttribute("data-theme", theme); localStorage.setItem("wm-theme", theme); }, [theme]); return [theme, setTheme]; }; const ThemeToggle = ({ theme, setTheme }) => ( setTheme(theme === "light" ? "dark" : "light")} aria-label={theme === "light" ? "Включить тёмную тему" : "Включить светлую тему"} style={{ fontFamily: "var(--font-mono)", letterSpacing: "0.04em", textTransform: "uppercase" }} > {theme === "light" ? "Тёмная" : "Светлая"} ); const Header = ({ theme, setTheme, currentHash }) => { const [mobileOpen, setMobileOpen] = React.useState(false); // Блокируем скролл фона, когда дровер открыт React.useEffect(() => { if (mobileOpen) { const prev = document.body.style.overflow; document.body.style.overflow = "hidden"; return () => { document.body.style.overflow = prev; }; } }, [mobileOpen]); // Закрываем по Esc React.useEffect(() => { if (!mobileOpen) return; const onKey = (e) => { if (e.key === "Escape") setMobileOpen(false); }; window.addEventListener("keydown", onKey); return () => window.removeEventListener("keydown", onKey); }, [mobileOpen]); return ( ДИКИЙ МАРКС {NAV.map((n) => { const active = currentHash === n.href || (n.href !== "#/" && currentHash.startsWith(n.href)); return ( {n.label} ); })} Обсудить задачу setMobileOpen(true)} aria-label="Открыть меню" aria-expanded={mobileOpen} > {mobileOpen && ReactDOM.createPortal( setMobileOpen(false)} style={{ display: "flex", gap: 10, alignItems: "center", color: "var(--ink)", textDecoration: "none" }}> ДИКИЙ МАРКС setMobileOpen(false)} aria-label="Закрыть меню"> {NAV.map((n) => { const active = currentHash === n.href || (n.href !== "#/" && currentHash.startsWith(n.href)); return ( setMobileOpen(false)} className={"mobile-drawer-item" + (active ? " is-active" : "")} aria-current={active ? "page" : undefined} > {n.label} → ); })} setMobileOpen(false)} className="btn btn-primary" style={{ width: "100%", justifyContent: "center" }}>Обсудить задачу +7 913 600-02-15 ООО «ДИКИЙ МАРКС» · АККРЕДИТАЦИЯ № 75271 , document.body )} ); }; const Footer = () => ( ); // Хлебные крошки const Breadcrumb = ({ items }) => ( {items.map((it, i) => ( {it.href ? {it.label} : {it.label}} {i < items.length - 1 && /} ))} ); // Заголовок страницы const PageHeader = ({ eyebrow, title, lead, actions }) => ( {eyebrow && } {title} {lead && {lead}} {actions && {actions}} ); Object.assign(window, { useHashRoute, useTheme, Header, Footer, Breadcrumb, PageHeader, NAV });
{lead}