Back to library
INTERACTION_060

Letter 3D Rotation.

Characters rotate in on the Y axis with real perspective. Rotated -75deg on the Y axis at 0 opacity before the trigger; rotating to 0deg while fading in once entry into view.

CATEGORY
Letters
COMPLEXITY
Intermediate
TECH
CSS
PLATFORM
Both
PERFORMANCE
Medium
LIVE PLAYGROUND
VAULT
CSS / CSS
/* Letter 3D Rotation — Characters rotate in on the Y axis with real perspective. */
.letter-3d-rotation {
  --dur: 700ms;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --stagger: 48ms;
  will-change: transform, opacity;
}

.letter-3d-rotation > * {
  opacity: 0;
  transform: translateY(14px);
  animation: letter-3d-rotation-in var(--dur) var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * var(--stagger));
}

/* rotated -75deg on the Y axis at 0 opacity -> rotating to 0deg while fading in */
@keyframes letter-3d-rotation-in {
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

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

/** Letter 3D Rotation — trigger: entry into view */
export function Letter3DRotation({ 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="letter-3d-rotation" data-state="out">
      {children}
    </div>
  );
}

IF YOU LIKE THIS, STEAL THESE TOO.

VAULT
INTERACTION_051CSS

Letter Flip

Characters flip on the X axis like a departure board.

Letters / LightView
VAULT
INTERACTION_047CSS

Letter By Letter Fade

Characters fade in one by one to draw the eye across the word.

Letters / LightView
VAULT
INTERACTION_050CSS + JS

Scattered Letters Assemble

Characters fly in from random offsets and lock into the word.

Letters / LightView
VAULT
INTERACTION_052CSS

Letter Blur

Characters sharpen from a heavy blur into crisp type.

Letters / MediumView