Springs
Super simple springs animations.
Add real fluid physics to you custom javascript animations.
Install
npm install springs
Usage
Create the springs.
; // Tension, friction.const s1 = ;const s2 = ;
Then watch for example with requestAnimationFrame
{ elstyletransform = `scale3d(, , 0)`; ;} ;
Update the end value of the spring, in this case update x
and y
with mouse move.
let x = 0;let y = 0; // Mouse move example. { x = clientX / 200; y = clientY / 200;} document;
Events
onInit
onUpdate
onActivate
onRest
Defaults
tension = 30friction = 1
Development
npm install
Demo
npm start
./example/
folder will be running on: http://localhost:5000