tween-objects

tween object and arrays of objects

Usage no npm install needed!

<script type="module">
  import tweenObjects from 'https://cdn.skypack.dev/tween-objects';
</script>

README

tween-objects

stable

Tweens an object or an array of objects, operating on numbers and array types. tweenr uses this tween by default, since it is the most common case.

var Tween = require('tween-objects')

var elements = [
    { opacity: 0 },
    { opacity: 0, position: [0, 0] }
]

var tween = Tween(elements, { duration: 1, opacity: 1, position: [5, 10] })
        .on('complete', handler)
tween.tick(0.5)

console.log(elements[0].opacity)  // -> 0.5
console.log(elements[1].position) // -> [2.5, 5]

Usage

NPM

tween = ObjectTween(element, opt)

Creates a new tween where element is an object or an array of objects.

License

MIT, see LICENSE.md for details.