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.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

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.

HTML

            
              #hero.preload
  <video class="home-page__hero-video" id="video" autoplay="autoplay" muted="muted" preload="auto" loop="loop"><source src="https://mojotech-static.s3.amazonaws.com/m4/video/broll/mojo-hero-loop.mp4" type="video/mp4"><source src="https://mojotech-static.s3.amazonaws.com/m4/video/broll/mojo-hero-loop.mp4" type="video/webm"></video>  

            
          
!

CSS

            
              html, body
  padding: 0
  margin: 0
  
  
#hero
  overflow: hidden
  margin: 0 auto
  position: relative
  width: 520px
  height: 560px
  
video
  max-height: 560px
  
.pixel, .empty
  font-size: 0
  width: 40px
  height: 40px
  position: absolute
  color: rgba(255,255,255,0.8)
  text-align: center
  line-height: 40px
  transition: transform 0.5s ease-out
  
.pixel
  background-color: #fff
  color: black
  
.empty
  color: white
  
for r in (0..14)
  .row-{r}
    top: 40px * r
    
for c in (0..14)
  .col-{c}
    left: 40px * c

.pixel:hover
   font-size: 1em

offset(y, x, blocks)
  .preload
    .row-{y}.col-{x}
      transform: translateY(40px * blocks)

offset(0,0,-1)
offset(2,6,1)
offset(1,4,2)
offset(5,9,2)
offset(13,1,-6)    
offset(5,9,4)
offset(11,3,-2)
offset(13,10,-2)
offset(13,11,-2)
offset(9,6,2)
offset(8,6,-1)
offset(11,11,1)
offset(12,1,1)
offset(1,8,2)
offset(0,8,-1)
offset(8,5,-4)
offset(10,5,-6)
offset(10,6,2)
offset(8,4,-3)
offset(13,0,-10)
offset(13,9,-5)
offset(12,12,-5)
offset(12,6,-6)
offset(9,8,-4)
offset(6,4,2)
offset(13,11,-7)
            
          
!

JS

            
              $hero = $('#hero');

var cover = [
  [0,0,0,1,1,1,1,1,1,1,0,0,0],
  [0,0,0,0,1,1,1,1,1,0,0,0,0],
  [0,0,0,0,0,0,1,0,0,0,0,0,0],
  [0,0,0,0,0,0,0,0,0,0,0,0,0],
  [0,0,0,0,0,0,0,0,0,0,0,0,0],
  [0,0,0,1,0,0,0,0,0,1,0,0,0],
  [0,0,0,0,1,0,0,0,1,0,0,0,0],
  [0,0,0,0,1,1,0,1,1,0,0,0,0],
  [0,0,0,0,1,1,1,1,1,0,0,0,0],
  [0,0,0,0,1,1,1,1,1,0,0,0,0],
  [0,0,0,0,1,1,1,1,1,0,0,0,0],
  [1,0,0,1,1,1,1,1,1,1,1,0,1],
  [0,1,1,1,1,1,1,1,1,1,0,1,1],
  [1,1,0,1,1,1,1,1,1,1,1,1,1]
];

var pixels = [];

for(var y = 0; y < 14; y++) {
  pixels[y] = [];
  
  for(var x = 0; x < 13; x++) {
    var baseClass = "row-" + y + " col-" + x;
    
    if(cover[y][x] === 1) {
      pixels[y].push("<div class='pixel " + baseClass + "'>" + y + ", " + x + "</div>");
    } else {
      pixels[y].push("<div class='empty " + baseClass + "'>" + y + ", " + x + "</div>");
    }
  }
}

$hero.append([].concat.apply([], pixels));

$hero.click(function(){
  $(this).toggleClass("preload")
})
            
          
!
999px

Console