2019-04-17 15:58:15 +02:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
|
|
value: true
|
|
|
|
});
|
|
|
|
// linear
|
|
|
|
var linear = exports.linear = function linear(t) {
|
|
|
|
return t;
|
|
|
|
};
|
|
|
|
// accelerating from zero velocity
|
|
|
|
var easeInQuad = exports.easeInQuad = function easeInQuad(t) {
|
|
|
|
return t * t;
|
|
|
|
};
|
|
|
|
// decelerating to zero velocity
|
|
|
|
var easeOutQuad = exports.easeOutQuad = function easeOutQuad(t) {
|
|
|
|
return t * (2 - t);
|
|
|
|
};
|
|
|
|
// acceleration until halfway, then deceleration
|
|
|
|
var easeInOutQuad = exports.easeInOutQuad = function easeInOutQuad(t) {
|
|
|
|
return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;
|
|
|
|
};
|
|
|
|
// accelerating from zero velocity
|
|
|
|
var easeInCubic = exports.easeInCubic = function easeInCubic(t) {
|
|
|
|
return t * t * t;
|
|
|
|
};
|
|
|
|
// decelerating to zero velocity
|
|
|
|
var easeOutCubic = exports.easeOutCubic = function easeOutCubic(t) {
|
|
|
|
return --t * t * t + 1;
|
|
|
|
};
|
|
|
|
// acceleration until halfway, then deceleration
|
|
|
|
var easeInOutCubic = exports.easeInOutCubic = function easeInOutCubic(t) {
|
|
|
|
return t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;
|
|
|
|
};
|
|
|
|
// accelerating from zero velocity
|
|
|
|
var easeInQuart = exports.easeInQuart = function easeInQuart(t) {
|
|
|
|
return t * t * t * t;
|
|
|
|
};
|
|
|
|
// decelerating to zero velocity
|
|
|
|
var easeOutQuart = exports.easeOutQuart = function easeOutQuart(t) {
|
|
|
|
return 1 - --t * t * t * t;
|
|
|
|
};
|
|
|
|
// acceleration until halfway, then deceleration
|
|
|
|
var easeInOutQuart = exports.easeInOutQuart = function easeInOutQuart(t) {
|
|
|
|
return t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t;
|
|
|
|
};
|
|
|
|
// accelerating from zero velocity
|
|
|
|
var easeInQuint = exports.easeInQuint = function easeInQuint(t) {
|
|
|
|
return t * t * t * t * t;
|
|
|
|
};
|
|
|
|
// decelerating to zero velocity
|
|
|
|
var easeOutQuint = exports.easeOutQuint = function easeOutQuint(t) {
|
|
|
|
return 1 + --t * t * t * t * t;
|
|
|
|
};
|
|
|
|
// acceleration until halfway, then deceleration
|
|
|
|
var easeInOutQuint = exports.easeInOutQuint = function easeInOutQuint(t) {
|
|
|
|
return t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t;
|
|
|
|
};
|
2019-06-04 14:29:48 +02:00
|
|
|
//# sourceMappingURL=easing-patterns.js.map
|