BUILT FOR
FOUNDERSDESIGNERS
INTERACTION_069CSS
Text Morphing
One phrase blurs and dissolves directly into the next.
Headlines / MediumView
Outlined type with a light gradient travelling around the stroke. A static low-contrast stroke before the trigger; moving the gradient across the stroke fill once in view, looping every 5 seconds.
/* Gradient Border Text — Outlined type with a light gradient travelling around the stroke. */
.gradient-border-text {
--dur: 5s;
--ease: linear;
--stagger: 60ms;
will-change: transform, opacity;
}
.gradient-border-text > * {
opacity: 0;
transform: translateY(14px);
animation: gradient-border-text-in var(--dur) var(--ease) forwards;
animation-delay: calc(var(--i, 0) * var(--stagger));
}
/* a static low-contrast stroke -> moving the gradient across the stroke fill */
@keyframes gradient-border-text-in {
to {
opacity: 1;
transform: none;
filter: none;
}
}
@media (prefers-reduced-motion: reduce) {
.gradient-border-text > * {
opacity: 1;
transform: none;
animation: none;
}
}import { useEffect, useRef } from "react";
/** Gradient Border Text — trigger: in view, looping every 5 seconds */
export function GradientBorderText({ 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="gradient-border-text" data-state="out">
{children}
</div>
);
}One phrase blurs and dissolves directly into the next.
One keyword grows and the rest of the line reflows around it.
Oversized type scrolls sideways in a continuous loop.
Giant type drifts slower than the content in front of it.