SHIPFASTER
INTERACTION_071CSS
Headline Zoom Transition
The headline scales up slightly as the section takes focus.
Headlines / LightView
A precise 2px rule draws itself under the headline. Scaled to 0 on the X axis with origin left before the trigger; scaling the rule to full width once entry into view.
/* Animated Headline Underline — A precise 2px rule draws itself under the headline. */
.animated-headline-underline {
--dur: 520ms;
--ease: cubic-bezier(0.22, 1, 0.36, 1);
--stagger: 60ms;
will-change: transform, opacity;
}
.animated-headline-underline > * {
opacity: 0;
transform: translateY(14px);
animation: animated-headline-underline-in var(--dur) var(--ease) forwards;
animation-delay: calc(var(--i, 0) * var(--stagger));
}
/* scaled to 0 on the X axis with origin left -> scaling the rule to full width */
@keyframes animated-headline-underline-in {
to {
opacity: 1;
transform: none;
filter: none;
}
}
@media (prefers-reduced-motion: reduce) {
.animated-headline-underline > * {
opacity: 1;
transform: none;
animation: none;
}
}import { useEffect, useRef } from "react";
/** Animated Headline Underline — trigger: entry into view */
export function AnimatedHeadlineUnderline({ 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="animated-headline-underline" data-state="out">
{children}
</div>
);
}The headline scales up slightly as the section takes focus.
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.