cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

            
              !!! 5
%html
  %head
    %title= "Your Website"
    %meta{ :content => "", :name => "description" }
    %meta{ :content => "", :name => "author" } 
  %body
    %section 
      %area
            
          
!
            
              @import compass

$color: #484
*
  margin: 0
  padding: 0
body
  background: $color
section
  margin: 0
  position: absolute
  top: 0
  left: 0
  overflow: hidden
area
  display: block
div
  width: 20px
  height: 20px
  float: left
  transition: background 2s ease-out
  margin: 0
  font-size: 9px
  color: lighten($color, 5)
  &.color1
    transition: background 1s ease-out
    background-color: $color
    &:hover
      background-color: lighten($color, 2)
  &.color2
    transition: background 3s ease-out
    background-color: lighten($color, 4)
    &:hover
      background-color: lighten($color, 6)
  &.color3, &.color4
    transition: background 4s ease-out
    background-color: lighten($color, 8)
    &:hover
      background-color: lighten($color, 10)
p
  overflow: hidden


            
          
!
            
              var ToC, newLine, random; 
ToC = "";


$(window).resize(function(){

   var height = $(window).height();
   var width = $(window).width();  

   var boxCountH = Math.round(height / 20);
   var boxCountW = Math.round(width / 20);
   var boxCount = Math.round(boxCountW * boxCountH) + boxCountW;


   for(var i = 0; i < boxCount; i++) {   
     random = Math.ceil(Math.random() * 3);
     newLine = "<div class='color" + random + "'></div>";

     ToC += newLine;
   }; 
   
   $("area").append(ToC);  
   $('section').height(height);
   $('section').width(width);  
   $('area').width(width+10);   
})

$(window).resize();
            
          
!
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