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 Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

            
              <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>

            
          
!
            
              @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;
  }
}


            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console