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="link"></div>  
<div class="fire"></div>
<div class="moblin"></div>
              
            
!

CSS

              
                body {
  font: 16px/1.5 Arial;
  background: #555;
}
.fire,.link,.moblin {
  position: absolute;
  font-size: 1em;
  top: 2em;
}
.fire { 
  left: 25em; 
} 
.link { 
  left: 5em;
}
.moblin {
  left: 45em;
}
              
            
!

JS

              
                /*
Pixelize jQuery Plugin
By Rob Glazebrook.
http://www.cssnewbie.com/

The plugin takes an array of arrays. Each inner array acts as a row. Each item in the inner array contains a color (hex, hsl, rgba, whatever) and acts as a single cell in that row. 

Example (in spreadsheet-esque fashion):
[
  [A1, A2, A3],
  [B1, B2, B3],
  [C1, C2, C3]
]

To make a space transparent, just leave it empty, like so:

[A1, ,A3] // Space A2 would be transparent

You don't need a space in empty cells, though I've found it helps me visualize the matrix.

To save on space, all rows do not have to have the same number of columns in them: you can stop each row at the last "filled" cell.

*/

// The Pixelize plugin.
(function( $ ) {
  $.fn.pixelize = function(matrix) {
    var m = matrix || [[false]],
        pixels = '',
        long = m.reduce(function(p,c) {return (c.length > p.length) ? c : p }).length;
    for (y1=0;y1<m.length;y1++) {
      for (x1=0;x1<long;x1++) {
        if(m[y1][x1]) pixels += (x1)+'em '+(y1)+'em '+m[y1][x1]+',';
      } 
    }
    this.css({
      'width': '1em',
      'height': '1em',
      'box-shadow': pixels.slice(0,-1),
      'background-color': m[0][0] || 'transparent'
    });
    return this;
  };
})( jQuery );

// Defining my colors as variables to save space.
var r = '#f83800',
    o = '#ffa044',
    w = '#fff',
    b = '#e45c10',
    t = '#ffa044',
    g = '#b8f818',
    l = '#000',
    e = '#008888';

// Link - Green, tan and brown
var link_matrix = [
  [ , , , , ,g,g,g,g,g,g],
  [ , , , ,g,g,g,g,g,g,g,g],
  [ , ,t, ,g,b,b,b,b,b,b,g, ,t],
  [ , ,t, ,b,b,b,b,b,b,b,b, ,t],
  [ , ,t,t,b,t,g,t,t,g,t,b,t,t],
  [ , ,t,t,b,t,b,t,t,b,t,b,t,t],
  [ , , ,t,t,t,t,t,t,t,t,t,t,b],
  [ , , ,g,g,t,t,b,b,t,t,g,g,b],
  [ ,b,b,b,b,b,t,t,t,t,g,g,b,b,b],
  [b,b,t,b,b,b,b,g,g,g,g,g,t,b,b],
  [b,t,t,t,b,b,t,b,b,g,g,t,t,t,b,],
  [b,b,t,b,b,b,t,g,b,b,b,b,t,t,t,],
  [b,b,t,b,b,b,t,b,b,g,g,g,g,t],
  [b,b,b,b,b,b,t,g,g,g,g,g],
  [ ,t,t,t,t,t,b, , ,b,b,b],
  [ , , , ,b,b,b]
];

// The Fire - red, orange and white.
var fire_matrix = [
  [ , , , , , , , , ,r, , , ,r],
  [ , , ,o, ,r, , ,r, , , , ,r],
  [ , ,r, ,r, , ,r,r, ,r],
  [ , ,r, ,r, ,r,r,r,r,r, , ,o],
  [ , , , ,r,r,r,r,r,r,r, ,r],
  [ ,o,r, ,r,r,o,r,r,r, ,r,r, ,r],
  [ ,r,r,r,r,o,r,r,r,r,o,r,r,r,r],
  [ ,r,r,r,r,o,r,o,r,r,r,r,r,r, ,r],
  [ ,r,r,r,o,o,r,o,r,o,r,r,r,r, ,r],
  [r, ,r,o,o,o,o,o,o,r,o,r,r,r,r,r],
  [r,r,r,o,r,o,o,w,o,o,o,o,r,r,r,r],
  [r,r,r,o,o,w,o,w,o,w,o,o,o,r,r],
  [ ,r,r,r,o,o,w,w,w,w,w,o,o,r,r],
  [ ,r,r,r,o,o,w,w,w,w,o,o,r,r],
  [ , ,r,r,r,r,o,o,o,o,o,r,r,r],
  [ , , , , ,r,r,r,r,r,r,r]
];

// The moblin - teal, black and red
var moblin_matrix = [
   [ , ,e,e,e,e, , , , ,e,e,e,e],
   [ , , ,l,e,l,e,e,e,e,l,e,l,r],
   [ , , , , ,r,l,e,e,l,r],
   [ ,r, ,l,e,r,r,l,l,r,r,e],
   [ ,r,l,e,e,e,e,l,l,e,e,e,e],
   [ ,e,l,e,e,r,e,e,e,e,r,e,e,l,r],
   [ ,e,l,e,e,r,l,l,l,l,r,e,e,l,e],
   [e,e,l,e,e,l,e,e,e,e,l,e,e,l,e],
   [e,e,e,l,e,e,e,l,l,e,e,e,l,e,e],
   [e,r,e,l,e,e,e,e,e,e,e,e,l,e,e,e],
   [ ,r,l,l,l,e,e,e,e,e,e,l,e,e,e,e],
   [ ,r,l,r,l,l,l,l,l,l,l,l,e,e,e,e],
   [ , ,l,l,r,r,l,l,l,l,l,r,e,r,e],
   [ , ,e,e,e,l,r,r,r,r,r,l,l,r],
   [ ,e,e,e,e,e,l,l,l,l,l,e,e,r,e],
   [ ,r,e,r,e,r]
];

// Pixelize our divs!
$('.fire').pixelize(fire_matrix);
$('.link').pixelize(link_matrix);
$('.moblin').pixelize(moblin_matrix);
              
            
!
999px

Console