Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

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


Auto Save

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.


image from and video from

<!-- background video -->
<div stlye="position:absolute; top:0; left: 0;">
 <video width="1280" height="720" controls autoplay loop id="video-elm">
  <source src="">
  Your browser does not support HTML5 video.

<!-- canvas layer -->
<canvas id="window-canvas" height="720" width="1280" style="position: absolute; top:0; left:0;"></canvas>

<!-- hidden foreground image for use by Canvas -->
<img src="" style="position: absolute; top:0; left:0; display:none;" id="bg-one">


                body {
  background-color: #000;
  margin: 0;
  padding: 0;


                function createHolesInBg() {
    // overlay the image on the video and cut holes to see through to the video
    var image = document.getElementById('bg-one');
    var canvas = document.getElementById("window-canvas");
    var ctx = canvas.getContext("2d");
    ctx.drawImage(image, 0, 0);

    // cut the 1st hole
    window.setTimeout(function() {
      ctx.clearRect(50, 50, 300, 200);
    }, 1000);

    // cut the 2nd hole
    window.setTimeout(function() {
      ctx.clearRect(300, 300, 350, 280);
    }, 1500);
    // cut the 3rd hole
    window.setTimeout(function() {
      ctx.clearRect(800, 50, 400, 300);
    }, 2000);

// show video for 5 seconds and then start to cut some holes overlay bg
window.setTimeout(function() {
}, 5000);

// mute the video after 15 seconds as its gets annoying in blog post
window.setTimeout(function() {  
  var video = document.getElementById("video-elm");
video.muted = true;
}, 15000);