1.0.2 • Published 8 years ago

tween-objects v1.0.2

Weekly downloads
53
License
MIT
Repository
github
Last release
8 years ago

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.