-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Related #13.
- Loading branch information
Showing
22 changed files
with
693 additions
and
713 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,37 @@ | ||
var overshoot = 1.70158; | ||
|
||
export var backIn = (function backIn(s) { | ||
return s = +s, { | ||
overshoot: backIn, | ||
ease: function(t) { | ||
return t * t * ((s + 1) * t - s); | ||
} | ||
}; | ||
export var backIn = (function custom(s) { | ||
s = +s; | ||
|
||
function backIn(t) { | ||
return t * t * ((s + 1) * t - s); | ||
} | ||
|
||
backIn.overshoot = custom; | ||
|
||
return backIn; | ||
})(overshoot); | ||
|
||
export var backOut = (function backOut(s) { | ||
return s = +s, { | ||
overshoot: backOut, | ||
ease: function(t) { | ||
return --t * t * ((s + 1) * t + s) + 1; | ||
} | ||
}; | ||
export var backOut = (function custom(s) { | ||
s = +s; | ||
|
||
function backOut(t) { | ||
return --t * t * ((s + 1) * t + s) + 1; | ||
} | ||
|
||
backOut.overshoot = custom; | ||
|
||
return backOut; | ||
})(overshoot); | ||
|
||
export var backInOut = (function backInOut(s) { | ||
return s = +s, { | ||
overshoot: backInOut, | ||
ease: function(t) { | ||
return ((t *= 2) < 1 ? t * t * ((s + 1) * t - s) : (t -= 2) * t * ((s + 1) * t + s) + 2) / 2; | ||
} | ||
}; | ||
export var backInOut = (function custom(s) { | ||
s = +s; | ||
|
||
function backInOut(t) { | ||
return ((t *= 2) < 1 ? t * t * ((s + 1) * t - s) : (t -= 2) * t * ((s + 1) * t + s) + 2) / 2; | ||
} | ||
|
||
backInOut.overshoot = custom; | ||
|
||
return backInOut; | ||
})(overshoot); |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,11 @@ | ||
export var circleIn = { | ||
ease: function(t) { | ||
return 1 - Math.sqrt(1 - t * t); | ||
} | ||
}; | ||
export function circleIn(t) { | ||
return 1 - Math.sqrt(1 - t * t); | ||
} | ||
|
||
export var circleOut = { | ||
ease: function(t) { | ||
return Math.sqrt(1 - --t * t); | ||
} | ||
}; | ||
export function circleOut(t) { | ||
return Math.sqrt(1 - --t * t); | ||
} | ||
|
||
export var circleInOut = { | ||
ease: function(t) { | ||
return ((t *= 2) <= 1 ? 1 - Math.sqrt(1 - t * t) : Math.sqrt(1 - (t -= 2) * t) + 1) / 2; | ||
} | ||
}; | ||
export function circleInOut(t) { | ||
return ((t *= 2) <= 1 ? 1 - Math.sqrt(1 - t * t) : Math.sqrt(1 - (t -= 2) * t) + 1) / 2; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,11 @@ | ||
export var cubicIn = { | ||
ease: function(t) { | ||
return t * t * t; | ||
} | ||
}; | ||
export function cubicIn(t) { | ||
return t * t * t; | ||
} | ||
|
||
export var cubicOut = { | ||
ease: function(t) { | ||
return --t * t * t + 1; | ||
} | ||
}; | ||
export function cubicOut(t) { | ||
return --t * t * t + 1; | ||
} | ||
|
||
export var cubicInOut = { | ||
ease: function(t) { | ||
return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; | ||
} | ||
}; | ||
export function cubicInOut(t) { | ||
return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,11 @@ | ||
export var expIn = { | ||
ease: function(t) { | ||
return Math.pow(2, 10 * t - 10); | ||
} | ||
}; | ||
export function expIn(t) { | ||
return Math.pow(2, 10 * t - 10); | ||
} | ||
|
||
export var expOut = { | ||
ease: function(t) { | ||
return 1 - Math.pow(2, -10 * t); | ||
} | ||
}; | ||
export function expOut(t) { | ||
return 1 - Math.pow(2, -10 * t); | ||
} | ||
|
||
export var expInOut = { | ||
ease: function(t) { | ||
return ((t *= 2) <= 1 ? Math.pow(2, 10 * t - 10) : 2 - Math.pow(2, 10 - 10 * t)) / 2; | ||
} | ||
}; | ||
export function expInOut(t) { | ||
return ((t *= 2) <= 1 ? Math.pow(2, 10 * t - 10) : 2 - Math.pow(2, 10 - 10 * t)) / 2; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
export var linear = { | ||
ease: function(t) { | ||
return +t; | ||
} | ||
}; | ||
export function linear(t) { | ||
return +t; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,37 @@ | ||
var exponent = 3; | ||
|
||
export var polyIn = (function polyIn(e) { | ||
return e = +e, { | ||
exponent: polyIn, | ||
ease: function(t) { | ||
return Math.pow(t, e); | ||
} | ||
}; | ||
export var polyIn = (function custom(e) { | ||
e = +e; | ||
|
||
function polyIn(t) { | ||
return Math.pow(t, e); | ||
} | ||
|
||
polyIn.exponent = custom; | ||
|
||
return polyIn; | ||
})(exponent); | ||
|
||
export var polyOut = (function polyOut(e) { | ||
return e = +e, { | ||
exponent: polyOut, | ||
ease: function(t) { | ||
return 1 - Math.pow(1 - t, e); | ||
} | ||
}; | ||
export var polyOut = (function custom(e) { | ||
e = +e; | ||
|
||
function polyOut(t) { | ||
return 1 - Math.pow(1 - t, e); | ||
} | ||
|
||
polyOut.exponent = custom; | ||
|
||
return polyOut; | ||
})(exponent); | ||
|
||
export var polyInOut = (function polyInOut(e) { | ||
return e = +e, { | ||
exponent: polyInOut, | ||
ease: function(t) { | ||
return ((t *= 2) <= 1 ? Math.pow(t, e) : 2 - Math.pow(2 - t, e)) / 2; | ||
} | ||
}; | ||
export var polyInOut = (function custom(e) { | ||
e = +e; | ||
|
||
function polyInOut(t) { | ||
return ((t *= 2) <= 1 ? Math.pow(t, e) : 2 - Math.pow(2 - t, e)) / 2; | ||
} | ||
|
||
polyInOut.exponent = custom; | ||
|
||
return polyInOut; | ||
})(exponent); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,11 @@ | ||
export var quadIn = { | ||
ease: function(t) { | ||
return t * t; | ||
} | ||
}; | ||
export function quadIn(t) { | ||
return t * t; | ||
} | ||
|
||
export var quadOut = { | ||
ease: function(t) { | ||
return t * (2 - t); | ||
} | ||
}; | ||
export function quadOut(t) { | ||
return t * (2 - t); | ||
} | ||
|
||
export var quadInOut = { | ||
ease: function(t) { | ||
return ((t *= 2) <= 1 ? t * t : --t * (2 - t) + 1) / 2; | ||
} | ||
}; | ||
export function quadInOut(t) { | ||
return ((t *= 2) <= 1 ? t * t : --t * (2 - t) + 1) / 2; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,14 @@ | ||
var pi = Math.PI, | ||
halfPi = pi / 2; | ||
|
||
export var sinIn = { | ||
ease: function(t) { | ||
return 1 - Math.cos(t * halfPi); | ||
} | ||
}; | ||
export function sinIn(t) { | ||
return 1 - Math.cos(t * halfPi); | ||
} | ||
|
||
export var sinOut = { | ||
ease: function(t) { | ||
return Math.sin(t * halfPi); | ||
} | ||
}; | ||
export function sinOut(t) { | ||
return Math.sin(t * halfPi); | ||
} | ||
|
||
export var sinInOut = { | ||
ease: function(t) { | ||
return (1 - Math.cos(pi * t)) / 2; | ||
} | ||
}; | ||
export function sinInOut(t) { | ||
return (1 - Math.cos(pi * t)) / 2; | ||
} |
Oops, something went wrong.