30 CSS Keyframe Animations

CSS keyframe animations are the most-used motion primitive on the web — every spinner, every shimmer, every breathing pulse, every infinite ticker runs on @keyframes. These 30 hand-coded animations cover every production pattern in 2026: loading spinners, typewriter text, bouncing ball, pulse glow, morphing blobs, particle bursts, waves, 3D flips, neon flicker, skeleton loading, glitch text, orbit, liquid fill, stagger lists, fire, ripple, floating elements, infinite ticker, countdown timers, path drawing, spotlight, spring bounce, confetti, breathing meditation, typewriter-delete loop, aurora borealis, card stacks, kinetic typography, morphing progress steps, and animated gradient mesh. All 100% pure CSS — zero JavaScript, zero libraries, zero dependencies. GPU-accelerated via transform + opacity (compositor-thread, 60fps on mid-tier mobile, INP-friendly), respect prefers-reduced-motion, MIT-licensed.

30 unique keyframe animations 100% copy-paste ready Published
01 / 30
CSS Keyframe Loading Spinners
Pure CSS
CSS Keyframe Loading Spinners — preview
Nine animated CSS loading spinners — ring, dual-rotate, dot orbit, morph shape, pulse dots, audio wave, comet trail, folding grid, and progress sweep — each driven by a single scoped keyframe.
02 / 30
CSS Typing Typewriter Text Effect
Pure CSS
CSS Typing Typewriter Text Effect — preview
Classic typewriter cursor, multi-word loop, code-line reveal and glitch-reveal text animations using CSS width + border-right keyframes only, zero JS.
03 / 30
CSS Bouncing Ball Animation
Pure CSS
CSS Bouncing Ball Animation — preview
Realistic bouncing ball physics with squash-and-stretch, pendulum swing, stagger trio and rolling ball — all driven by cubic-bezier keyframes, no JavaScript.
04 / 30
CSS Pulse Glow Animation Button
Pure CSS
CSS Pulse Glow Animation Button — preview
Nine glowing button animation styles: ripple pulse, neon glow, heartbeat, shimmer sweep, border spin, breath expand, lightning flash, radar sweep and glow bloom.
05 / 30
CSS Morphing Blob Animation
Pure CSS
CSS Morphing Blob Animation — preview
Six organic morphing blob animations — duo-colour, gradient shift, blend cluster, breathing ring and labelled blob — using staggered border-radius keyframes.
06 / 30
CSS Particle Burst Animation
Pure CSS
CSS Particle Burst Animation — preview
Four particle burst effects: shockwave rings, firework sparks, spinning petals and confetti rain — all pure CSS translate + scale keyframes, no canvas.
07 / 30
CSS Wave Animation
Pure CSS
CSS Wave Animation — preview
Ocean waves with animated boat, gradient wave, liquid-level vial and expanding pulse rings using CSS clip-path and sinusoidal keyframe paths.
08 / 30
CSS 3D Flip Card Animation
Pure CSS
CSS 3D Flip Card Animation — preview
Four CSS 3D card flip animations: auto-flip Y-axis, hover-triggered flip, X-axis flip and diagonal flip using CSS perspective and rotateY/X keyframes.
09 / 30
CSS Neon Sign Flicker Animation
Pure CSS
CSS Neon Sign Flicker Animation — preview
Five neon sign animations: cursive pink glow, cyan monospace, OPEN sign box, script yellow hum and multi-word stagger flicker using box-shadow and opacity keyframes.
10 / 30
CSS Skeleton Loading Animation
Pure CSS
CSS Skeleton Loading Animation — preview
Shimmer skeleton loading placeholders for blog cards, profile layouts, list rows and dashboard stat cards using a scoped linear-gradient sweep keyframe.
11 / 30
CSS Glitch Text Animation Effect
Pure CSS
CSS Glitch Text Animation Effect — preview
Four CSS glitch text effects: RGB channel split, terminal ghost, slice glitch and noise word distortion — using clip-path and translate keyframes with no JS.
12 / 30
CSS Orbit Animation Solar System
Pure CSS
CSS Orbit Animation Solar System — preview
Animated solar system with Sun, Mercury, Venus, Earth, Mars, Jupiter and Saturn orbiting at variable speeds on a starfield background — pure CSS rotate keyframes.
Advertisement
13 / 30
CSS Liquid Fill Animation Progress Bar
Pure CSS
CSS Liquid Fill Animation Progress Bar — preview
Liquid-fill progress bars with wave-bubble effect and circular liquid-fill widgets using CSS clip-path, pseudo-element waves and scoped keyframes.
14 / 30
CSS Stagger Animation List Items
Pure CSS
CSS Stagger Animation List Items — preview
Three stagger animation patterns: slide-from-left list items, scale-and-fade cards and cascade drop timeline entries using nth-child animation-delay.
15 / 30
CSS Fire Animation Pure CSS
Pure CSS
CSS Fire Animation Pure CSS — preview
Pure CSS fire: flickering candle with wick and wax, campfire with log base and IGNITE flame text — radial gradient bodies animated with scale and blur keyframes.
16 / 30
CSS Ripple Click Animation Effect
Pure CSS
CSS Ripple Click Animation Effect — preview
Material Design ripple animations on six button variants, FAB, chip groups and icon buttons using ::after pseudo-element scale + opacity keyframes.
17 / 30
CSS Floating Elements Animation
Pure CSS
CSS Floating Elements Animation — preview
Hero section with six floating stat cards and a floating icon grid using staggered translateY + rotate keyframe animations with unique durations per element.
18 / 30
CSS Infinite Scroll Ticker Animation
Pure CSS
CSS Infinite Scroll Ticker Animation — preview
Stock price ticker, brand logo marquee, bidirectional word scroll rows and breaking-news headline ticker using CSS translateX keyframes on duplicated content.
19 / 30
CSS Countdown Timer Animation
Pure CSS
CSS Countdown Timer Animation — preview
Arc ring countdown timers × 4, an animated flip clock and three linear progress countdown bars — all stroke-dashoffset or scaleX keyframes, pure CSS.
20 / 30
CSS Path Drawing Animation
Pure CSS
CSS Path Drawing Animation — preview
SVG stroke-drawing animations: signature handwriting, success checkmark, map route, logo outline, circuit trace and infinite symbol — stroke-dashoffset keyframes only.
21 / 30
CSS Spotlight Animation Effect
Pure CSS
CSS Spotlight Animation Effect — preview
Six spotlight effects: roving text highlight, stage light cones, security scan beam, product reveal orb, grid cell highlight and club sweep — radial-gradient keyframes.
22 / 30
CSS Spring Bounce Animation
Pure CSS
CSS Spring Bounce Animation — preview
Eight CSS spring and elastic animations: drop ball with squash, elastic button, pop-in notification, stagger scale cards, spin, wobbly text, spring menu and rubber bars.
23 / 30
CSS Confetti Explosion Animation
Pure CSS
CSS Confetti Explosion Animation — preview
Three confetti explosion styles: multi-directional radial burst, falling confetti rain and party-popper cracker — all pure CSS translate + rotate keyframes.
24 / 30
CSS Breathing Animation Meditation
Pure CSS
CSS Breathing Animation Meditation — preview
Six calming CSS breathing animations: classic expanding circle, box-breathing dot tracer, ripple rings, lotus bloom petals, SVG wave breath and stroke-dashoffset timer ring.
Advertisement
25 / 30
CSS Typewriter Delete Animation Loop
Pure CSS
CSS Typewriter Delete Animation Loop — preview
Six typewriter-and-delete loop patterns: word cycler, terminal prompt, search input placeholder, big display, multiline build-and-erase and code editor typing.
26 / 30
CSS Aurora Borealis Animation Background
Pure CSS
CSS Aurora Borealis Animation Background — preview
Animated northern-lights sky with skewed gradient curtain bands, tree silhouette and four colour-variant cards — green, purple/pink, blue-teal and multicolour aurora.
27 / 30
CSS Card Stack Animation
Pure CSS
CSS Card Stack Animation — preview
Five card stack animations: flip-through financial deck, fanned playing cards, depth-rise pricing stack, Tinder-style swipe deck and floating credit card stack.
28 / 30
CSS Kinetic Typography Animation
Pure CSS
CSS Kinetic Typography Animation — preview
Five kinetic type scenes: stagger letter spring-drop, explode-and-reassemble, sinusoidal wave, scale-pulse mixed-weight headline and RGB-split glitch — pure CSS keyframes.
29 / 30
CSS Morphing Progress Steps Animation
Pure CSS
CSS Morphing Progress Steps Animation — preview
Four animated progress step UI patterns: horizontal step track, radial ring steps, morphing pill steps and animated vertical timeline — all scoped CSS keyframes.
30 / 30
CSS Animated Gradient Mesh Background
Pure CSS
CSS Animated Gradient Mesh Background — preview
Animated gradient mesh using floating radial-gradient orbs on a dark base: full hero scene, four colour-variant cards (purple, pink, green, gold) and a rainbow gradient text strip.
FAQ

