Animate Mixin for Compass/SASS sass mixin created by theCSSguru

Download

animate.css or _animate.sass

This Mixin is based on the work being done here: daneden.me/animate/

Add to HTML < head > or SASS file

      
        < link href="animate.css" rel="stylesheet" type="text/css" >        
        or      
        @import partials/animate.sass
      
    


Inside your SASS file (examples):

      
        .one
          +animate(fadeIn, 3s, 2s)
          
        .two
          +animate(bounceInDown, 2s, 2s)
          
        .three
          +animate(rotateInUpRight)
      
    

Creates This:

fadeIn

bounceInDown

rotateInUpRight



What's inside the _animate.sass partial:

      
        =animate($name: fadeIn, $duration: 1s, $delay: .2s, $function: ease, $mode: both)
          +experimental(animation, $name $duration $delay $function $mode)        
      
    

(plus several preset keyframes for the below effects)

Which Outputs this in CSS:

      
        .one { 
          -moz-animation: fadeIn 3s 2s ease both;
          -webkit-animation: fadeIn 3s 2s ease both;
          -o-animation: fadeIn 3s 2s ease both;
          -ms-animation: fadeIn 3s 2s ease both;
          -khtml-animation: fadeIn 3s 2s ease both;
          animation: fadeIn 3s 2s ease both;
        }
      
    


List of Effects: (click to try out)

Attention seekers

flash bounce shake tada

Fading entrances

fadeIn fadeInUp fadeInDown fadeInLeft fadeInRight fadeInUpBig fadeInDownBig fadeInLeftBig fadeInRightBig

Fading exits

fadeOut fadeOutUp fadeOutDown fadeOutLeft fadeOutRight fadeOutUpBig fadeOutDownBig fadeOutLeftBig fadeOutRightBig

Bouncing entrances

bounceIn bounceInDown bounceInUp bounceInLeft bounceInRight

Bouncing exits

bounceOut bounceOutDown bounceOutUp bounceOutLeft bounceOutRight

Rotating entrances

rotateIn rotateInDownLeft rotateInDownRight rotateInUpLeft rotateInUpRight

Rotating exits

rotateOut rotateOutDownLeft rotateOutDownRight rotateOutUpLeft rotateOutUpRight

Effect Example:

HTML Kitchen Sink

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis.

Header Level 2

  1. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
  2. Aliquam tincidunt mauris eu risus.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus magna. Cras in mi at felis aliquet congue. Ut a est eget ligula molestie gravida. Curabitur massa. Donec eleifend, libero at sagittis mollis, tellus est malesuada tellus, at luctus turpis elit sit amet quam. Vivamus pretium ornare est.

Header Level 3
  • Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
  • Aliquam tincidunt mauris eu risus.