animate
Use CSS3 animations easily with Javascript. Library inspired by move.js
Installation
$ npm install animatejs
or to use directly in the browser:
$ bower install animatejs
This library is written in ES6, checkout Gruntfile.js
for an example on how to build it, or just use a tool like 6to5 to compile to ES5 and use it in node.
An already built version is included in dist/
directory. If loaded in a browser it will set an animate
global variable.
example
animate()
.kf({
'25%, 75%': {
background: 'orange'
},
100: {
background: 'red'
}
})
.kf({
name: 'bounce',
50: {
'margin-left': '500px'
}
})
.query('.random-class')
.set('keyframe-0 1s 2')
.on('AnimationIteration', function (animate) {
console.log('argument is the animate instance we were using', animate);
})
.play()
.then(function (animate) {
return animate
.set('bounce 2s 4')
.set({
name: 'keyframe-0',
duration: '1s',
'iterationCount': 10
})
.play();
})
.then(function (animate) {
console.log('finished animating everything');
})
docs
animate(selector) {}
on(eventType, listener) {}
off(eventType) {}
kf(kf) {}, keyframe(kf) {}, setKeyframe(kf) {}
set(...animationRules) {}
query(selector) {}
reset() {}
clean() {}
pause() {}
resume()
play()