Pen Settings



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


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


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.


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.


                <canvas height="400" id="c" width="800"></canvas>




// Install emsdk, source ./
// Save this C code as minimal.c, then run:
// emcc minimal.c -Os -o minimal.js && base64 -w0 minimal.wasm > minimal.wasm.base64
// Copy the base64 file contents into base64data below.
#define HEIGHT 400
#define WIDTH 800
#include <emscripten.h>

int data[WIDTH * HEIGHT];
int red = (255 << 24) | 255;

   for (int y = 0; y < HEIGHT; y++) {
     int yw = y * WIDTH;
     for (int x = 0; x < WIDTH; x++) {
       data[yw + x] = red;
   return &data[0];

const width = 800;
const height = 400;

// Contains the actual webassembly

const decode = (b64) => {
  const str = window.atob(b64);
  const array = new Uint8Array(str.length);
  for(let i = 0; i < str.length; i++) {
    array[i] = str.charCodeAt(i);
  return array.buffer;

const memSize = 256;
const memory = new WebAssembly.Memory({initial: memSize, maximum: memSize});

const instance = new WebAssembly.Instance(
  new WebAssembly.Module(new Uint8Array(decode(base64data))),
  { env: { memory } }

// Get 2d drawing context
const ctx = document.getElementById('c').getContext('2d');
const pointer = instance.exports._render();
const data = new Uint8ClampedArray(memory.buffer, pointer, width * height * 4);
const img = new ImageData(data, width, height);
ctx.putImageData(img, 0, 0);