Skip to content

Instantly share code, notes, and snippets.

@ryanbru0803
Last active February 26, 2020 08:46
Show Gist options
  • Save ryanbru0803/7e0d576a666daeacc01ce21c29742ba2 to your computer and use it in GitHub Desktop.
Save ryanbru0803/7e0d576a666daeacc01ce21c29742ba2 to your computer and use it in GitHub Desktop.
The squash and stretch expression should make your animation a bit more alive by adding a proportional squash and stretch scale to your shapes or images.
maxDev = 13; // max deviation in pixels
spd = 30; //speed of oscillation
decay = 1.0; //how fast it slows down
t = time - inPoint;
x = scale[0] + maxDev*Math.sin(spd*t)/Math.exp(decay*t);
y = scale[0]*scale[1]/x;
[x,y]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment