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