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.

            
              .loader
  each num in [1,2,3,4,5,6]
    .group(pos=num)
      .dot
      .dot
      .dot
      .dot
            
          
!
            
              @import "nib"

// change the base hue for fun
base-color = hsl(200, 80%, 50%) 
// will change speed and displacement of dots
offset = 0.75 
// try linear, ease-in-out, etc
easing = ease 

.center-center
  display:flex
  align-items:center
  justify-content:center

body
  @extend .center-center
  height:100vh
  background:hsl(0,0%,30%)
    
.loader
  @extend .center-center
  width:50vw
  height:50vw

.group
  position:relative
    
.dot
  position:absolute
  width:0.5rem
  height:0.5rem
  border-radius:50%
    
for num in (1...7)
  distance = unit(num + 1.25, 'rem')
  duration = unit(1 + (num * offset), 's')
  
  .loader > .group:nth-child({num})
    animation: spin duration easing infinite
    transform-origin:0.25rem 0.25rem
    > .dot
      background-color:spin(base-color, unit(num * -10deg, '%'))
      &:nth-child(1)
        transform:translate3d(distance, distance, 0)
      &:nth-child(2)
        transform:translate3d(-(distance), -(distance), 0)
      &:nth-child(3)
        transform:translate3d(-(distance), distance, 0)
      &:nth-child(4)
        transform:translate3d(distance, -(distance), 0)
        
@keyframes spin
  0%
    transform:rotateZ(0) scale(1)
    opacity:0
  50%
    transform:rotateZ(180deg) scale(2)
    opacity:1
  100%
    transform:rotateZ(360deg) scale(1)
    opacity:0
    
            
          
!
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