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

              
                <div class="loader">
  <div class="heart"></div>
  <div class="heart"></div>
  <div class="heart"></div>
</div>
              
            
!

CSS

              
                *, *:before, *:after {
  box-sizing: border-box;
}

.loader {
  width: 50px;
  height: 24px;
  padding: 4px 0;
  background: #222;
  border-top: 2px solid #111;
  border-bottom: 2px solid #111;
  position: fixed;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(2);
  // scaling it for a better view
  
  &::before,
  &::after {
    content: '';
    position: absolute;
    top: 0;
    height: 2px;
    width: 2px;
  }
  
  &::before {
    box-shadow: //left border
                -2px  0px 0 #111,
                -4px  2px 0 #111,
                -6px  4px 0 #111,
                -6px  6px 0 #111,
                -6px  8px 0 #111,
                -6px 10px 0 #111,
                -6px 12px 0 #111,
                -6px 14px 0 #111,
                -4px 16px 0 #111,
                -2px 18px 0 #111,
                //left lg vertical line
                -2px  2px 0 #222,
                -2px  4px 0 #222,
                -2px  6px 0 #222,
                -2px  8px 0 #222,
                -2px 10px 0 #222,
                -2px 12px 0 #222,
                -2px 14px 0 #222,
                -2px 16px 0 #222,
                //left md vertical line
                -4px  4px 0 #222,
                -4px  6px 0 #222,
                -4px  8px 0 #222,
                -4px 10px 0 #222,
                -4px 12px 0 #222,
                -4px 14px 0 #222;    
  }
  
  &::after {
    right: 0;
    box-shadow: //left border
                2px  0px 0 #111,
                4px  2px 0 #111,
                6px  4px 0 #111,
                6px  6px 0 #111,
                6px  8px 0 #111,
                6px 10px 0 #111,
                6px 12px 0 #111,
                6px 14px 0 #111,
                4px 16px 0 #111,
                2px 18px 0 #111,
                //left lg vertical line
                2px  2px 0 #222,
                2px  4px 0 #222,
                2px  6px 0 #222,
                2px  8px 0 #222,
                2px 10px 0 #222,
                2px 12px 0 #222,
                2px 14px 0 #222,
                2px 16px 0 #222,
                //left md vertical line
                4px  4px 0 #222,
                4px  6px 0 #222,
                4px  8px 0 #222,
                4px 10px 0 #222,
                4px 12px 0 #222,
                4px 14px 0 #222; 
  }  
}

.heart {
    display: inline-block;
    vertical-align: top;
    margin-left: 12px;
    height: 2px;
    width: 2px;
    box-shadow: 
      6px  2px 0 #fff,
      //
      2px  0px 0 #fff,
      4px  0px 0 #fff,
      0px  2px 0 #fff,
      0px  4px 0 #fff,
      2px  6px 0 #fff,
      4px  8px 0 #fff,
      6px  10px 0 #fff,
      //
      8px  0px 0 #fff,
      10px  0px 0 #fff,
      12px  2px 0 #fff,
      12px  4px 0 #fff,
      10px  6px 0 #fff,
      8px  8px 0 #fff;
  
  &::before,
  &::after {
    content: '';
    position: absolute;
    height: 2px; width: 2px;
    visibility: hidden;
    animation: ani 3s/*duration*/ 2s/*delay*/  infinite;
  }
  
  &::before {
    box-shadow: 
      2px  2px 0 #e03800,
      2px  4px 0 #e03800,
      4px  2px 0 #e03800,
      4px  4px 0 #e03800,
      4px  6px 0 #e03800,
      6px  4px 0 #e03800,
      6px  6px 0 #e03800,
      6px  8px 0 #e03800;  
  }
  
  &::after {
    box-shadow: 
      8px  2px 0 #e03800,
      8px  4px 0 #e03800,
      8px  6px 0 #e03800,
      10px  2px 0 #e03800,
      10px  4px 0 #e03800;
  }   
  
  &:nth-child(1) {
    margin: 0;
    &::before {
      animation-timing-function: steps(9);
    }
    &::after {
      animation-timing-function: steps(8);
    }     
  }
  
  &:nth-child(2) {
    &::before {
       animation-timing-function: steps(7);
    }
    &::after {
        animation-timing-function: steps(6);
    }     
  }
  
  &:nth-child(3) {
    &::before {
       animation-timing-function: steps(5);
    }
    &::after {
       animation-timing-function: steps(4);
    }     
  }
  
}

@keyframes ani {
  to {visibility: visible;} 
} 
              
            
!

JS

              
                // https://catalin.red/gamespot-loading-hearts/
// As seen on http://www.gamespot.com/
              
            
!
999px

Console