INTERACTION_151CSS
Aurora Gradient
Long ribbons of light fold slowly across the top of the section.
Background / MediumView
Soft overlapping gradients drift behind the content. Blobs at their base positions before the trigger; translating and scaling each blob on a long offset loop once in view, looping continuously.
/* Gradient Mesh — Soft overlapping gradients drift behind the content. */
.gradient-mesh {
--dur: 18s;
--ease: ease-in-out;
--stagger: 60ms;
will-change: transform, opacity;
}
.gradient-mesh > * {
opacity: 0;
transform: translateY(14px);
animation: gradient-mesh-in var(--dur) var(--ease) forwards;
animation-delay: calc(var(--i, 0) * var(--stagger));
}
/* blobs at their base positions -> translating and scaling each blob on a long offset loop */
@keyframes gradient-mesh-in {
to {
opacity: 1;
transform: none;
filter: none;
}
}
@media (prefers-reduced-motion: reduce) {
.gradient-mesh > * {
opacity: 1;
transform: none;
animation: none;
}
}import { useEffect, useRef } from "react";
/** Gradient Mesh — trigger: in view, looping continuously */
export function GradientMesh({ 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-mesh" data-state="out">
{children}
</div>
);
}Long ribbons of light fold slowly across the top of the section.
A wide dark gradient shifts imperceptibly across the page.