Skip to main content

JavaScript animation example

JavaScript Success Animation: Checkmark With Confetti

Success states deserve a moment of celebration. This one plays in four beats: the outline of a circle draws around, it fills with a quick pop, a checkmark strokes across it, and confetti falls behind the message. Each beat is short enough that the whole thing finishes in about a second and a half.

  • 4.4 KB file
  • 5 live inputs
  • JavaScript runtime
Live, try it

How this success checkmark works

  • The four beats are one timeline with overlapping starts, so it reads as one motion.
  • Confetti spawns at the fill moment with random color, spin and drift, and fades as it falls.
  • Click to replay; "done" fires when the checkmark completes.

Add it to your JavaScript app

Install exodeui-vanilla, download the file below, and paste this. The code updates as you customize. Other runtimes are in the other tabs.

import { ExodeUICanvas } from 'exodeui-vanilla';

// <canvas id="javascript-success-animation" style="width: 100%; height: 480px"></canvas>
const player = new ExodeUICanvas({
  element: '#javascript-success-animation',
  fit: 'Layout',
  onReady: (engine) => { },
  onTrigger: (name) => {
    // fires: 'done'
  },
});
player.load(await (await fetch('/javascript-success-animation.exode')).json());
player.play();

Inputs

InputTypeDefaultRange
titleTextPayment received—
subTextA receipt is on its way to your inbox—
accentText#16a34ahex colour
inkText#14532dhex colour
bgText#f0fdf4hex colour

Events: done

More JavaScript animations

The same idea in other frameworks: SwiftUI symbol effects