tween-objects

1.0.2 • Public • Published

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.

/tween-objects/

    Package Sidebar

    Install

    npm i tween-objects

    Weekly Downloads

    174

    Version

    1.0.2

    License

    MIT

    Last publish

    Collaborators

    • mattdesl