DISCOVEREFFECTSPROMPTS
INTERACTION_027CSS
Navigation Underline
Underline grows from the origin side on hover.
Navigation / LightView
Clicking a nav link plays an exit before the next route paints. The overlay off-screen before the trigger; wiping the overlay across, swapping the route, then wiping it away once a nav link click.
/* Page Transition Navigation — Clicking a nav link plays an exit before the next route paints. */
.page-transition-navigation {
--dur: 620ms;
--ease: cubic-bezier(0.22, 1, 0.36, 1);
--stagger: 60ms;
will-change: transform, opacity;
}
.page-transition-navigation > * {
opacity: 0;
transform: translateY(14px);
animation: page-transition-navigation-in var(--dur) var(--ease) forwards;
animation-delay: calc(var(--i, 0) * var(--stagger));
}
/* the overlay off-screen -> wiping the overlay across, swapping the route, then wiping it away */
@keyframes page-transition-navigation-in {
to {
opacity: 1;
transform: none;
filter: none;
}
}
@media (prefers-reduced-motion: reduce) {
.page-transition-navigation > * {
opacity: 1;
transform: none;
animation: none;
}
}import { useEffect, useRef } from "react";
/** Page Transition Navigation — trigger: a nav link click */
export function PageTransitionNavigation({ children }: { children: React.ReactNode }) {
const ref = useRef<HTMLDivElement>(null);
useEffect(() => {
const el = ref.current;
if (!el) return;
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
el.dataset["state"] = "in";
return;
}
const io = new IntersectionObserver(
([entry]) => {
if (entry?.isIntersecting) {
el.dataset["state"] = "in";
io.unobserve(el);
}
},
{ threshold: 0.2 },
);
io.observe(el);
return () => io.disconnect();
}, []);
return (
<div ref={ref} className="page-transition-navigation" data-state="out">
{children}
</div>
);
}Underline grows from the origin side on hover.
The panel slides in and links cascade behind it.
A full-screen overlay wipes down and oversized links rise in.
A pill indicator glides between nav items.