added easeOutElastic function

thanks to @joshmarinacci’s excellent blog post:
http://www.joshondesign.com/2013/03/01/improvedEasingEquations
pull/29/head
jmoenig 2016-12-12 14:28:33 +01:00
rodzic 97bf879a04
commit 662a59b49c
2 zmienionych plików z 11 dodań i 2 usunięć

Wyświetl plik

@ -3186,7 +3186,8 @@ http://snap.berkeley.edu/run#cloud:Username=jens&ProjectName=rotation
161212
------
* fixed #1560
* Morphic: added a few in-/out- only easing functions for animations
* Morphic: added a few in-/out- only easing functions for animations
* Morphic: added easeOutElastic function thanks to @joshmarinaccis excellent blog post
== v4.10 === (in development)

Wyświetl plik

@ -1838,7 +1838,15 @@ Animation.prototype.easings = {
// ease out only:
sine_out: function (t) {return Math.sin(radians(t * 90)); },
quad_out: function (t) {return t * (2 - t); }
quad_out: function (t) {return t * (2 - t); },
elastic_out: function (t) { // this one's fun!
// thanks to Josh Marinacci's blog:
// http://www.joshondesign.com/2013/03/01/improvedEasingEquations
var p = 0.3;
return Math.pow(2, -10 * t) * Math.sin(
(t - p / 4) * (2 * Math.PI) / p
) + 1;
}
};
Animation.prototype.start = function () {