// Shared nav for AdOpsify marketing pages. // "current" can be: Services, Apps, About, Contact const Nav = ({ dark = false, current = "" }) => { // Use 1024px breakpoint so both mobile and tablet use the hamburger nav const COMPACT_NAV_BP = 1024; const [scrolled, setScrolled] = React.useState(false); const [servicesOpen, setServicesOpen] = React.useState(false); const [mobileOpen, setMobileOpen] = React.useState(false); const [mobile, setMobile] = React.useState(window.innerWidth < COMPACT_NAV_BP); const closeT = React.useRef(null); React.useEffect(() => { const h = () => setScrolled(window.scrollY > 20); window.addEventListener("scroll", h, { passive: true }); h(); return () => window.removeEventListener("scroll", h); }, []); React.useEffect(() => { const onResize = () => { const isMobile = window.innerWidth < COMPACT_NAV_BP; setMobile(isMobile); if (!isMobile) setMobileOpen(false); }; window.addEventListener("resize", onResize, { passive: true }); onResize(); return () => window.removeEventListener("resize", onResize); }, []); const bg = scrolled ? (dark ? "rgba(14,18,14,0.78)" : "rgba(250,248,244,0.78)") : "transparent"; const border = scrolled ? "1px solid var(--border)" : "1px solid transparent"; const fg = dark ? "var(--paper)" : "var(--ink-900)"; const linkStyle = (isCurrent) => ({ color: fg, fontSize: 14, fontWeight: isCurrent ? 600 : 500, opacity: isCurrent ? 1 : 0.72, textDecoration: "none", transition: "opacity 180ms", display: "inline-flex", alignItems: "center", gap: 4, cursor: "pointer", }); const links = [ ["Apps", "apps.html"], ["About", "about.html"], ["Contact", "contact.html"], ]; const services = [ ["Programmatic Advertising", "programmatic.html", "Audience-first DSP buys across web, mobile, CTV."], ["CTV Advertising", "ctv.html", "Premium streaming inventory with creative QA built in."], ["Mobile Development", "mobile-development.html", "Native iOS, Android, cross-platform — shipped."], ["Cloud Computing", "cloud-computing.html", "AWS / GCP architecture, DevOps, and managed runtime."], ]; const openServices = () => { clearTimeout(closeT.current); setServicesOpen(true); }; const closeServices = () => { closeT.current = setTimeout(() => setServicesOpen(false), 140); }; return ( <> {mobile && mobileOpen && (