Back to library
INTERACTION_031

Blur To Focus Reveal.

Copy resolves from a soft blur into perfect focus as it enters view. Blurred by 10px at 0 opacity and 12px below its final position before the trigger; easing blur to 0, opacity to 1 and translateY to 0 in a single pass once 20% of the element enters the viewport.

CATEGORY
Text
COMPLEXITY
Easy
TECH
CSS
PLATFORM
Both
PERFORMANCE
Light
LIVE PLAYGROUND
BLUR TO FOCUS
CSS / CSS
/* Blur To Focus Reveal — Copy resolves from a soft blur into perfect focus as it enters view. */
.blur-to-focus-reveal {
  --dur: 700ms;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --stagger: 60ms;
  will-change: transform, opacity;
}

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

/* blurred by 10px at 0 opacity and 12px below its final position -> easing blur to 0, opacity to 1 and translateY to 0 in a single pass */
@keyframes blur-to-focus-reveal-in {
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

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

/** Blur To Focus Reveal — trigger: 20% of the element enters the viewport */
export function BlurToFocusReveal({ 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="blur-to-focus-reveal" data-state="out">
      {children}
    </div>
  );
}

IF YOU LIKE THIS, STEAL THESE TOO.

MAKE IT
FEEL PREMIUM.
INTERACTION_032CSS

Masked Line Reveal

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

Text / LightView
FOLLOW THE LIGHT
Desktop only
INTERACTION_139CSS + JS

Cursor Spotlight

A wide soft light follows the pointer across a dark section.

Mouse / 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