css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              .loader
  .loader_overlay
  .loader_cogs
    .loader_cogs__top
      -(1..3).each do
        .top_part
      .top_hole
    .loader_cogs__left
      -(1..3).each do
        .left_part
      .left_hole
    .loader_cogs__bottom
      -(1..3).each do
        .bottom_part
      .bottom_hole <!-- lol -->
    %p loading
  %h1 Cog loader
  %h2 Created in pure css
            
          
!
            
              /* Fonts */

@import url(https://fonts.googleapis.com/css?family=Montserrat:400,700);

/* Variables */

$pink:#f98db9;
$blue:#97ddff;
$yellow:#ffcd66;
$font:'Montserrat', sans-serif;
$heading:rgb(87, 110, 129);
$sub:#F98DB9;

/* Mixins */

@mixin center{
  position:absolute;
  left:0;
  right:0;
  top:0;
  bottom:0;
  margin:auto;
}

@mixin hole{
  border-radius:100%;
  background:white;
  position: absolute;
}

body{
  height:100vh;
  font-family:$font;
  text-align:center;
  overflow:hidden;
  h1{
    text-transform:uppercase;
    font-size:30px;
    color:$heading;
    margin:30px 0px 0px 0px;
  }
  h2{
    font-weight:normal;
    font-size:18px;
    color:$sub;
    margin:10px 0px 0px 0px;
  }
  p{
    margin:0 auto;
  }
  .loader{
    height:100%;
    position:relative;
    margin:auto;
    width:400px;
    &_overlay{
      width:150px;
      height:150px;
      background:transparent;
      box-shadow:0px 0px 0px 1000px rgba(255, 255, 255, 0.67), 0px 0px 19px 0px rgba(0, 0, 0, 0.16) inset;
      border-radius:100%;
      z-index:-1;
      @include center;
    }
    &_cogs{
      z-index:-2;
      width:100px;
      height:100px;
      top: -120px !important;
      @include center;
      &__top{
        position:relative;
        width:100px;
        height:100px;
        transform-origin: 50px 50px;
        animation:rotate 10s infinite linear;
        @for $i from 1 through 3{
          div:nth-of-type(#{$i}){
            transform:rotate($i * 30deg)
          }
        }
        div.top_part{
          width:100px;
          border-radius:10px;
          position:absolute;
          height:100px;
          background:$pink;
        }
        div.top_hole{
          width:50px;
          height:50px;
          @include hole;
          @include center;
        }
      }
      &__left{
        position: relative;
        width: 80px;
        transform: rotate(16deg);
        top: 28px;
        transform-origin: 40px 40px;
        animation:rotate_left 10s .1s infinite reverse linear;
        left: -24px;
        height: 80px;
        @for $i from 1 through 3{
          div:nth-of-type(#{$i}){
            transform:rotate($i * 30deg)
          }
        }
        div.left_part{
          width:80px;
          border-radius:6px;
          position:absolute;
          height:80px;
          background:$blue;
        }
        div.left_hole{
          width:40px;
          height:40px;
          @include hole;
          @include center;
        }
      }
      &__bottom{
        position: relative;
        width: 60px;
        top: -65px;
        transform-origin: 30px 30px;
        animation:rotate_left 10.2s .4s infinite linear;
        transform: rotate(4deg);
        left: 79px;
        height: 60px;
        @for $i from 1 through 3{
          div:nth-of-type(#{$i}){
            transform:rotate($i * 30deg)
          }
        }
        div.bottom_part{
          width:60px;
          border-radius:5px;
          position:absolute;
          height:60px;
          background:$yellow;
        }
        div.bottom_hole{
          width:30px;
          height:30px;
          @include hole;
          @include center;
        }
      }
    }
  }
}

/* Animations */

@keyframes rotate{
  from{transform:rotate(0deg)}
  to{transform:rotate(360deg)}
}

@keyframes rotate_left{
  from{transform:rotate(16deg)}
  to{transform:rotate(376deg)}
}

@keyframes rotate_right{
  from{transform:rotate(4deg)}
  to{transform:rotate(364deg)}
}
            
          
!
            
              /* Inspired by this super groovy dribbble shot https://dribbble.com/shots/946595-App-loader-GIF-animation?list=searches&tag=loader&offset=3 */
            
          
!
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