SHIPFASTER
INTERACTION_065CSS
Expanding Keyword
One keyword grows and the rest of the line reflows around it.
Headlines / LightView
Giant type drifts slower than the content in front of it. Offset 40px below its resting position before the trigger; translating the layer at 0.25 of the scroll delta once scroll position relative to the section.
/* Oversized Typography Parallax — Giant type drifts slower than the content in front of it. */
.oversized-typography-parallax {
--dur: scroll-linked;
--ease: linear;
--stagger: 60ms;
will-change: transform, opacity;
}
.oversized-typography-parallax > * {
opacity: 0;
transform: translateY(14px);
animation: oversized-typography-parallax-in var(--dur) var(--ease) forwards;
animation-delay: calc(var(--i, 0) * var(--stagger));
}
/* offset 40px below its resting position -> translating the layer at 0.25 of the scroll delta */
@keyframes oversized-typography-parallax-in {
to {
opacity: 1;
transform: none;
filter: none;
}
}
@media (prefers-reduced-motion: reduce) {
.oversized-typography-parallax > * {
opacity: 1;
transform: none;
animation: none;
}
}import { useEffect, useRef } from "react";
/** Oversized Typography Parallax — trigger: scroll position relative to the section */
export function OversizedTypographyParallax({ 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="oversized-typography-parallax" data-state="out">
{children}
</div>
);
}One keyword grows and the rest of the line reflows around it.
One phrase blurs and dissolves directly into the next.
Outlined type with a light gradient travelling around the stroke.
The hero headline arrives line by line from behind its own masks.