Home
Work
Pricing
INTERACTION_117CSS
Animated Mobile Menu
The panel slides in and links cascade behind it.
Navigation / LightView
Breadcrumb segments slide in as the path deepens. New segments at 0 opacity, 8px left before the trigger; sliding each new segment into place after its separator once a route change.
/* Animated Breadcrumbs — Breadcrumb segments slide in as the path deepens. */
.animated-breadcrumbs {
--dur: 280ms;
--ease: cubic-bezier(0.22, 1, 0.36, 1);
--stagger: 60ms;
will-change: transform, opacity;
}
.animated-breadcrumbs > * {
opacity: 0;
transform: translateY(14px);
animation: animated-breadcrumbs-in var(--dur) var(--ease) forwards;
animation-delay: calc(var(--i, 0) * var(--stagger));
}
/* new segments at 0 opacity, 8px left -> sliding each new segment into place after its separator */
@keyframes animated-breadcrumbs-in {
to {
opacity: 1;
transform: none;
filter: none;
}
}
@media (prefers-reduced-motion: reduce) {
.animated-breadcrumbs > * {
opacity: 1;
transform: none;
animation: none;
}
}import { useEffect, useRef } from "react";
/** Animated Breadcrumbs — trigger: a route change */
export function AnimatedBreadcrumbs({ 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="animated-breadcrumbs" data-state="out">
{children}
</div>
);
}The panel slides in and links cascade behind it.
Underline grows from the origin side on hover.
A pill indicator glides between nav items.
A rule wipes in under the hovered link and stays on the active route.