cssAudio - ActiveCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              @import "compass/css3";

@mixin steps($name, $frames) {
  -webkit-animation: #{$name} 1s steps($frames) infinite;
     -moz-animation: #{$name} 1s steps($frames) infinite;
      -ms-animation: #{$name} 1s steps($frames) infinite;
       -o-animation: #{$name} 1s steps($frames) infinite;
          animation: #{$name} 1s steps($frames) infinite;  
}
 
/* creates named keyframe animations per browser prefix */
@mixin keyframes($name) {
  @-webkit-keyframes #{$name} {
    @content; 
  }
  @-moz-keyframes #{$name} {
    @content;
  }
  @-ms-keyframes #{$name} {
    @content;
  }
  @keyframes #{$name} {
    @content;
  } 
}
 
/* Generates all browser prefixes for a named animation with a start background position for the first frame of a sprite to the last frame of a sprite */
@mixin play($name, $height) {
  @include keyframes($name) {
    from { background-position: 0px 0px; }
      to { background-position: 0px -#{$height}; }  
  }
}
 
/* Actually includes the named animations in the css */
@include play(main-bear, 11550px);
@include play(about-bear, 15000px);
@include play(schedule-bear, 12500px);
@include play(register-bear, 13500px);
@include play(sponsors-bear, 10800px); 
 
.main-bear {
  background-image: url(http://barcampnola.com/img/page-main-bear-sprite.png);
  width: 424px;
  height: 550px;
  margin: 0 auto;
  @include steps(main-bear, 21); // creates a css transition of the named animation with the number of frames in the sprite.
}
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console