Skip to content

Instantly share code, notes, and snippets.

@monsieuroeuf
monsieuroeuf / E&W with no keyframes.js
Last active April 24, 2023 11:54
An example of using an Ease and Wizz equation in an expression, without relying on keyframes.
function easeandwizz_inOutExpo(t, b, c, d) {
if (t==0) return b;
if (t==d) return b+c;
if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
}
moveDuration = 2;
moveStart = inPoint;
moveEnd = moveStart+moveDuration;