Find a file
2013-12-08 22:59:20 -06:00
attention_seekers removed class names - they're unsemantic 2013-12-08 22:42:36 -06:00
bouncing_entrances removed class names - they're unsemantic 2013-12-08 22:42:36 -06:00
bouncing_exits removed class names - they're unsemantic 2013-12-08 22:42:36 -06:00
fading_entrances removed class names - they're unsemantic 2013-12-08 22:42:36 -06:00
fading_exits removed class names - they're unsemantic 2013-12-08 22:42:36 -06:00
flippers removed class names - they're unsemantic 2013-12-08 22:42:36 -06:00
lightspeed removed class names - they're unsemantic 2013-12-08 22:42:36 -06:00
rotating_entrances removed class names - they're unsemantic 2013-12-08 22:42:36 -06:00
rotating_exits removed class names - they're unsemantic 2013-12-08 22:42:36 -06:00
sliders removed class names - they're unsemantic 2013-12-08 22:42:36 -06:00
specials removed class names - they're unsemantic 2013-12-08 22:42:36 -06:00
bower.json reorganized to take advantage of stylus 2013-12-08 21:30:31 -06:00
CONTRIBUTING reorganized to take advantage of stylus 2013-12-08 21:30:31 -06:00
index.styl reorganized to take advantage of stylus 2013-12-08 21:30:31 -06:00
LICENSE reorganized to take advantage of stylus 2013-12-08 21:30:31 -06:00
package.json reorganized to take advantage of stylus 2013-12-08 21:30:31 -06:00
README.md add note about using this without stylus 2013-12-08 22:59:20 -06:00

#animate-stylus Just-add-water CSS animation

animate-stylus is a bunch of cool, fun, and cross-browser animations for you to use in your projects. Great for emphasis, home pages, sliders, and general just-add-water-awesomeness.

##Usage To use animate-stylus in your website, just @import animate-stylus and reference the animations you want in your stylesheet. That's it! You've got a CSS animated element. Super!

@import 'animate-stylus'

#yourElement
  animation-name: bounceOutLeft
  animation-duration: 3s;
  animation-delay: 2s;
  animation-iteration-count: infinite;

You can do a whole bunch of other stuff with animate-stylus when you combine it with jQuery or add your own CSS rules. Dynamically add animations using jQuery with ease:

.bounceOutLeft
  animation-name: bounce
  animation-duration: 1s;
  animation-fill-mode: both;
$('#yourElement').addClass('bounceOutLeft');

You can also detect when an animation ends:

$('#yourElement').one('webkitAnimationEnd mozAnimationEnd oAnimationEnd animationEnd', doSomething());

##Include/Exclude Animations There's no need to make custom builds because with Stylus you can import everything you want, and nothing you don't. For example, if you only use the slideInDown animation then don't @import the whole library - just @import 'animate.css/sliders/slideInDown'. Or, if you want all the sliders, you can @import 'animate.css/sliders'.

##Vendor Prefixes I've left the code unprefixed so you can support whatever browsers you're targeting without having them choosen for you. I recommend using nib or auto-prefixer to add the prefixes.

##Adding Animations with Class Names First off, making classes like .bounce is unsemantic because it states the style (which is the job of CSS), rather than describing what the element is. Your HTML is for content, and your CSS is for style - thus, class names (a feature of HTML) should describe the content, not the style.

But I suppose you don't really care about proper semantics, or you wouldn't be trying to do this. So, if you're really determined, you can add this:

//list of animations that we are using
animations = (bounce slideInDown slideOutUp)

.animated
  animation-duration: 1s
  animation-fill-mode: both

for animation_name in animations
  .{animation_name}
    @extends .animated
    animation-name: animation_name

And then adding animations to elements with class names will work:

<div class="bounce">This is bouncing</div>

##What if I don't use Stylus? Well, I feel very sorry for you because you are missing out on something great. But, you can still use this animation library - just compile index.styl and you'll get a big CSS file (called index.css) that you can use:

$ npm install stylus -g
$ cd directory/this/repo/is/in
$ stylus ./