// Nav.jsx — thomasgoodman.me const Nav = ({ theme, onToggleTheme, activeSection }) => { const [scrolled, setScrolled] = React.useState(false); const [mobileOpen, setMobileOpen] = React.useState(false); React.useEffect(() => { const onScroll = () => setScrolled(window.scrollY > 10); window.addEventListener("scroll", onScroll); return () => window.removeEventListener("scroll", onScroll); }, []); const links = [ { label: "About", href: "#about" }, { label: "Experience", href: "#experience" }, { label: "Projects", href: "#projects" }, { label: "Stack", href: "#stack" }, { label: "Contact", href: "#contact" }, ]; const navStyle = { position: "fixed", top: 0, left: 0, right: 0, height: 64, zIndex: 100, display: "flex", alignItems: "center", justifyContent: "space-between", padding: "0 clamp(20px, 5vw, 48px)", background: scrolled ? "var(--color-bg-surface)" : "transparent", borderBottom: scrolled ? "1px solid var(--color-border-default)" : "1px solid transparent", boxShadow: scrolled ? "0 8px 24px rgba(0,0,0,0.35)" : "none", backdropFilter: scrolled ? "blur(8px)" : "none", transition: "all 250ms ease", }; return ( <> {/* Mobile drawer */} {mobileOpen && (
)} > ); }; Object.assign(window, { Nav });