Back to library
INTERACTION_046

Scroll Synced Text Reveal.

Words brighten as the scroll position moves through the paragraph. Every word at 18% opacity before the trigger; raising each word to full opacity as the progress line passes it once scroll progress across the pinned paragraph.

CATEGORY
Text
COMPLEXITY
Advanced
TECH
CSS + JS
PLATFORM
Both
PERFORMANCE
Medium
LIVE PLAYGROUND
MAKEITPREMIUM
CSS / CSS
/* Scroll Synced Text Reveal — Words brighten as the scroll position moves through the paragraph. */
.scroll-synced-text-reveal {
  --dur: scroll-linked;
  --ease: linear;
  --stagger: 60ms;
  will-change: transform, opacity;
}

.scroll-synced-text-reveal > * {
  opacity: 0;
  transform: translateY(14px);
  animation: scroll-synced-text-reveal-in var(--dur) var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * var(--stagger));
}

/* every word at 18% opacity -> raising each word to full opacity as the progress line passes it */
@keyframes scroll-synced-text-reveal-in {
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-synced-text-reveal > * {
    opacity: 1;
    transform: none;
    animation: none;
  }
}
React / TSX
import { useEffect, useRef } from "react";

/** Scroll Synced Text Reveal — trigger: scroll progress across the pinned paragraph */
export function ScrollSyncedTextReveal({ 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="scroll-synced-text-reveal" data-state="out">
      {children}
    </div>
  );
}

IF YOU LIKE THIS, STEAL THESE TOO.

BLUR TO FOCUS
INTERACTION_031CSS

Blur To Focus Reveal

Copy resolves from a soft blur into perfect focus as it enters view.

Text / LightView
MAKE IT
FEEL PREMIUM.
INTERACTION_032CSS

Masked Line Reveal

Each line slides up from behind an invisible mask, one after the other.

Text / LightView
MAKEITPREMIUM
INTERACTION_033CSS

Word By Word Reveal

Words fade up in sequence so the sentence assembles as you read it.

Text / LightView
INTERACTION_034CSS

Staggered Sentence Reveal

Sentences in a block arrive one at a time with a calm rhythm.

Text / LightView