StealThis .dev

Text Rotate

Animated text that cycles through a list of words with smooth enter/exit transitions — fade, slide, or typewriter style.

Open in Lab
css vanilla-js
Targets: JS HTML

Code

Text Rotate

Cycles through an array of words with CSS-driven transitions. Three animation styles included.

Variants

  • Fade — opacity cross-fade between words
  • Slide up — new word slides in from below, old one exits upward
  • Typewriter — characters appear one by one with a blinking cursor

Usage

Set the word list in data-words as a JSON array on the .text-rotate element. Choose the animation style with a data-mode attribute: fade, slide, or type. The JS reads those attributes and drives the animation loop automatically.