diff --git a/compiled/radium.js b/compiled/radium.js index 83c2372..8e98a37 100644 --- a/compiled/radium.js +++ b/compiled/radium.js @@ -691,6 +691,9 @@ this.invert_repeat = invert_repeat; this.next = next; this.params = params; + this.cubicInOut = __bind(this.cubicInOut, this); + this.cubicOut = __bind(this.cubicOut, this); + this.cubicIn = __bind(this.cubicIn, this); this.circInOut = __bind(this.circInOut, this); this.circOut = __bind(this.circOut, this); this.circIn = __bind(this.circIn, this); @@ -835,6 +838,26 @@ } }; + Ease.prototype.cubicIn = function(time) { + time = time / this.duration; + return this.change * time * time * time + this.start; + }; + + Ease.prototype.cubicOut = function(time) { + time = time / this.duration - 1; + return this.change * (time * time * time + 1) + this.start; + }; + + Ease.prototype.cubicInOut = function(time) { + time = time / (duration / 2); + if (time < 1) { + return change / 2 * time * time * time + this.start; + } else { + time = time - 2; + return change / 2 * (time * time * time + 2) + begin; + } + }; + return Ease; })(); diff --git a/radium/engine.ease.coffee b/radium/engine.ease.coffee index 1b991dc..63a0f4e 100644 --- a/radium/engine.ease.coffee +++ b/radium/engine.ease.coffee @@ -197,3 +197,19 @@ class Ease else time = time - 2 return @change / 2 * (Math.sqrt(1 - time * time) + 1) + @start + + cubicIn: (time) => + time = time / @duration + return @change * time * time * time + @start + + cubicOut: (time) => + time = time / @duration - 1 + return @change * (time * time * time + 1) + @start + + cubicInOut: (time) => + time = time / (duration / 2) + if time < 1 + return change / 2 * time * time * time + @start + else + time = time - 2 + return change / 2 * (time * time * time + 2) + begin