Skip to main content

JavaScript animation example

JavaScript Page Transition: Curtain Wipe Between Pages

A curtain wipe hides the moment a page changes, which is useful when the next page needs a beat to load. Four panels sweep in from the bottom one after another, the new page is swapped in while the screen is covered, and the panels continue upward to reveal it. The page title rides on the last panel.

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

How this curtain wipe transition works

  • Each panel's position is the same eased curve offset in time, which gives the stagger.
  • The content swaps at the moment all panels cover the screen, so the change is never visible.
  • Click a nav link to run it; "navigate" fires when the swap happens.

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-page-transition" style="width: 100%; height: 540px"></canvas>
const player = new ExodeUICanvas({
  element: '#javascript-page-transition',
  fit: 'Layout',
  onReady: (engine) => { },
  onTrigger: (name) => {
    // fires: 'navigate'
  },
});
player.load(await (await fetch('/javascript-page-transition.exode')).json());
player.play();

Inputs

InputTypeDefaultRange
pagesTextHome,Work,About,Contact—
durationNumber1.10.5 – 2.5
accentText#4f46e5hex colour
inkText#111827hex colour
bgText#fafaf9hex colour

Events: navigate

More JavaScript animations

The same idea in other frameworks: React shared element transition · Flutter hero product transition · Vue slide and fade route transition