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

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

              
                -(82).times do
  %div
              
            
!

CSS

              
                $centerX: 150px;
$centerY: 150px;
$spacing: 50px;
$thickness: 20px;
$colors: #3897D8 #F24444 #1FBF92 #F27127 #F2BB13;

body {
  background: black;
}

@for $i from 0 to 24 {
  $size: 150px + floor($i / 3) * ($spacing * 2);
  //$thickness: (2 + cos(floor($i / 3) / 4 * 360deg)) * 5px;
  
  div:nth-child(#{$i + 1}) {
    border: 10px solid nth($colors, 1);
    z-index: floor(random() * 3) + 1;
    position: absolute;
    border-bottom: 0;
    transform-origin: 50% 100%;
    width: $size;
    height: $size / 2;
    left: $centerX - floor($i / 3) * $spacing - $thickness;
    top: $centerY - floor($i / 3) * $spacing - $thickness;
    border-top-left-radius: $size;
    border-top-right-radius: $size;
    border-color: nth($colors, ceil(random() * length($colors)));
    border-width: $thickness;
    animation: rot 5s + random() * 2s cubic-bezier(0, random() * .6 + .2, 1, random() * .6 + .2) -104s infinite;
    @if (floor($i / 3) % 2 == 0) {
      animation-direction: reverse;
    }
  }
}

@for $i from 0 to (83 - 24) {
  div:nth-child(#{$i + 25}) {
    $space: 50px + 35px * floor($i / 5) + 20px;
    z-index: floor(random() * 5) + 1;
    width: 19px;
    height: 19px;
    background: nth($colors, $i % 5 + 1);
    position: absolute;
    left: $centerX - 25px + (100px - $space);
    top: $centerY - 25px + (100px - $space);
    animation: rot 3s + random() * 2s linear -100s infinite;
    border-radius: 50%;
    transform-origin: $space $space;
    @if (random() < .5) {
      animation-direction: reverse;
    }
  }
}

@keyframes rot {
  0% {
    transform: rotate(0deg);
  }
  
  100% {
    transform: rotate(360deg);
  }
}
              
            
!

JS

              
                /*

#100DaysOfNDivs

Once a day for 100 days, I’ll be trying to make something with pure CSS. No SVGs, no Javascript, just divs and some pseudo-elements. Each day, I will only have that day’s number of divs to play with.

I won’t be shooting for cross browser. If it works in the latest Chrome, that’s all I’m looking for. I’ll be using a bunch of new css features, ignoring performance, and leaning towards art over practical.

This should be fun! Follow along with me!

*/
              
            
!
999px

Console