BLUR TO FOCUS
INTERACTION_031CSS
Blur To Focus Reveal
Copy resolves from a soft blur into perfect focus as it enters view.
Text / LightView
Words fade up in sequence so the sentence assembles as you read it. Each word at 0 opacity, 10px down before the trigger; fading and lifting each word to rest once the sentence enters view.
/* Word By Word Reveal — Words fade up in sequence so the sentence assembles as you read it. */
.word-by-word-reveal {
--dur: 420ms;
--ease: cubic-bezier(0.22, 1, 0.36, 1);
--stagger: 45ms;
will-change: transform, opacity;
}
.word-by-word-reveal > * {
opacity: 0;
transform: translateY(14px);
animation: word-by-word-reveal-in var(--dur) var(--ease) forwards;
animation-delay: calc(var(--i, 0) * var(--stagger));
}
/* each word at 0 opacity, 10px down -> fading and lifting each word to rest */
@keyframes word-by-word-reveal-in {
to {
opacity: 1;
transform: none;
filter: none;
}
}
@media (prefers-reduced-motion: reduce) {
.word-by-word-reveal > * {
opacity: 1;
transform: none;
animation: none;
}
}import { useEffect, useRef } from "react";
/** Word By Word Reveal — trigger: the sentence enters view */
export function WordByWordReveal({ 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="word-by-word-reveal" data-state="out">
{children}
</div>
);
}Copy resolves from a soft blur into perfect focus as it enters view.
Each line slides up from behind an invisible mask, one after the other.
Sentences in a block arrive one at a time with a calm rhythm.
The workhorse: a paragraph lifts gently into place with no drama.