LOADINGVAULT
INTERACTION_166CSS
Text Based Loader
Words cycle in a fixed slot while assets load.
Transitions / LightView
A thin top rule tracks navigation progress. Scaled to 0 on the X axis before the trigger; easing to 80% while pending, then to 100% and fading out on completion once a navigation or fetch starting.
/* Progress Bar Loader — A thin top rule tracks navigation progress. */
.progress-bar-loader {
--dur: 240ms;
--ease: cubic-bezier(0.22, 1, 0.36, 1);
--stagger: 60ms;
will-change: transform, opacity;
}
.progress-bar-loader > * {
opacity: 0;
transform: translateY(14px);
animation: progress-bar-loader-in var(--dur) var(--ease) forwards;
animation-delay: calc(var(--i, 0) * var(--stagger));
}
/* scaled to 0 on the X axis -> easing to 80% while pending, then to 100% and fading out on completion */
@keyframes progress-bar-loader-in {
to {
opacity: 1;
transform: none;
filter: none;
}
}
@media (prefers-reduced-motion: reduce) {
.progress-bar-loader > * {
opacity: 1;
transform: none;
animation: none;
}
}import { useEffect, useRef } from "react";
/** Progress Bar Loader — trigger: a navigation or fetch starting */
export function ProgressBarLoader({ 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="progress-bar-loader" data-state="out">
{children}
</div>
);
}Words cycle in a fixed slot while assets load.
The outgoing page blurs out and the next resolves into focus.
Routes slide horizontally in the direction of travel.
The quietest option: a short lift and fade between routes.