Pen Settings

HTML

CSS

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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

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.

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

              
                .loader
  each num in [,,,,,,]
    .group(pos=num)
      .dot
      .dot
      .dot
      .dot
              
            
!

CSS

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

JS

              
                
              
            
!
999px

Console