Frequently asked questions

What is a CSS @keyframes animation and how does it differ from a transition?
A CSS <code>@keyframes</code> animation defines a multi-step animation sequence — you specify intermediate states (0%, 25%, 50%, etc.) and the browser interpolates between them. A <code>transition</code> animates ONLY between two states (a property value before and after a state change like <code>:hover</code> or a JS class toggle). Decision tree: <strong>(1)</strong> State change like hover/click → use <code>transition</code> — simpler, less code. <strong>(2)</strong> Looping motion (spinner, pulse, breathing, infinite ticker, glitch, aurora) → use <code>animation</code> + <code>@keyframes</code> — <code>transition</code> can't loop. <strong>(3)</strong> Multi-stage choreography (icon morphs through 4 shapes, confetti bursts in 5 phases) → use <code>animation</code> — only @keyframes can express more than two states. <strong>(4)</strong> Scroll-driven motion → use <code>animation-timeline: scroll()</code> (Chrome 115+, Safari 18+) or a JS IntersectionObserver. All 30 demos in this collection use <code>@keyframes</code> because every pattern needs multi-step or infinite-loop motion that <code>transition</code> alone can't express.
Can I build a typewriter text effect in pure CSS without typed.js?
Yes — Demo 02 (CSS Typing Typewriter Text Effect) and Demo 25 (Typewriter Delete Loop) ship two variants, both 100% pure CSS. The core trick: <strong>two coordinated animations</strong>. (1) Set <code>width: 0</code> on a <code>.typewriter</code> element with <code>white-space: nowrap; overflow: hidden</code>, then animate <code>width: 0 → 100%</code> via <code>@keyframes type</code> using the <code>steps(N, end)</code> timing function where N = character count. (2) A flashing cursor via a <code>::after</code> pseudo-element with <code>animation: blink 0.7s step-end infinite</code> alternating <code>opacity: 1 / 0</code>. Cost comparison: <strong>typed.js</strong> ships ~10kb minified + requires JavaScript setup per element. <strong>This demo's approach</strong>: ~15 lines of CSS, ~0 bytes of JS, no library, no setup code, works in every framework or no framework. Demo 25 adds a delete-and-retype loop using <code>animation-direction: alternate</code> + a coordinated <code>animation-delay</code> on the cursor — still pure CSS, still ~25 lines.
How do I do particle bursts and confetti without HTML canvas?
Demos 06 (Particle Burst Animation) and 23 (Confetti Explosion Animation) ship the canvas-free pattern. The mechanic: pre-create N small <code>&lt;div&gt;</code> elements at the origin point, each with a unique <code>@keyframes</code> animation that defines a unique flight path (random x/y end positions via per-element CSS custom properties + <code>transform: translate()</code>). The <code>animation-fill-mode: forwards</code> property keeps each particle at its end position after the animation completes; <code>opacity</code> fades to 0 in the last 30% of the keyframes so the particles disappear after their burst. Cost comparison: <strong>canvas-confetti</strong> ships ~9kb minified + requires a <code>&lt;canvas&gt;</code> element + <code>requestAnimationFrame</code> draw loop + canvas context setup. <strong>This demo's approach</strong>: ~60 lines of CSS, 0 JS, 0 canvas, works on every browser since 2017. Trade-off: canvas-confetti supports 1000+ particles smoothly; this CSS pattern caps out around 50-80 particles before paint cost compounds. For typical celebration moments (form submission success, milestone reached, level-up confetti) 30-50 particles is more than enough and the visual impact matches the canvas version.
How do I build a skeleton loading shimmer animation (Facebook / LinkedIn style)?
Demo 10 (CSS Skeleton Loading Animation) ships the production-grade shimmer-bar pattern. The implementation: skeleton elements are gray placeholders matching the eventual content's shape (avatar circle, two text bars, image rectangle). Each has <code>background: linear-gradient(90deg, #e0e0e0 0%, #f5f5f5 50%, #e0e0e0 100%)</code> with <code>background-size: 200% 100%</code>, running <code>animation: shimmer 1.5s infinite</code> that translates <code>background-position</code> from <code>200% 0</code> to <code>-200% 0</code>. The shimmer band sweeps left-to-right across the placeholder, signaling "loading". Cost comparison: <strong>react-loading-skeleton</strong> ships ~8kb + requires React + JSX setup. <strong>This demo's approach</strong>: ~20 lines of CSS, framework-neutral, works in any stack. Three production-grade details most tutorials miss: (1) <strong>Match the skeleton's exact dimensions to the real content</strong> — otherwise visitors see layout shift (LCP penalty) when content replaces skeleton. (2) <strong>Add <code>prefers-reduced-motion</code> fallback</strong> — replace the shimmer animation with a static gray for visitors with motion sensitivity. (3) <strong>Show skeleton only after 200ms</strong> — if content loads faster, skip skeleton entirely (no flash-of-loading-state). Demo 10 includes all three.
How do I create an infinite-scroll ticker (HTML <marquee> replacement)?
Demo 18 (CSS Infinite Scroll Ticker Animation) ships the modern <code>&lt;marquee&gt;</code> replacement. HTML <code>&lt;marquee&gt;</code> has been deprecated since HTML5; modern browsers still render it but it's flagged as non-standard and may stop working in future versions. The CSS pattern: <strong>duplicate the ticker content</strong> inside a parent container with <code>overflow: hidden</code>, then animate the inner wrapper with <code>animation: scroll 30s linear infinite</code> that translates <code>transform: translateX(0) → translateX(-50%)</code>. Because the content is duplicated, when the first copy scrolls off-screen the second copy is already in view, creating a seamless infinite loop. Why the 50% endpoint (not 100%): the inner wrapper's width is 200% of the visible viewport because of the duplication; translating to -50% moves exactly one copy's-worth, then the loop restarts cleanly. Three production-grade details: (1) <strong>Pause on hover</strong> via <code>animation-play-state: paused</code> — accessibility-friendly so visitors can read the ticker. (2) <strong>Respect <code>prefers-reduced-motion</code></strong> — stop the scroll entirely, let visitors see all content statically. (3) <strong>Direction reversal</strong> via <code>animation-direction: reverse</code> for right-to-left RTL layouts. ~25 lines of CSS, zero JS, replaces deprecated <code>&lt;marquee&gt;</code>.
Will animating @keyframes hurt my Core Web Vitals INP score?
Not if you follow two rules — both of which all 30 demos in this collection follow. <strong>Rule 1: animate <code>transform</code> and <code>opacity</code> only.</strong> These two properties are GPU-accelerated and run on the compositor thread — they don't trigger layout recalculation or paint of other elements. Animating <code>width</code>, <code>height</code>, <code>top</code>, <code>left</code>, <code>margin</code>, <code>padding</code>, <code>border-width</code>, or <code>font-size</code> forces "layout thrashing" — every animation frame the browser recalculates every element's position, costing 4-16ms per frame and tanking <strong>INP (Interaction to Next Paint)</strong>, the Core Web Vital that replaced FID in March 2024. <strong>Rule 2: animate <code>box-shadow</code>, <code>filter</code>, or <code>border-radius</code> only when you have to.</strong> These animate properties that require expensive paint recalculation each frame (2-8ms per frame). Demos that need shadow-or-blur transitions (Demo 04 pulse-glow button, Demo 09 neon flicker) use the opacity-cross-fade workaround: pre-render the glowing state as a separate element with <code>opacity: 0</code>, then animate opacity 0 → 1. The browser composites the two states instead of recalculating the shadow — drops paint cost from 8ms to under 1ms. Result: every demo in this collection runs at 60fps on a mid-tier 2022 Android phone (Pixel 5 / Galaxy A52 baseline). Lighthouse mobile-profile scores: 95+ Performance on all 30 demos.
How do I create an animated gradient mesh background without Three.js or WebGL?
Demo 30 (CSS Animated Gradient Mesh Background) ships the pure-CSS approach to the gradient-mesh visual that Stripe, Cal.com, and Linear marketing pages popularized. The trick: <strong>three or four large radial-gradient circles</strong> stacked via <code>background-image</code> with semi-transparent colors, then animate the <code>background-position</code> of each via <code>@keyframes</code> with different durations (20s, 28s, 35s) so the gradient "orbs" drift independently. The result is an organic, slowly-shifting color field that looks expensive to render but is actually pure CSS. Cost comparison: <strong>Three.js gradient-mesh shader</strong> ships ~600kb + requires WebGL context + custom shader code. <strong>Mesh-gradient libraries</strong> like meshgradient.js ship ~30-80kb + canvas setup. <strong>This demo's approach</strong>: ~30 lines of CSS, 0 JS, 0 canvas, 0 WebGL, works on every browser since 2018 (radial-gradient support). Performance is genuinely cheap — <code>background-position</code> animation is GPU-accelerated, runs on the compositor thread. Trade-off: pure CSS can't do the smooth Voronoi-cell color blending that real shader-based mesh gradients produce; it's an approximation that reads as "gradient mesh" to the visitor's brain without being mathematically identical.
What's the right animation-timing-function to use? When should I use steps()?
Five canonical timing functions, each with a clear use case. <strong>(1) <code>linear</code></strong> — constant speed. Use for: rotation (loading spinners), infinite scroll tickers, conveyor-belt patterns. Anything that should feel mechanical and constant. <strong>(2) <code>ease</code></strong> (default) — slow start, fast middle, slow end. Generic motion for content reveals. Safe default but rarely the BEST choice for any specific animation. <strong>(3) <code>ease-out</code></strong> (<code>cubic-bezier(0, 0, 0.2, 1)</code>) — fast start, decelerating end. Use for: elements ENTERING the viewport (modal opens, toast appears, list item reveals). Mimics natural deceleration; the visitor's eye lands gently on the final position. <strong>(4) <code>ease-in</code></strong> (<code>cubic-bezier(0.4, 0, 1, 1)</code>) — slow start, accelerating. Use for: elements LEAVING the viewport (modal closes, page transition out, toast dismisses). Mimics gravity pulling something out of frame. <strong>(5) <code>cubic-bezier(0.34, 1.56, 0.64, 1)</code></strong> — overshoot + settle (spring bounce, Demo 22). Use for: playful button presses, success states, achievement unlocks. The 1.56 Y-value creates the overshoot. <strong>steps(N, end)</strong> — snaps between N discrete frames instead of interpolating smoothly. Use for: typewriter cursors (Demo 02, 25), sprite-sheet animations, retro 8-bit motion. Most online tutorials default to <code>ease</code> for everything; the demos in this collection use the right timing function for each pattern, and the file headers document the choice.
Are CSS keyframe animations accessible? What about prefers-reduced-motion?
Three accessibility considerations matter for keyframe animations, and all 30 demos in this collection handle them. <strong>Consideration 1: <code>prefers-reduced-motion</code></strong> — WCAG 2.3.3 "Animation from Interactions". Visitors with vestibular disorders (motion sickness, inner ear conditions, migraine triggers) can experience nausea from continuous animations (spinners, pulse, breathing, aurora, ticker). Every demo includes an <code>@media (prefers-reduced-motion: reduce)</code> block that either disables the animation entirely OR replaces it with a static styling that still communicates the underlying signal — e.g. Demo 01's loading spinner becomes a static circular border + the text "Loading..."; Demo 18's ticker becomes a static list; Demo 24's breathing animation freezes mid-cycle. <strong>Consideration 2: focus indicators.</strong> Animated elements that are also focusable (buttons in Demo 04, interactive cards in Demo 08) include a <code>:focus-visible</code> ring that's NOT affected by the animation — keyboard users see clear focus regardless of the animation state. <strong>Consideration 3: <code>aria-busy</code> and <code>aria-live</code>.</strong> Loading-state demos (01 spinner, 10 skeleton) include semantic markup so screen readers announce "Loading" rather than reading visual decoration. The 30 demos in this collection are MIT-licensed; copy them with the accessibility patterns intact — don't strip the <code>@media (prefers-reduced-motion)</code> blocks when you paste.
Which CSS keyframe animation should I use for my project?
Quick decision guide for all 30 demos. <strong>Loading states</strong>: Demo 01 (Loading Spinners — 6 variants), Demo 10 (Skeleton Shimmer) for content placeholders, Demo 13 (Liquid Fill Progress) for determinate progress. <strong>Text effects</strong>: Demo 02 (Typewriter) for hero intros, Demo 25 (Typewriter Delete Loop) for rotating taglines, Demo 11 (Glitch Text) for cyberpunk brand, Demo 28 (Kinetic Typography) for editorial. <strong>Buttons</strong>: Demo 04 (Pulse Glow) for primary CTAs, Demo 16 (Ripple Click) for Material feedback, Demo 22 (Spring Bounce) for playful success states. <strong>Cards</strong>: Demo 08 (3D Flip Card) for service/pricing flip, Demo 27 (Card Stack) for testimonial stack reveal. <strong>Backgrounds</strong>: Demo 05 (Morphing Blob) for hero ambient, Demo 26 (Aurora Borealis) for premium dark mode, Demo 30 (Gradient Mesh) for Stripe-style marketing, Demo 21 (Spotlight) for focus-on-content effect. <strong>Interactive feedback</strong>: Demo 06 (Particle Burst) for celebration moments, Demo 23 (Confetti) for completion / signup success. <strong>Decoration</strong>: Demo 03 (Bouncing Ball), Demo 07 (Wave), Demo 15 (Fire), Demo 17 (Floating Elements), Demo 12 (Solar System Orbit) for whimsical landing pages. <strong>UI states</strong>: Demo 14 (Stagger List) for menu reveals, Demo 29 (Morphing Progress Steps) for checkout flow, Demo 19 (Countdown Timer) for product launches, Demo 20 (Path Drawing) for logo reveal. <strong>Niche</strong>: Demo 09 (Neon Flicker) for arcade brand, Demo 18 (Infinite Ticker) for marquee/news strip, Demo 24 (Breathing) for meditation apps. All 30 are 100% pure CSS, GPU-accelerated, respect prefers-reduced-motion, MIT-licensed.

