This example demonstrates how to use GSAP’s SplitText plugin to break a block of HTML text into characters, words, or lines, and animate them individually.
SplitText.create() splits the text into elements based on the type you choose:
chars, words, or lines.
You can assign custom classes to each type via charsClass, wordsClass, and
linesClass, which makes it easy to style or animate them.
A dropdown lets you switch the split type dynamically. When the type changes:
.revert()gsap.fromTo() on the new elementsSplitText is useful when you want to create fine-grained animations like: