April 29, 2021 01:21 am GMT
Original Link: https://dev.to/lemmin/simple-text-revealer-kfj
Simple Text Revealer
All text nodes in the provided container will be parsed and added back into the DOM with a wrapping span (by letter or word) including classes that describe the hidden and revealed styles (and transition).
Any transition you can think of can be used to animate each individual letter or word in sequence (doesn't even need to be a reveal).
The reveal() method returns a promise that resolves when all the text has transitioned. This demo uses the promises to chain the reveal animations together.
You can use reset() or replay() to run the animation again. The transitions will apply when resetting as well (all at once).
Original Link: https://dev.to/lemmin/simple-text-revealer-kfj
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To