/* nav.jsx — sticky scroll-aware navbar */ const { useEffect: useEffectNav, useState: useStateNav } = React; const NAV_BASE = location.pathname.includes('/pages/') ? '../' : ''; const NAV_LINKS = [ { label: 'Services', href: NAV_BASE + 'index.html#services' }, { label: 'Work', href: NAV_BASE + 'index.html#portfolio' }, { label: 'Pricing', href: NAV_BASE + 'index.html#pricing' }, { label: 'Results', href: NAV_BASE + 'index.html#testimonials' }, { label: 'Contact', href: NAV_BASE + 'index.html#contact' }, ]; function navGoContact() { const el = document.querySelector('#contact'); if (el) el.scrollIntoView({ behavior: 'smooth' }); else window.location.href = NAV_BASE + 'index.html#contact'; } function Nav({ lightHero = false }) { const { Button } = window.MacnitechDesignSystem_13fddf; const [solid, setSolid] = useStateNav(false); const [open, setOpen] = useStateNav(false); useEffectNav(() => { const onScroll = () => setSolid(window.scrollY > 60); onScroll(); window.addEventListener('scroll', onScroll, { passive: true }); return () => window.removeEventListener('scroll', onScroll); }, []); useEffectNav(() => { document.body.style.overflow = open ? 'hidden' : ''; }, [open]); const darkChrome = solid || lightHero; // dark logo + dark links return (
Macnitech
Macnitech
{NAV_LINKS.map((l) => ( setOpen(false)}>{l.label} ))}
); } Object.assign(window, { Nav, NAV_BASE, navGoContact });