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 style="border:1px solid black;width:100%;height:400px;background:white;float:left;padding:10px;box-sizing:border-box;" class="busy-indicator mask">
  <h1>
  Pure CSS responsive spinner
  </h1>
  <ul>
    <li>Responsive (Try to resize browser or Dev. Tools in chrome)</li>
    <li>No JavaScript (CSS animation works in paralel process)</li>
    <li>No excess HTML (both :before and :after pseudo-elements used)</li>
    <li>Responsive (based on parent's width)</li>
    <li>Visible on any background</li>
    <li>Optional mask over parent (just add 'mask' class)</li>
    <li>Easy customizable SCSS Compass code (colors, size, width, opacity, speed, mask or not, etc)</li>
    <li>Delay before start animation to give a chance to get things done fast enough without excess visual distortion(1 second by default)</li>
  </ul>
</div>
<div style="clear:both;"></div>
<a target="_blank" href="http://yurigor.com/pure-scss-responsive-loading-indicator-spinner/">See more details in my blog</a><br>
<div style="width:50%;height:200px;background:white;float:left;" class="busy-indicator"></div>
<div style="width:50%;height:200px;background:black;float:left;" class="busy-indicator"></div>
<div style="clear:both;"></div>
<div style="width:50%;height:200px;background:#F88;float:left;" class="busy-indicator"></div>
<div style="width:50%;height:200px;background:#88F;float:left;" class="busy-indicator"></div>
<div style="clear:both;"></div>
<div style="width:25%;height:100px;background:#8F8;float:left;" class="busy-indicator"></div>
<div style="width:25%;height:100px;background:#FF8;float:left;" class="busy-indicator"></div>
<div style="width:50%;height:100px;background:#F8F;float:left;" class="busy-indicator"></div>
<div style="clear:both;"></div>
<div style="width:12.5%;height:200px;background:rgba(0,0,0,0.9);float:left;" class="busy-indicator"></div>
<div style="width:12.5%;height:200px;background:rgba(0,0,0,0.8);float:left;" class="busy-indicator"></div>
<div style="width:12.5%;height:200px;background:rgba(0,0,0,0.7);float:left;" class="busy-indicator"></div>
<div style="width:12.5%;height:200px;background:rgba(0,0,0,0.6);float:left;" class="busy-indicator"></div>
<div style="width:12.5%;height:200px;background:rgba(0,0,0,0.5);float:left;" class="busy-indicator"></div>
<div style="width:12.5%;height:200px;background:rgba(0,0,0,0.4);float:left;" class="busy-indicator"></div>
<div style="width:12.5%;height:200px;background:rgba(0,0,0,0.3);float:left;" class="busy-indicator"></div>
<div style="width:12.5%;height:200px;background:rgba(0,0,0,0.2);float:left;" class="busy-indicator"></div>

              
            
!

CSS

              
                @import "compass";
$busy-delay: 1s;//wait a bit before start animation. If loading process is faster - we will not even bother user
$busy-show-speed: 1s;//fade in speed
$busy-width: 20%;//use percentage to be responsive(depends on parent's width)
$busy-border-width: 6px;
$busy-alfa: 0.3;
$busy-mask-color: rgba(#000, .4);

//$busy-alfa will be apllied to this colors
$busy-color-1: black;//first spinner start color
$busy-color-2: white;//first spinner finish color
$busy-color-A: white;//second spinner start color
$busy-color-B: black;//second spinner finish color

//try some colors?
//$busy-color-1: #F00;
//$busy-color-2: #00F;
//$busy-color-A: #0F0;
//$busy-color-B: #FF0;

@include keyframes(fade-in) {
  0% {
    visibility: hidden;
    opacity: 0;
  }
  1% {
    visibility: visible;
    opacity: 0;
  }
  100% {
    visibility: visible;
    opacity: 1;
  }
};

@include keyframes(rotate-busy) {
  0% {
    @include transform(rotate(0deg));
    border-left-color: rgba($busy-color-1,$busy-alfa);
    border-right-color: rgba($busy-color-2,$busy-alfa);
  }
  50% {
    @include transform(rotate(180deg));
    border-left-color: rgba($busy-color-2,$busy-alfa);
    border-right-color: rgba($busy-color-1,$busy-alfa);
  }
  100% {
    @include transform(rotate(360deg));
    border-left-color: rgba($busy-color-1,$busy-alfa);
    border-right-color: rgba($busy-color-2,$busy-alfa);
  }
};

@include keyframes(rotate-busy-ccw) {
  0% {
    @include transform(rotate(0deg));
    border-left-color: rgba($busy-color-A,$busy-alfa);
    border-right-color: rgba($busy-color-B,$busy-alfa);
  }
  50% {
    @include transform(rotate(-180deg));
    border-left-color: rgba($busy-color-B,$busy-alfa);
    border-right-color: rgba($busy-color-A,$busy-alfa);
  }
  100% {
    @include transform(rotate(-360deg));
    border-left-color: rgba($busy-color-A,$busy-alfa);
    border-right-color: rgba($busy-color-B,$busy-alfa);
  }
};
.busy-indicator {
  cursor: wait;
  position: relative;
  overflow: hidden;
  &:before {
    @include animation(fade-in $busy-show-speed linear $busy-delay 1 forwards, rotate-busy 2s linear 0s infinite);
    @include box-sizing(border-box);
    border-radius: 50%;
    border-style: solid;
    border-top-color: transparent;
    border-bottom-color: transparent;
    border-width: $busy-border-width;
    content: '';
    display: block;
    left: 50%;
    margin-left: -$busy-width / 2;
    margin-top: -$busy-width / 2;
    opacity: 0;
    padding-bottom: calc(#{$busy-width} - #{2 * $busy-border-width});
    position: absolute;
    top: 50%;
    visibility: hidden;
    width:$busy-width;
    z-index: 100500;
  }
  &.mask
  {
    @include user-select(none);
    pointer-events: none;
    &:before {
      @include box-shadow(0px 0px 0px 5000px $busy-mask-color, inset 0px 0px 0px 5000px $busy-mask-color);
    }
  }
  &:after {
    @include animation(fade-in $busy-show-speed linear $busy-delay 1 forwards, rotate-busy-ccw 3s linear 0s infinite);
    @include box-sizing(border-box);
    border-radius: 50%;
    border-style: solid;
    border-top-color: transparent;
    border-bottom-color: transparent;
    border-width: $busy-border-width;
    content: '';
    display: block;
    left: 50%;
    margin-left: -$busy-width / 2;
    margin-top: -$busy-width / 2;
    opacity: 0;
    padding-bottom: calc(#{$busy-width} - #{2 * $busy-border-width});
    position: absolute;
    top: 50%;
    visibility: hidden;
    width:$busy-width;
    z-index: 100501;
  }
}


              
            
!

JS

              
                
              
            
!
999px

Console