This is a simple script (size 2kb), on pure JS for create any animation from Animate.css on page scroll.
When user will scroll down / up page, selected elements will be showed with custom animation. Animation will be refreshed and can be played again if user will be back to element (watch example build/index.html).
Add next files to your page:
animate.css
- you can get it from Animate.csssin-anim.js
- script that do magic
Add next style:
[data-anim]{
visibility:hidden;
animation-name:none
}
[data-anim].animated{
visibility:visible
}
Add any animation to your elements by adding attribute data-anim
with selected animation from here as value.
Example:
<img src="https://picsum.photos/400/?image=1" alt="Image" data-anim="bounce">
Have fun :)
MIT