mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-01-30 16:31:52 +01:00
config redirect
This commit is contained in:
46
node_modules/d3-ease/src/elastic.js
generated
vendored
Normal file
46
node_modules/d3-ease/src/elastic.js
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
import {tpmt} from "./math.js";
|
||||
|
||||
var tau = 2 * Math.PI,
|
||||
amplitude = 1,
|
||||
period = 0.3;
|
||||
|
||||
export var elasticIn = (function custom(a, p) {
|
||||
var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);
|
||||
|
||||
function elasticIn(t) {
|
||||
return a * tpmt(-(--t)) * Math.sin((s - t) / p);
|
||||
}
|
||||
|
||||
elasticIn.amplitude = function(a) { return custom(a, p * tau); };
|
||||
elasticIn.period = function(p) { return custom(a, p); };
|
||||
|
||||
return elasticIn;
|
||||
})(amplitude, period);
|
||||
|
||||
export var elasticOut = (function custom(a, p) {
|
||||
var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);
|
||||
|
||||
function elasticOut(t) {
|
||||
return 1 - a * tpmt(t = +t) * Math.sin((t + s) / p);
|
||||
}
|
||||
|
||||
elasticOut.amplitude = function(a) { return custom(a, p * tau); };
|
||||
elasticOut.period = function(p) { return custom(a, p); };
|
||||
|
||||
return elasticOut;
|
||||
})(amplitude, period);
|
||||
|
||||
export var elasticInOut = (function custom(a, p) {
|
||||
var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);
|
||||
|
||||
function elasticInOut(t) {
|
||||
return ((t = t * 2 - 1) < 0
|
||||
? a * tpmt(-t) * Math.sin((s - t) / p)
|
||||
: 2 - a * tpmt(t) * Math.sin((s + t) / p)) / 2;
|
||||
}
|
||||
|
||||
elasticInOut.amplitude = function(a) { return custom(a, p * tau); };
|
||||
elasticInOut.period = function(p) { return custom(a, p); };
|
||||
|
||||
return elasticInOut;
|
||||
})(amplitude, period);
|
||||
Reference in New Issue
Block a user