diff --git a/compiled/radium.js b/compiled/radium.js index bf3a373..722971b 100644 --- a/compiled/radium.js +++ b/compiled/radium.js @@ -690,6 +690,9 @@ this.invert_repeat = invert_repeat; this.next = next; this.params = params; + this.expoInOut = __bind(this.expoInOut, this); + this.expoOut = __bind(this.expoOut, this); + this.expoIn = __bind(this.expoIn, this); this.elasticInOut = __bind(this.elasticInOut, this); this.elasticIn = __bind(this.elasticIn, this); this.elasticOut = __bind(this.elasticOut, this); @@ -891,6 +894,23 @@ } }; + Ease.prototype.expoIn = function(time) { + return this.change * Math.pow(2, 10 * (time / this.duration - 1)) + this.start; + }; + + Ease.prototype.expoOut = function(time) { + return this.change * (-Math.pow(2, -10 * time / this.duration) + 1) + this.start; + }; + + Ease.prototype.expoInOut = function(time) { + time = time / (this.duration / 2); + if (time < 1) { + return this.change / 2 * Math.pow(2, 10 * (time - 1)) + this.start; + } else { + return this.change / 2 * (-Math.pow(2, -10 * (time - 1)) + 2) + this.start; + } + }; + return Ease; })(); diff --git a/radium/engine.ease.coffee b/radium/engine.ease.coffee index 44168bd..e95224f 100644 --- a/radium/engine.ease.coffee +++ b/radium/engine.ease.coffee @@ -239,3 +239,18 @@ class Ease return -0.5 * (amplitude * Math.pow(2, -10 * time)) * Math.sin((time * @duration - overshoot) * ((2 * Math.PI) / period)) + @start else return amplitude * Math.pow(2, -10 * time) * Math.sin((time * @duration - overshoot) * (2 * Math.PI) / period) + @change + @start + + expoIn: (time) => + return @change * Math.pow(2, 10 * (time / @duration - 1)) + @start + + expoOut: (time) => + return @change * (-Math.pow(2, -10 * time / @duration) + 1) + @start + + expoInOut: (time) => + time = time / (@duration / 2) + + if time < 1 + return @change / 2 * Math.pow(2, 10 * (time - 1)) + @start + else + return @change / 2 * (-Math.pow(2, -10 * (time - 1)) + 2) + @start +