VAULT
INTERACTION_047CSS
Letter By Letter Fade
Characters fade in one by one to draw the eye across the word.
Letters / LightView
Characters sharpen from a heavy blur into crisp type. Blurred 12px at 0 opacity before the trigger; easing blur to 0 and opacity to 1 once entry into view.
/* Letter Blur — Characters sharpen from a heavy blur into crisp type. */
.letter-blur {
--dur: 760ms;
--ease: cubic-bezier(0.22, 1, 0.36, 1);
--stagger: 50ms;
will-change: transform, opacity;
}
.letter-blur > * {
opacity: 0;
transform: translateY(14px);
animation: letter-blur-in var(--dur) var(--ease) forwards;
animation-delay: calc(var(--i, 0) * var(--stagger));
}
/* blurred 12px at 0 opacity -> easing blur to 0 and opacity to 1 */
@keyframes letter-blur-in {
to {
opacity: 1;
transform: none;
filter: none;
}
}
@media (prefers-reduced-motion: reduce) {
.letter-blur > * {
opacity: 1;
transform: none;
animation: none;
}
}import { useEffect, useRef } from "react";
/** Letter Blur — trigger: entry into view */
export function LetterBlur({ 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="letter-blur" data-state="out">
{children}
</div>
);
}Characters fade in one by one to draw the eye across the word.
The hovered character pushes its neighbours aside.
A soft glow runs through the word one character at a time.
A slow sine wave travels through the characters of a word.