Related collections

15 CSS Background Animations preview

15 CSS Background Animations

15

15 hand-coded CSS background animations with live demos — infinite shifting gradient, floating particle bubbles, parallax starry night, clickable cyberpunk ripple, sliding geometric grid, SVG wave overlays, glassmorphism orbs, aurora borealis ribbons, matrix digital rain, mesh gradient blobs, falling snow, morphing blob, retro synthwave 3D grid, infinite scrolling diagonal marquee, comic-book halftone dots. 100% Pure CSS, no JavaScript, no canvas, no particles.js. prefers-reduced-motion respected, scoped class names, MIT-licensed.

css background animation animated gradient background css css floating particles Responsive
27 CSS Button Hover Effects preview

27 CSS Button Hover Effects

27

27 hand-coded CSS button hover effects — 3D press, neon glow, gradient slide, border draw, liquid fill, ripple, glitch text, and kinetic flips. Every demo is pure CSS (no JavaScript, no framework), tuned for 60fps with transform and opacity, and respects prefers-reduced-motion out of the box.

css buttons button hover button hover effects Responsive
33 CSS Card Hover Effects preview

33 CSS Card Hover Effects

33

33 hand-coded CSS card hover effects with live demos — multi-axis 3D tilt with parallax, glowing gradient glassmorphic border, image zoom with content slide-up, front-to-back 3D flip, sibling de-emphasis with :has(), minimalist elevation, plus 27 more (elastic lift, conic-gradient border, holographic foil, neon sign, glitch RGB split, magnetic float, blueprint reveal, aurora drift and more). 26 pure CSS + 7 with a small vanilla JS snippet for cursor tracking. prefers-reduced-motion respected, scoped class names, MIT-licensed.

css card hover effect css card hover animation card hover effect pure css Responsive

Search CodeFronts

Loading…