Declarative handling library for CSS animations. The main objective is to provide an eloquent, easy to translate, and quick to develop environment.
Check the online Demonstration.
Bower
$ bower install anijs
Forked on Github
$ git clone git@github.com:anijs/anijs.git
Download as Zip
Put the AniJS file on your page or use AMD.
<script src="anijs-min.js"></script>
Include the CSS animation styles definition, we strongly recommend you to use the amazing animate.css library as starting point, this library provides beautiful animations. Also, you can define your own animations.
<head>
<!-- Animate.css library -->
<link rel="stylesheet" href="http://cdn.jsdelivr.net/animatecss/3.1.0/animate.css">
</head>
Start playing by adding anijs-data tag to any HTML element.
<body>
<header data-anijs="if: click, do: flipInY animated, after: removeAnim">
header
</header>
<nav data-anijs="if: scroll, on: window, do: swing animated, to: footer">
nav
</nav>
<div id="main" data-anijs="if: DOMContentLoaded, on: document, do: swing animated">
if: DOMContentLoaded, on: document, do: swing animated, after: removeAnim
</div>
<footer>
footer
</footer>
<script src="bower_components/anijs/dist/anijs-min.js"></script>
</body>
See a Codepen Example.
If you use animate.css library don't forget to add the animated class in the do definition. However, using the setClassNamesWhenAnim function, AniJS can do that for you.
<body>
<header data-anijs="if: click, do: flipInY animated">
<!-- ... -->
</header>
</body>
Documentation Topics can be founded in the Wiki Pages.
- Easy to use.
- Reusable code.
- Speed of development.
- Better integration between coders and designers.
- The obtained code is reliable, elegant and expressive.
- There is no need for third party libraries.
- Compact - around 6kb after gzipping.
For detailed changelog, check Releases.
AniJS is like a little girl, she needs hungry and foolish community people to grow up healthy. All your issues, pull requests and stars ;) are welcome.
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
To Ms. Ana Silvia Tellería, Ms. Marisniulkis Lescaille, Mr. Yolier Galán, Mr. René González, Mr. Julio Cañizares and to all the persons that helped with this project.
The MIT License (MIT)
Copyright © 2014 Dariel Noel darielnoel@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.