cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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

Quick-add: + add another resource

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.

Quick-add: + add another resource

Code Indentation


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.

image from deviantart.net and video from clipcanvas.com

<!-- background video -->
<div stlye="position:absolute; top:0; left: 0;">
 <video width="1280" height="720" controls autoplay loop id="video-elm">
  <source src="http://www.markpaul.name/dont-delete/front-end-junkie/html5-canvas-see-through/test-clip.mp4">
  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="http://www.markpaul.name/dont-delete/front-end-junkie/html5-canvas-see-through/victorian_red_skull_wallpaper.png" 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);

Loading ..................