Giter VIP home page Giter VIP logo

compass-animate's Introduction

Compass Animate

This is the new home for Eric Meyer's Compass port of animate.css by Dan Eden. It is splitting off from compass-animation because the majority of that plugin has moved into Compass 0.13. This plugin is for people on the Compass edge, while that plugin remains useful to people who are still using Compass 0.12.

Compass Animate requires Compass 0.13 (currently in alpha).

gem install animate --pre
# config.rb
require "animate"
// *.scss
@import "animate";

Usage

We try our best to stay up to date with the latest from Dan Eden, but we've also made a few changes and expanded on his base.

You can include any number of named animation keyframes, each one with or without it's related class name.

The most basic option is simply:

// Include all the animation keyframes:
@include animate;

But you can get much more detailed:

// Temlate:
// @include animate[-animationName]([$sub: all, $class: false]);

Let's say you want just the "flash" animation:

// Include only the flash animation keyframes
@include animate-flash;

But you also want a pre-defined class that calls that animation:

// Include only the flash animation keyframes,
// with associated class name:
@include animate-flash($class:true);

That will output:

@-moz-keyframes flash { 0% { opacity: 1; }
  25% { opacity: 0; }
  50% { opacity: 1; }
  75% { opacity: 0; }
  100% { opacity: 1; } }

@-webkit-keyframes flash { 0% { opacity: 1; }
  25% { opacity: 0; }
  50% { opacity: 1; }
  75% { opacity: 0; }
  100% { opacity: 1; } }

@-o-keyframes flash { 0% { opacity: 1; }
  25% { opacity: 0; }
  50% { opacity: 1; }
  75% { opacity: 0; }
  100% { opacity: 1; } }

@-ms-keyframes flash { 0% { opacity: 1; }
  25% { opacity: 0; }
  50% { opacity: 1; }
  75% { opacity: 0; }
  100% { opacity: 1; } }

@keyframes flash { 0% { opacity: 1; }
  25% { opacity: 0; }
  50% { opacity: 1; }
  75% { opacity: 0; }
  100% { opacity: 1; } }

.flash {
  -webkit-animation-name: flash;
     -moz-animation-name: flash;
      -ms-animation-name: flash;
       -o-animation-name: flash;
          animation-name: flash; }

Now you have the named keyframes for the "flash" animation and a class name that you can use in your HTML or extend with Sass.

You can also set $class to silent and get %flash which can be used with @extends but won't show up in the css.

There are a few shortcuts as well:

// this:
@include animate-fadeIn;
@include animate-fadeOut;
@include animate-fadeOutBig;

// is equal to this:
@include animate-fade(in-only out-only outBig);

If you want all the fadeOut animations:

@include animate-fade(out);

Animations

This plugin includes the following mixins & animations:

Attention

  • attention
  • flash, bounce, shake, tada, swing, wobble, wiggle, pulse, rubberBand

Flip (currently Webkit, Firefox, & IE10 only)

  • flip, flipX, flipY
  • flipIn, flipInX, flipInY
  • flipOut, flipOutX, flipOutY

Fade

  • fade
  • fadeIn, fadeInUp, fadeInDown, fadeInLeft, fadeInRight, fadeInUpBig, fadeInDownBig, fadeInLeftBig, fadeInRightBig
  • fadeOut, fadeOutUp, fadeOutDown, fadeOutLeft, fadeOutRight, fadeOutUpBig, fadeOutDownBig, fadeOutLeftBig, fadeOutRightBig

Bounce

  • bounce
  • bounceIn, bounceInDown, bounceInUp, bounceInLeft, bounceInRight
  • bounceOut, bounceOutDown, bounceOutUp, bounceOutLeft, bounceOutRight

Roll

  • roll
  • rollIn
  • rollOut

Rotate

  • rotate
  • rotateIn, rotateInDownLeft, rotateInDownRight, rotateInUpLeft, rotateInUpRight
  • rotateOut, rotateOutDownLeft, rotateOutDownRight, rotateOutUpLeft, rotateOutUpRight

LightSpeed

  • lightSpeed
  • lightSpeedIn
  • lightSpeedOut

Special

  • special
  • hinge

Slide

  • slide
  • slideInDown, slideInLeft, slideInRight
  • slideOutUp, slideOutLeft, slideOutRight

Zoom

  • zoom
  • zoomIn, zoomInDown, zoomInLeft, zoomInRight, zoomInUp
  • zoomOut, zoomOutDown, zoomOutLeft, zoomOutRight, zoomOutUp

compass-animate's People

Contributors

mirisuzanne avatar jorge-d avatar andidev avatar beausmith avatar danielguillan avatar lukemelia avatar

Watchers

James Cloos avatar Kenneth  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.