3.0.4 • Published 8 years ago

raf-tweener v3.0.4

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

raf-tweener

unstable

An extremely minimal tweening engine based on GSAP, powered by requestAnimationFrame.

var rafTweener = require('raf-tweener');
var eases = require('eases');
var target = {
	x: 0,
	y: 0
};

rafTweener.start();

rafTweener.to(
	target, //tween target object
	10, //duration
	{
		x: 100, //value to tween
		y: 50, //value to tween
		ease: eases.expoInOut, //an easing method takes in a value 0..1 and returns a value 0..1
		onUpdate: function() {
			console.log(this.x.toFixed(2), this.y.toFixed(2));
		},
		onUpdateScope: target,
		onComplete: function() {
			console.log('done!');
		}
	}
);

Usage

NPM

License

MIT, see LICENSE.md for details.

3.0.4

8 years ago

3.0.3

8 years ago

3.0.2

8 years ago

3.0.1

8 years ago

3.0.0

8 years ago

2.0.0

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago