Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <body>
  <div class="banner animate-down-once">
    <div>Beer</div>
    <div>Sleep</div>
    <div>Code</div>
  </div>
</body>
              
            
!

CSS

              
                $font-size: 4rem;

.banner {  // some style for the banner div
  background-color: #333;
  color: #eee;
  font-size: $font-size;
}

.animate-down-once {
	$animation-delay: 3s;    // delay the start from page load
	$animation-length: 9s;  // full time animation will run
  
  div{
    // overlap the divs
    $txt-div-height: 5rem;
    height: $txt-div-height;
    margin-bottom: -$txt-div-height;
    
    opacity: 0;  // start hidden
    text-align: center;
  }

	div:nth-child(1), div:nth-child(2) { 
    animation: slideDownThrough $animation-length linear $animation-delay 1; 
  }
  div:nth-child(2) { animation-delay: ($animation-delay + ($animation-length / 3)); }
  div:nth-child(3) {
		animation: 
      slideDownIn
      ($animation-length / 3)                        // animation length is 1/3 of total run time
      linear                                         // constant timing stucture
      ($animation-delay + ($animation-length / 1.5))  // delay by initial delay plus 2/3 of run time
      1                                              // run once
      forwards;                                      // run once and stop on last frame
  }
}

@keyframes slideDownThrough {
  // slide text down and appear, then slide down and disappear
  0% { opacity: 0; }
  2% { opacity: 0; transform: translateY(-$font-size); }
  5% { opacity: 1; transform: translateY(0px); }
  17% { opacity: 1; transform: translateY(0px); }
	20% { opacity: 0; transform: translateY($font-size); }
	80% { opacity: 0; }
  100% { opacity: 0; }
}

@keyframes slideDownIn {
  // slide text down and appear, freeze on last frame to keep it visible
  0% { opacity: 0; }
  2% { opacity: 0; transform: translateY(-$font-size); }
  17% { opacity: 1; transform: translateY(0px); }
  100% { opacity: 1; transform: translateY(0px); }
}

              
            
!

JS

              
                
              
            
!
999px

Console