INTERACTION_075CSS
Reading Progress Highlight
A thin progress rule tracks how far the reader has moved.
Copy / LightView
Content blocks appear in stages as the reader advances. Only the first block visible, the rest at 0 opacity and 20px down before the trigger; lifting and fading each block in as it is reached once each block reaching 25% visibility.
/* Progressive Content Disclosure — Content blocks appear in stages as the reader advances. */
.progressive-content-disclosure {
--dur: 520ms;
--ease: cubic-bezier(0.22, 1, 0.36, 1);
--stagger: 0ms;
will-change: transform, opacity;
}
.progressive-content-disclosure > * {
opacity: 0;
transform: translateY(14px);
animation: progressive-content-disclosure-in var(--dur) var(--ease) forwards;
animation-delay: calc(var(--i, 0) * var(--stagger));
}
/* only the first block visible, the rest at 0 opacity and 20px down -> lifting and fading each block in as it is reached */
@keyframes progressive-content-disclosure-in {
to {
opacity: 1;
transform: none;
filter: none;
}
}
@media (prefers-reduced-motion: reduce) {
.progressive-content-disclosure > * {
opacity: 1;
transform: none;
animation: none;
}
}import { useEffect, useRef } from "react";
/** Progressive Content Disclosure — trigger: each block reaching 25% visibility */
export function ProgressiveContentDisclosure({ 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="progressive-content-disclosure" data-state="out">
{children}
</div>
);
}A thin progress rule tracks how far the reader has moved.
Key terms in a paragraph brighten after the copy settles.
List items slide in with their markers drawing first.
Sentences brighten in turn so attention moves down the block.