tween-objects
v1.0.2
Published
tween object and arrays of objects
Downloads
464
Maintainers
Readme
tween-objects
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
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.