vaweGitHub

Easingvawe After Effects eases

swap

A snappy swap: the value waits at each key and the change happens in the middle.

swap reaches 50% of its travel at 50% of the time and 90% at 68%. Its peak speed is 4x the average.

vawe After Effects easespeak 4x

Progress against time0100.51progress50%90%
The dashed line is linear. The dots mark 50% and 90% of the travel.
Velocity, in multiples of average speed01400.51speed, x average
The dashed line is 1x, the speed of linear.

Live demo

The blue box uses the exact linear() string below, in your browser. The grey box is linear.

swap
linear

Your system asks for reduced motion, so the boxes rest at the end of the move.

Rendered with the vawe renderer: a 2 s film, swap against linear. It plays while on screen.

Numbers

50% of travel
50%of the time
90% of travel
68%of the time
After 10% of time
0.67%of the travel is done
Peak speed
4xtimes the average
Overshoot
0%stays inside the end
Undershoot
0%never below the start
linear() points
81at a 0.002 tolerance
cubic-bezier
exactbuilt from two handles

Copy the code

css linear() (exact)
animation-timing-function: linear(0, 0.0001, 0.0004, 0.0009, 0.0016, 0.0025, 0.0037, 0.0051, 0.0067, 0.0087, 0.0109, 0.0135, 0.0163, 0.0196, 0.0232, 0.0272, 0.0316, 0.0364, 0.0418, 0.0477, 0.0542, 0.0613, 0.0691, 0.0777, 0.087, 0.0973, 0.1087, 0.1211, 0.1349, 0.1501, 0.167, 0.1858, 0.2069, 0.2305, 0.2572, 0.2873, 0.3215, 0.3601, 0.4033, 0.4504, 0.5, 0.5496, 0.5967, 0.6399, 0.6785, 0.7127, 0.7428, 0.7695, 0.7931, 0.8142, 0.833, 0.8499, 0.8651, 0.8789, 0.8913, 0.9027, 0.913, 0.9223, 0.9309, 0.9387, 0.9458, 0.9523, 0.9582, 0.9636, 0.9684, 0.9728, 0.9768, 0.9804, 0.9837, 0.9865, 0.9891, 0.9913, 0.9933, 0.9949, 0.9963, 0.9975, 0.9984, 0.9991, 0.9996, 0.9999, 1);
cubic-bezier (exact)
animation-timing-function: cubic-bezier(0.75, 0, 0.25, 1);

This ease is a cubic bezier by construction: the two After Effects handles are its two control points. The site ships the linear() string above because it is what the renderer and EASE.swap use.

web animations api
el.animate({ translate: ['0 0', '240px 0'] }, { duration: 600, easing: 'linear(0, 0.0001, 0.0004, 0.0009, 0.0016, 0.0025, 0.0037, 0.0051, 0.0067, 0.0087, 0.0109, 0.0135, 0.0163, 0.0196, 0.0232, 0.0272, 0.0316, 0.0364, 0.0418, 0.0477, 0.0542, 0.0613, 0.0691, 0.0777, 0.087, 0.0973, 0.1087, 0.1211, 0.1349, 0.1501, 0.167, 0.1858, 0.2069, 0.2305, 0.2572, 0.2873, 0.3215, 0.3601, 0.4033, 0.4504, 0.5, 0.5496, 0.5967, 0.6399, 0.6785, 0.7127, 0.7428, 0.7695, 0.7931, 0.8142, 0.833, 0.8499, 0.8651, 0.8789, 0.8913, 0.9027, 0.913, 0.9223, 0.9309, 0.9387, 0.9458, 0.9523, 0.9582, 0.9636, 0.9684, 0.9728, 0.9768, 0.9804, 0.9837, 0.9865, 0.9891, 0.9913, 0.9933, 0.9949, 0.9963, 0.9975, 0.9984, 0.9991, 0.9996, 0.9999, 1)', fill: 'both' });
vawe
import { EASE } from '../../core/motion/presets.js';

el.animate(
  [{ translate: '0 4vh', opacity: 0 }, { translate: '0 0', opacity: 1 }],
  { duration: 500, easing: EASE.swap, fill: 'both' },
);

// per-frame code (window.seek, vawe.onFrame): easeFn('swap')(u)

After Effects handles

One segment between two keys has two handles. In After Effects, open Keyframe Velocity on each key: the outgoing handle belongs to the first key and the incoming handle to the second. Influence is how far along the segment the handle reaches, in per cent of its duration. Speed is the pace at the key as a multiple of the segment's average (0 stops dead, 1 is straight).

HandleNameInfluenceSpeedReal handles near it
out (first key)hang75%0x9.82%
in (second key)hang75%0x9.82%

Measured on 1,339 real segments (2,678 handles) from Lottie files and 27 from HyperFrames blocks. Near means influence within 10 points and speed within 0.3 (25% above 1x). Both handles together: 86 segments (6.42%), 4.38% of the 616 entrances and 7.02% of the 57 exits.

vawe: key table
import { keys } from '../../core/motion/presets.js';

// out handle on the first key, in handle on the second
keys(el, 'translate', [
  [0, '0 6vh', { out: 'hang' }],
  [0.6, '0 0', { in: 'hang' }],
]);

When to use it, and when to avoid it

Use it for

  • Replacing one thing with another: a label, a number, a tab, a crop.
  • Camera cuts on the move, where you want a crisp hit and a hold on both sides.

Avoid it for

  • Long travel. The middle is steep, so a big distance becomes a blur.
  • Slow, floating motion. It is the opposite of a drift.

Moves that use swap

8 of the library's motion moves set EASE.swap in their snippet.