const DSA = window.LakshayKumarDesignSystem_3ad00d; const { NavBar } = DSA; const NAV = [ { id: "about", label: "About", href: "#about" }, { id: "services", label: "Services", href: "#services" }, { id: "work", label: "Work", href: "#work" }, { id: "content", label: "Content", href: "#content" }, { id: "skills", label: "Skills", href: "#skills" }, { id: "journey", label: "Journey", href: "#journey" }, { id: "blog", label: "Writing", href: "#blog" } ]; function ScrollProgress() { const [p, setP] = React.useState(0); React.useEffect(() => { const on = () => { const h = document.documentElement.scrollHeight - window.innerHeight; setP(h > 0 ? window.scrollY / h : 0); }; on(); window.addEventListener("scroll", on, { passive: true }); return () => window.removeEventListener("scroll", on); }, []); return
; } function App() { const [active, setActive] = React.useState("about"); React.useEffect(() => { const ids = NAV.map((n) => n.id); const io = new IntersectionObserver((es) => { es.forEach((e) => { if (e.isIntersecting) setActive(e.target.id); }); }, { rootMargin: "-45% 0px -50% 0px" }); ids.forEach((id) => { const el = document.getElementById(id); if (el) io.observe(el); }); return () => io.disconnect(); }, []); const go = (id) => { if (id === "home") { window.scrollTo({ top: 0, behavior: "smooth" }); return; } const el = document.getElementById(id); if (el) window.scrollTo({ top: el.getBoundingClientRect().top + window.scrollY - 62, behavior: "smooth" }); }; return (