|
|
@ -6,39 +6,39 @@ Distributed under MIT License https://github.com/mattdesl/eases/blob/master/LICE
|
|
|
|
export { identity as linear } from './internal';
|
|
|
|
export { identity as linear } from './internal';
|
|
|
|
|
|
|
|
|
|
|
|
export function backInOut(t) {
|
|
|
|
export function backInOut(t) {
|
|
|
|
var s = 1.70158 * 1.525;
|
|
|
|
const s = 1.70158 * 1.525;
|
|
|
|
if ((t *= 2) < 1) return 0.5 * (t * t * ((s + 1) * t - s));
|
|
|
|
if ((t *= 2) < 1) return 0.5 * (t * t * ((s + 1) * t - s));
|
|
|
|
return 0.5 * ((t -= 2) * t * ((s + 1) * t + s) + 2);
|
|
|
|
return 0.5 * ((t -= 2) * t * ((s + 1) * t + s) + 2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export function backIn(t) {
|
|
|
|
export function backIn(t) {
|
|
|
|
var s = 1.70158;
|
|
|
|
const s = 1.70158;
|
|
|
|
return t * t * ((s + 1) * t - s);
|
|
|
|
return t * t * ((s + 1) * t - s);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export function backOut(t) {
|
|
|
|
export function backOut(t) {
|
|
|
|
var s = 1.70158;
|
|
|
|
const s = 1.70158;
|
|
|
|
return --t * t * ((s + 1) * t + s) + 1;
|
|
|
|
return --t * t * ((s + 1) * t + s) + 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export function bounceOut(t) {
|
|
|
|
export function bounceOut(t) {
|
|
|
|
var a = 4.0 / 11.0;
|
|
|
|
const a = 4.0 / 11.0;
|
|
|
|
var b = 8.0 / 11.0;
|
|
|
|
const b = 8.0 / 11.0;
|
|
|
|
var c = 9.0 / 10.0;
|
|
|
|
const c = 9.0 / 10.0;
|
|
|
|
|
|
|
|
|
|
|
|
var ca = 4356.0 / 361.0;
|
|
|
|
const ca = 4356.0 / 361.0;
|
|
|
|
var cb = 35442.0 / 1805.0;
|
|
|
|
const cb = 35442.0 / 1805.0;
|
|
|
|
var cc = 16061.0 / 1805.0;
|
|
|
|
const cc = 16061.0 / 1805.0;
|
|
|
|
|
|
|
|
|
|
|
|
var t2 = t * t;
|
|
|
|
const t2 = t * t;
|
|
|
|
|
|
|
|
|
|
|
|
return t < a
|
|
|
|
return t < a
|
|
|
|
? 7.5625 * t2
|
|
|
|
? 7.5625 * t2
|
|
|
|
: t < b
|
|
|
|
: t < b
|
|
|
|
? 9.075 * t2 - 9.9 * t + 3.4
|
|
|
|
? 9.075 * t2 - 9.9 * t + 3.4
|
|
|
|
: t < c
|
|
|
|
: t < c
|
|
|
|
? ca * t2 - cb * t + cc
|
|
|
|
? ca * t2 - cb * t + cc
|
|
|
|
: 10.8 * t * t - 20.52 * t + 10.72;
|
|
|
|
: 10.8 * t * t - 20.52 * t + 10.72;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export function bounceInOut(t) {
|
|
|
|
export function bounceInOut(t) {
|
|
|
@ -73,7 +73,7 @@ export function cubicIn(t) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export function cubicOut(t) {
|
|
|
|
export function cubicOut(t) {
|
|
|
|
var f = t - 1.0;
|
|
|
|
const f = t - 1.0;
|
|
|
|
return f * f * f + 1.0;
|
|
|
|
return f * f * f + 1.0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -102,8 +102,8 @@ export function expoInOut(t) {
|
|
|
|
return t === 0.0 || t === 1.0
|
|
|
|
return t === 0.0 || t === 1.0
|
|
|
|
? t
|
|
|
|
? t
|
|
|
|
: t < 0.5
|
|
|
|
: t < 0.5
|
|
|
|
? +0.5 * Math.pow(2.0, 20.0 * t - 10.0)
|
|
|
|
? +0.5 * Math.pow(2.0, 20.0 * t - 10.0)
|
|
|
|
: -0.5 * Math.pow(2.0, 10.0 - t * 20.0) + 1.0;
|
|
|
|
: -0.5 * Math.pow(2.0, 10.0 - t * 20.0) + 1.0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export function expoIn(t) {
|
|
|
|
export function expoIn(t) {
|
|
|
@ -161,7 +161,7 @@ export function sineInOut(t) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export function sineIn(t) {
|
|
|
|
export function sineIn(t) {
|
|
|
|
var v = Math.cos(t * Math.PI * 0.5);
|
|
|
|
const v = Math.cos(t * Math.PI * 0.5);
|
|
|
|
if (Math.abs(v) < 1e-14) return 1;
|
|
|
|
if (Math.abs(v) < 1e-14) return 1;
|
|
|
|
else return 1 - v;
|
|
|
|
else return 1 - v;
|
|
|
|
}
|
|
|
|
}
|
|
|
|