Back to library
INTERACTION_076

Scroll Word Activation.

Individual words light up as the scroll line passes through them. All words at 20% opacity before the trigger; raising word opacity sequentially with the progress value once scroll progress across the paragraph.

CATEGORY
Copy
COMPLEXITY
Advanced
TECH
CSS + JS
PLATFORM
Both
PERFORMANCE
Light
LIVE PLAYGROUND
CSS / CSS
/* Scroll Word Activation — Individual words light up as the scroll line passes through them. */
.scroll-word-activation {
  --dur: scroll-linked;
  --ease: linear;
  --stagger: 60ms;
  will-change: transform, opacity;
}

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

/* all words at 20% opacity -> raising word opacity sequentially with the progress value */
@keyframes scroll-word-activation-in {
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

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

/** Scroll Word Activation — trigger: scroll progress across the paragraph */
export function ScrollWordActivation({ 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-word-activation" data-state="out">
      {children}
    </div>
  );
}

IF YOU LIKE THIS, STEAL THESE TOO.

INTERACTION_074CSS

Sentence Opacity Progression

Sentences brighten in turn so attention moves down the block.

Copy / LightView
INTERACTION_075CSS

Reading Progress Highlight

A thin progress rule tracks how far the reader has moved.

Copy / LightView
INTERACTION_077CSS

Paragraph Masking

A paragraph is revealed behind a soft gradient mask as it enters.

Copy / LightView
INTERACTION_078CSS

Keyword Emphasis Animation

Key terms in a paragraph brighten after the copy settles.

Copy / LightView