Hidden localstorage option to enable bouncy read receipts :p
This commit is contained in:
parent
23d45d7f33
commit
0dd85d9adf
2 changed files with 26 additions and 2 deletions
15
src/VelocityBounce.js
Normal file
15
src/VelocityBounce.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
var Velocity = require('velocity-animate');
|
||||
|
||||
// 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);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue