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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <div class="center">
<div class="container">
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>

  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>

  <div></div>
  <div></div>
  <div></div>
  <div></div>
</div>
</div>
              
            
!

CSS

              
                $blockSize: 10px;

$cBack: #fff;
$cHair: #9E856E;
$cSkin: #E6C1AA;
$cGlasses: #000;
$cWhites: #fff;
$cEyes: #356399;
$cBeard: #7B5840;
$cMouth: #B56D69;

$pBack: 1 2 10 11 12 13 23 24 36 48 54 59 84 96 107 108 119 120 121 131 132 133 136 142 143 144;

$pHair: 3 4 5 6 7 8 9 14 15 16 17 18 19 20 21 22 25 26 27 31 34 35 37 38 47 49 61 73 85 97 107 109 110 122 123 134 135;

$pSkin: 28 29 30 32 33 39 40 41 42 43 44 45 46 51 63 75 80 87 88 91 92 93 100 101 102 106 113;

$pGlasses: 50 51 52 53 54 55 56 57 58 59 60 64 67 68 69 72 76 79 81 84 89 90 94 95;

$pEyes: 65 70;

$pWhites: 66 71 77 78 82 83;

$pMouth: 115 116 117;

$pBeard: 62 74 86 98 99 103  104 105 111 112 114 118 124 125 126 127 128 129 130 137 138 139 140 141;

.center {
  display: flex;
  justify-items: center;
  align-items: center;
  width: 100vw;
  height: 100vh;
  padding: 10*$blockSize;
  box-sizing: border-box;
}

.container {
animation: shrink 5s infinite alternate ease-out;
//animation: shrink 10s 1 ease-out forwards;
margin: auto;
  
  div {
    background: $cBack;
    width: $blockSize;
    height: $blockSize;
    float: left;
  }
  
  @each $pixel in $pHair {
    div:nth-child(#{$pixel}) {
      background: $cHair;
    }
  }

    @each $pixel in $pSkin {
    div:nth-child(#{$pixel}) {
      background: $cSkin;
    }
  }
   @each $pixel in $pGlasses {
    div:nth-child(#{$pixel}) {
      background: $cGlasses;
    }
  }
  @each $pixel in $pEyes {
    div:nth-child(#{$pixel}) {
      background: $cEyes;
    }
  }
  @each $pixel in $pWhites {
    div:nth-child(#{$pixel}) {
      background: $cWhites;
    }
  }
  @each $pixel in $pMouth {
    div:nth-child(#{$pixel}) {
      background: $cMouth;
    }
  }
  @each $pixel in $pBeard {
    div:nth-child(#{$pixel}) {
      background: $cBeard;
    }
  }
}
@keyframes shrink {
  0% {
    width: 100%;
  }
  100% {
    width: 12*$blockSize;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console