@superherocheesecake/ease
v1.1.6
Published
Custom easings
Downloads
10
Readme
Ease
Custom easings
Installation
npm i --save @superherocheesecake/ease
Use it
import {lerp, sine, ...} from '@superherocheesecake/ease';
lerp
linear ease
// import
import {lerp} from '@superherocheesecake/ease';
// onUpdate
const start = lerp(start, end, multiplier);
lerpAngle
linear ease, angle values in radians.
// import
import {lerpAngle} from '@superherocheesecake/ease';
// onUpdate
const start = lerpAngle(start, end, multiplier);
berp
boing-like ease
// import
import {berp} from '@superherocheesecake/ease';
// onUpdate
const start = berp(start, end, multiplier);
clerp
circular linear ease
// import
import {clerp} from '@superherocheesecake/ease';
// onUpdate
const start = clerp(start, end, multiplier);
hermite
easeInOut
// import
import {hermite} from '@superherocheesecake/ease';
// onUpdate
const start = hermite(start, end, multiplier);
coserp
easeIn
// import
import {coserp} from '@superherocheesecake/ease';
// onUpdate
const start = coserp(start, end, multiplier);
sinerp
easeOut
// import
import {sinerp} from '@superherocheesecake/ease';
// onUpdate
const start = sinerp(start, end, multiplier);
Spring
elastic ease
// import
import {Spring} from '@superherocheesecake/ease';
// inInitialize
const spring = new Spring(0.92, 30.0, 0.4); // damp, mass, stiffness
// onUpdate
const start = spring.update(start, end);