MCPcopy
hub / github.com/julianshapiro/velocity / registerElasticIn

Function registerElasticIn

velocity.js:3550–3560  ·  view source on GitHub ↗
(name, amplitude, period)

Source from the content-addressed store, hash-verified

3548 // Constants
3549 var PI2 = Math.PI * 2;
3550 function registerElasticIn(name, amplitude, period) {
3551 registerEasing([name, function (percentComplete, startValue, endValue) {
3552 if (percentComplete === 0) {
3553 return startValue;
3554 }
3555 if (percentComplete === 1) {
3556 return endValue;
3557 }
3558 return -(amplitude * Math.pow(2, 10 * (percentComplete -= 1)) * Math.sin((percentComplete - period / PI2 * Math.asin(1 / amplitude)) * PI2 / period)) * (endValue - startValue);
3559 }]);
3560 }
3561 function registerElasticOut(name, amplitude, period) {
3562 registerEasing([name, function (percentComplete, startValue, endValue) {
3563 if (percentComplete === 0) {

Callers 1

velocity.jsFile · 0.70

Calls 1

registerEasingFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…