// NavV2 — top nav with hamburger on mobile. SideRail hidden below 1024px. function NavV2() { const { lang, setLang } = React.useContext(window.LangContext); const { isMobile, isTablet } = window.useBreakpoint(); const [scrolled, setScrolled] = React.useState(false); const [menuOpen, setMenuOpen] = React.useState(false); React.useEffect(() => { const onScroll = () => setScrolled(window.scrollY > 12); window.addEventListener("scroll", onScroll, { passive: true }); onScroll(); return () => window.removeEventListener("scroll", onScroll); }, []); // Close overlay when switching to desktop React.useEffect(() => { if (!isMobile && !isTablet) setMenuOpen(false); }, [isMobile]); // Lock body scroll when menu is open React.useEffect(() => { document.body.style.overflow = menuOpen ? "hidden" : ""; return () => { document.body.style.overflow = ""; }; }, [menuOpen]); const links = lang === 'de' ? [ { id: "philosophy", label: "Philosophie" }, { id: "capabilities", label: "Leistungen" }, { id: "thinking", label: "Notizen" }, ] : [ { id: "philosophy", label: "Philosophy" }, { id: "capabilities", label: "Services" }, { id: "thinking", label: "Notes" }, ]; const contactLabel = lang === 'de' ? 'Kontakt' : 'Connect'; const labelStyle = { fontFamily: "Montserrat", fontWeight: 400, fontSize: 11, letterSpacing: "0.22em", textTransform: "uppercase", color: "#a8a8b8", textDecoration: "none", }; return ( ); } // SideRail — hidden below 1024px. Labels only shown at ≥ 1440px. function SideRail() { const { lang } = React.useContext(window.LangContext); const { isMobile, isTablet } = window.useBreakpoint(); const [vw, setVw] = React.useState(window.innerWidth); React.useEffect(() => { const h = () => setVw(window.innerWidth); window.addEventListener('resize', h, { passive: true }); return () => window.removeEventListener('resize', h); }, []); const showLabels = vw >= 1440; const sections = lang === 'de' ? [ { id: "top", n: "00", label: "Start" }, { id: "philosophy", n: "01", label: "Philosophie" }, { id: "iceberg", n: "02", label: "Tiefe" }, { id: "method", n: "03", label: "Methode" }, { id: "capabilities", n: "04", label: "Leistungen" }, { id: "notfor", n: "05", label: "Einsatzfelder" }, { id: "addons", n: "06", label: "Bausteine" }, { id: "position", n: "07", label: "Positionierung" }, { id: "thinking", n: "08", label: "Notizen" }, { id: "connect", n: "09", label: "Kontakt" }, ] : [ { id: "top", n: "00", label: "Start" }, { id: "philosophy", n: "01", label: "Philosophy" }, { id: "iceberg", n: "02", label: "Depth" }, { id: "method", n: "03", label: "Method" }, { id: "capabilities", n: "04", label: "Services" }, { id: "notfor", n: "05", label: "Focus Areas" }, { id: "addons", n: "06", label: "Add-ons" }, { id: "position", n: "07", label: "Position" }, { id: "thinking", n: "08", label: "Notes" }, { id: "connect", n: "09", label: "Connect" }, ]; const [active, setActive] = React.useState("top"); const [hoveredId, setHoveredId] = React.useState(null); React.useEffect(() => { const onScroll = () => { let current = "top"; for (const s of sections) { const el = document.getElementById(s.id); if (!el) continue; if (el.getBoundingClientRect().top < 200) current = s.id; } setActive(current); }; window.addEventListener("scroll", onScroll, { passive: true }); onScroll(); return () => window.removeEventListener("scroll", onScroll); }, [lang]); if (isMobile) return (
{sections.map(s => { const isActive = active === s.id; return ( ); })}
); if (isTablet) return null; return ( ); } window.NavV2 = NavV2; window.SideRail = SideRail;