INTERACTION_160CSS
Blur Transition
The outgoing page blurs out and the next resolves into focus.
Transitions / MediumView
The quietest option: a short lift and fade between routes. 0 opacity, 8px down before the trigger; fading and lifting the new view into place once a route change.
/* Route Change Fade — The quietest option: a short lift and fade between routes. */
.route-change-fade {
--dur: 320ms;
--ease: cubic-bezier(0.22, 1, 0.36, 1);
--stagger: 60ms;
will-change: transform, opacity;
}
.route-change-fade > * {
opacity: 0;
transform: translateY(14px);
animation: route-change-fade-in var(--dur) var(--ease) forwards;
animation-delay: calc(var(--i, 0) * var(--stagger));
}
/* 0 opacity, 8px down -> fading and lifting the new view into place */
@keyframes route-change-fade-in {
to {
opacity: 1;
transform: none;
filter: none;
}
}
@media (prefers-reduced-motion: reduce) {
.route-change-fade > * {
opacity: 1;
transform: none;
animation: none;
}
}import { useEffect, useRef } from "react";
/** Route Change Fade — trigger: a route change */
export function RouteChangeFade({ 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="route-change-fade" data-state="out">
{children}
</div>
);
}The outgoing page blurs out and the next resolves into focus.
Routes slide horizontally in the direction of travel.
Words cycle in a fixed slot while assets load.
A thin top rule tracks navigation progress.