mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-18 06:35:35 +08:00
aca0e060a4
Because it needs a versiob where the package name is actually updated and the requires need to use the right package name
16 lines
487 B
JavaScript
16 lines
487 B
JavaScript
var Velocity = require('velocity-vector');
|
|
|
|
// courtesy of https://github.com/julianshapiro/velocity/issues/283
|
|
// We only use easeOutBounce (easeInBounce is just sort of nonsensical)
|
|
function bounce( p ) {
|
|
var pow2,
|
|
bounce = 4;
|
|
|
|
while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {}
|
|
return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 );
|
|
}
|
|
|
|
Velocity.Easings.easeOutBounce = function(p) {
|
|
return 1 - bounce(1 - p);
|
|
}
|