Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions src/easing.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,13 @@ export function easeInElastic( t, magnitude = 0.7 ) {

// Fast acceleration, bounces to zero
export function easeOutElastic( t, magnitude = 0.7 ) {

const p = 1 - magnitude;
const scaledTime = t * 2;


if( t === 0 || t === 1 ) {
return t;
}

const p = 1 - magnitude;
const scaledTime = t * 2;

const s = p / ( 2 * Math.PI ) * Math.asin( 1 );
return (
Expand All @@ -236,12 +236,11 @@ export function easeOutElastic( t, magnitude = 0.7 ) {
// Slow start and end, two bounces sandwich a fast motion
export function easeInOutElastic( t, magnitude = 0.65 ) {

const p = 1 - magnitude;

if( t === 0 || t === 1 ) {
return t;
}

const p = 1 - magnitude;
const scaledTime = t * 2;
const scaledTime1 = scaledTime - 1;

Expand Down