Zero dependencies · ~3 KB total
Explore a collection of free CSS and JavaScript animations designed to enhance user experience and bring websites to life. These animations are built to help fellow beginner web developers learn, experiment, and improve their front-end development skills.
<div class="animate fade-up delay-2"></div>
Drop animation.css in your <head> and animation.js before your closing </body> tag. That is the entire setup.
<body>, or add the defer attribute to the script tag.<head> <!-- 1. CSS in <head> --> <link rel="stylesheet" href="animation.css"> </head> <body> <!-- your content here --> <!-- 2. JS before </body> --> <script src="animation.js"></script> </body>
animate to any elementThe animate class is required on every element you want to animate. It sets the element to invisible and enables the CSS transition engine. Without it, nothing happens.
animate to any tag — div, h1, p, img, section, anything.<!-- Correct: has the base class --> <div class="animate">I will animate</div> <!-- Wrong: missing base class, will NOT work --> <div class="fade-up">I will NOT animate</div>
Add one animation class alongside animate to define the motion. Each class sets an initial CSS transform that resolves when the element enters the viewport.
<!-- Fades --> <div class="animate fade-in">Opacity only</div> <div class="animate fade-up">Rise from below</div> <div class="animate fade-left">Enter from right</div> <div class="animate fade-right">Enter from left</div> <!-- Slides --> <div class="animate slide-up">Bold rise</div> <div class="animate slide-left">Bold enter from right</div> <!-- Zoom & Bounce --> <div class="animate zoom-in">Scale from 80%</div> <div class="animate bounce-in">Spring with overshoot</div>
delay-NAdd a delay-N class (1 through 10) to stagger sibling animations. Each step = 0.1 s. Perfect for cards and grids — gives a cascading waterfall effect with zero extra JavaScript.
delay-1, delay-2, delay-3… The browser handles the rest.<div class="grid"> <div class="animate fade-up delay-1">Card 1</div> <div class="animate fade-up delay-2">Card 2</div> <div class="animate fade-up delay-3">Card 3</div> <div class="animate fade-up delay-4">Card 4</div> </div> <!-- delay-1=0.1s delay-2=0.2s ... delay-10=1.0s -->
LIVE EXAMPLE ↓ (scroll to see)
function enqueue_animate_system() { wp_enqueue_style( 'animate-css', get_template_directory_uri() . '/animation.css' ); wp_enqueue_script( 'animate-js', get_template_directory_uri() . '/animation.js', [], false, true // true = load in footer ); } add_action( 'wp_enqueue_scripts', 'enqueue_animate_system' );
── FADE
Translates 40px up while fading in. The most versatile animation — use it for almost everything.
Slides in from 40px to the right. Great for sidebar content or right-column items.
Mirror of fade-left. Alternate these on two-column layouts for a converging entrance.
── SLIDE
── ZOOM & BOUNCE
Choose an animation, pick a delay, hit Play — preview it instantly with no page reload.