HEADLINE
INTERACTION_066CSS
Animated Headline Underline
A precise 2px rule draws itself under the headline.
Headlines / LightView
The headline scales up slightly as the section takes focus. Scaled to 0.92 at 0 opacity before the trigger; scaling to 1 while fading in once the section crosses 30% of the viewport.
/* Headline Zoom Transition — The headline scales up slightly as the section takes focus. */
.headline-zoom-transition {
--dur: 780ms;
--ease: cubic-bezier(0.22, 1, 0.36, 1);
--stagger: 60ms;
will-change: transform, opacity;
}
.headline-zoom-transition > * {
opacity: 0;
transform: translateY(14px);
animation: headline-zoom-transition-in var(--dur) var(--ease) forwards;
animation-delay: calc(var(--i, 0) * var(--stagger));
}
/* scaled to 0.92 at 0 opacity -> scaling to 1 while fading in */
@keyframes headline-zoom-transition-in {
to {
opacity: 1;
transform: none;
filter: none;
}
}
@media (prefers-reduced-motion: reduce) {
.headline-zoom-transition > * {
opacity: 1;
transform: none;
animation: none;
}
}import { useEffect, useRef } from "react";
/** Headline Zoom Transition — trigger: the section crosses 30% of the viewport */
export function HeadlineZoomTransition({ 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="headline-zoom-transition" data-state="out">
{children}
</div>
);
}A precise 2px rule draws itself under the headline.
The hero headline arrives line by line from behind its own masks.
A pinned headline changes scale and wording as the section scrolls.
The emphasised word cycles through audiences or outcomes.