diff --git a/compiled/radium.js b/compiled/radium.js index 078030d..7a8808b 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.quadInOut = __bind(this.quadInOut, this); + this.quadOut = __bind(this.quadOut, this); + this.quadIn = __bind(this.quadIn, this); this.linearNone = __bind(this.linearNone, this); this.expoInOut = __bind(this.expoInOut, this); this.expoOut = __bind(this.expoOut, this); @@ -916,6 +919,26 @@ return this.change * time / this.duration + this.start; }; + Ease.prototype.quadIn = function(time) { + time = time / this.duration; + return this.change * time * time + this.start; + }; + + Ease.prototype.quadOut = function(time) { + time = time / this.duration; + return -this.change * time * (time - 2) + this.start; + }; + + Ease.prototype.quadInOut = function(time) { + time = time / (this.duration / 2); + if (time < 1) { + return this.change / 2 * time * time + this.start; + } else { + time = time - 1; + return -this.change / 2 * (time * (time - 2) - 1) + this.start; + } + }; + return Ease; })(); diff --git a/radium/engine.ease.coffee b/radium/engine.ease.coffee index fb882eb..a9a9a7c 100644 --- a/radium/engine.ease.coffee +++ b/radium/engine.ease.coffee @@ -257,3 +257,19 @@ class Ease linearNone: (time) => return @change * time / @duration + @start + quadIn: (time) => + time = time / @duration + return @change * time * time + @start + + quadOut: (time) => + time = time / @duration + return -@change * time * (time - 2) + @start + + quadInOut: (time) => + time = time / (@duration / 2) + + if time < 1 + return @change / 2 * time * time + @start + else + time = time - 1 + return -@change / 2 * (time * (time - 2) - 1) + @start