A spring that generates realistic easing functions
MIT License
A spring that generates realistic easing functions
$ yarn add springer
# or
$ npm install springer --only=dev
<script src='https://unpkg.com/springer@latest/springer.js'></script>
springer(tension, wobble)
tension
0
1
0.5
wobble
0
1
0.5
import springer from 'springer' // or 'window.Springer.default' for script-tag users
const spring = springer(0.5, 0.8)
console.log(spring(0)) // 0
console.log(spring(0.2)) // 0.80516
console.log(spring(0.4)) // 1.01897
console.log(spring(0.6)) // 1.00010
console.log(spring(0.8)) // 0.99974
console.log(spring(1)) // 1
Springer
is heavily inspired by React-Motion with he bulk of the difficult physics logic originally done by the amazing Cheng Lou (chenglou). Thanks Cheng!
To suggest a feature, create an issue if it does not already exist. If you would like to help develop a suggested feature follow these steps:
$ yarn
src/
directory$ yarn run test
Runs the test suite$ yarn run prepublish
Builds for NPM distribution