INTERACTION_074CSS
Sentence Opacity Progression
Sentences brighten in turn so attention moves down the block.
Copy / LightView
Extra detail expands smoothly without a jump in layout. Collapsed to 0 height with content hidden from assistive tech before the trigger; animating grid-template-rows from 0fr to 1fr while fading the content in once clicking the disclosure control.
/* Expandable Supporting Copy — Extra detail expands smoothly without a jump in layout. */
.expandable-supporting-copy {
--dur: 380ms;
--ease: cubic-bezier(0.22, 1, 0.36, 1);
--stagger: 60ms;
will-change: transform, opacity;
}
.expandable-supporting-copy > * {
opacity: 0;
transform: translateY(14px);
animation: expandable-supporting-copy-in var(--dur) var(--ease) forwards;
animation-delay: calc(var(--i, 0) * var(--stagger));
}
/* collapsed to 0 height with content hidden from assistive tech -> animating grid-template-rows from 0fr to 1fr while fading the content in */
@keyframes expandable-supporting-copy-in {
to {
opacity: 1;
transform: none;
filter: none;
}
}
@media (prefers-reduced-motion: reduce) {
.expandable-supporting-copy > * {
opacity: 1;
transform: none;
animation: none;
}
}import { useEffect, useRef } from "react";
/** Expandable Supporting Copy — trigger: clicking the disclosure control */
export function ExpandableSupportingCopy({ 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="expandable-supporting-copy" data-state="out">
{children}
</div>
);
}Sentences brighten in turn so attention moves down the block.
A paragraph is revealed behind a soft gradient mask as it enters.
A thin progress rule tracks how far the reader has moved.
Individual words light up as the scroll line passes through them.