Navigationcomponents/Navbar.tsx
Clear visual aids
One quiet underline tells you where you are. No badges, no guesswork, nothing competing with the content.
Click a label
ann.
Underline morphs between active labels via framer-motion layoutId
components/Navbar.tsx
@@ wordmark @@- Ann+ ann. @@ scrollspy for home anchors @@+ useEffect(() => {+ if (pathname !== "/") { setActiveSection(null); return }+ const node = document.getElementById("projects")+ const observer = new IntersectionObserver(+ (entries) => {+ const visible = entries.find((e) => e.isIntersecting)+ setActiveSection(visible ? "projects" : null)+ },+ { rootMargin: "-30% 0px -55% 0px",+ threshold: [0, 0.25, 0.5, 0.75, 1] },+ )+ observer.observe(node)+ return () => observer.disconnect()+ }, [pathname]) @@ active link styling @@- <a href={href} className="hover:text-zinc-900 ...">+ <a href={href}+ aria-current={active ? "page" : undefined}+ className={`hover:text-zinc-900 ... ${active+ ? "underline underline-offset-[6px] decoration-[1.5px] decoration-current"+ : ""}`}> {label} </a>