b-tween
A simple but powerful tweening engine for Javascript.
Install
npm i b-tween
Usage
ES Module
;const tween = from: left: 0 to: left: 700 duration: 500 easing: 'bounceOut' { // You can do everything with keys blockstyleleft = keysleft + 'px'; };tweenstart;
Commonjs
const BTween = ;...
Browser
https://unpkg.com/b-tween/dist/b-tween.umd.js
Api
new Tween(options)
options.from (object)
options.to (object)
options.duration (number)
options.delay (number)
options.easing (string)
- linear
- quadIn
- quadOut
- quadInOut
- cubicIn
- cubicOut
- cubicInOut
- quartIn
- quartOut
- quartInOut
- quintIn
- quintOut
- quintInOut
- sineIn
- sineOut
- sineInOut
- bounceIn
- bounceOut
- bounceInOut
options.onStart ( function(keys) {} )
options.onUpdate ( function(keys) {} )
options.onFinish ( function(keys) {} )
Start Animation
const tween = ...;tweenstart;