MAKE IT
FEEL PREMIUM.
INTERACTION_032CSS
Masked Line Reveal
Each line slides up from behind an invisible mask, one after the other.
Text / LightView
The hero headline arrives line by line from behind its own masks. Each line translated 110% below its mask at 0 opacity before the trigger; translating each line to 0 while fading in once the hero mounts, after fonts are ready.
/* Split Line Hero Reveal — The hero headline arrives line by line from behind its own masks. */
.split-line-hero-reveal {
--dur: 850ms;
--ease: cubic-bezier(0.22, 1, 0.36, 1);
--stagger: 95ms;
will-change: transform, opacity;
}
.split-line-hero-reveal > * {
opacity: 0;
transform: translateY(14px);
animation: split-line-hero-reveal-in var(--dur) var(--ease) forwards;
animation-delay: calc(var(--i, 0) * var(--stagger));
}
/* each line translated 110% below its mask at 0 opacity -> translating each line to 0 while fading in */
@keyframes split-line-hero-reveal-in {
to {
opacity: 1;
transform: none;
filter: none;
}
}
@media (prefers-reduced-motion: reduce) {
.split-line-hero-reveal > * {
opacity: 1;
transform: none;
animation: none;
}
}import { useEffect, useRef } from "react";
/** Split Line Hero Reveal — trigger: the hero mounts, after fonts are ready */
export function SplitLineHeroReveal({ 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="split-line-hero-reveal" data-state="out">
{children}
</div>
);
}Each line slides up from behind an invisible mask, one after the other.
A precise 2px rule draws itself under the headline.
The emphasised word cycles through audiences or outcomes.