Liquid Glass nav
One shared spotlight pill glides under whatever you hover or focus, then settles back on the selected item — a single animated element, not a fade per link.
- GSAP
- Shared element
- Keyboard
Build breakdown
- The pill is one absolutely-positioned span; on hover/focus I measure the target button's offsetLeft + width and tween x/width with power3.out (~280ms — under the 300ms perceived-instant ceiling).
- Only transform and width animate — no layout per frame — so it holds 60fps.
- Focus drives the exact same motion as hover, and Enter/Space selects; the pill re-aligns on resize.
- Reduced motion → the pill jumps instantly instead of tweening.