TWEEN ANIMATION


                

Keys: JS Object Property

Any Object property containing a numerical value can be animated.

More details about accepted values in the values section.

Example Value
charged '100%'

CODE EXAMPLE

let logEl = $1('.battery-log');
let battery = {
    charged: '0%',
    cycles: 120
};
new TweenAnim({
    keys: {
        charged: '100%',
        cycles: 130
    },
    on: {
        updated: function () {
            logEl.innerHTML = Jsons.stringify(battery);
        }
    }
}).targets(battery);