vaweGitHub

Easingvawe After Effects eases

swap

A swap: the value waits at each key and changes 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.

Move

Demo

Progress against time, with the playhead0100.51progress50%90%Speed against time, in multiples of average speed01400.51speed, x average
Dashed: linear, and 1× speed. The dot and the line move with the object below.
Spacing: 24 equal steps of time
swap
linear
Bunched shapes are slow. Wide gaps are fast. Past the right line means overshoot.
swap
linear

Your system asks for reduced motion, so nothing plays. The charts above show the whole move.

Four interface motions with this ease
Card enters
Modal scales in
Toast drops
Menu slides
2 s film from the vawe renderer: swap against linear.

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);

Exact: the two After Effects handles are the two control points. EASE.swap uses the linear() string above.

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)

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

After Effects handles

Set these in After Effects under Keyframe Velocity: the outgoing handle on the first key, the incoming handle on 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 Lottie segments (2,678 handles) and 27 HyperFrames segments. Near means influence within 10 points and speed within 0.3. 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' }],
]);

Use and avoid

Use for

  • The value change: a label, a number, a tab, a crop, in 0.15 to 0.4 s.
  • Camera cuts on the move, where you want a crisp hit and a hold on both sides.

Avoid for

  • Scan or wipe travel, and any long distance. The middle is steep, so the line becomes a blur. Use settle.
  • Slow, floating motion. It is the opposite of a drift.
Jobs for swap, from the job table
JobDuration
Value change (number swap)0.15 s out, 0.26 s in

Video components that use swap

11 video components set EASE.swap. The first four play here.

More easing