Created
June 21, 2019 14:21
-
-
Save pketh/c77e4f056374e13705bd07ad05f24ba0 to your computer and use it in GitHub Desktop.
easings js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
easing (percentComplete, elaspedTime) { | |
const duration = lockingDuration | |
const startValue = 0 | |
const endValue = 1 | |
// https://stackoverflow.com/questions/8316882/what-is-an-easing-function | |
// x percentComplete, | |
// t elaspedTime, | |
// b startValue, | |
// c endValue, | |
// d duration | |
// quadratic ease in | |
// return endValue * (elaspedTime/=duration)*elaspedTime + startValue | |
// ease out | |
return -endValue * (elaspedTime /= duration) * (elaspedTime - 2) + startValue | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment