Animation library based on CSS3 transitions and promises
Allows chaining of css transitions in a promise based way, which gives a powerful control over CSS transitions for making animations.
Zanimo.js is licensed under the terms of the MIT License.
$ npm install zanimo
Build tests with
npm run build
and open test/index.html in your browser.
Takes a DOM element or a promise of a DOM element and returns a promise of the given element.
ZanimomyDomElementthen// do something with the DOM element// do something when `myDOMElement` isn't a DOM element;
Applies a css style on the given DOM element.
ZanimomyDomElement "transform" "translate3d(200px, 200px, 0)"then console.log"Done..."; ;
Starts a transition on the given DOM element and returns a promise. For now Zanimo does not support hexadecimal color notation or 0px (just use 0) in the value argument.
ZanimomyDomElement "width" "200px" 200 "ease-in"then/* do something on success *//* do something on error */;
Zanimo(el, *) call by returning a function (el) ➜ promise[el].
Useful to define reusable transitions.
var widthTransition = Zanimof"width" "200px" 200 "ease-in"heightTransition = Zanimof"height" "300px" 200 "ease-in";ZanimomyDomElementthenwidthTransitionthenheightTransition;
@bobylito who came up with the name