css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

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.

            
              <p><strong>Fast &amp; Agile YouTube Embed</strong><br>Fully responsive and saves over 350kb per video embed.</p>

<!-- START Fast & Agile YouTube Embed by Schoberg.net -->
<div class="youtube" id="FHCYHldJi_g"></div>
<!-- END Fast & Agile YouTube Embed by Schoberg.net -->

<p>Optionally add YouTube parameters into the div's "data-params" to hide controls and more.</p>

<!-- START Fast & Agile YouTube Embed by Schoberg.net -->
<div class="youtube" id="or6vziwuQ2I" data-params="controls=0&showinfo=0&rel=0"></div>
<!-- END Fast & Agile YouTube Embed by Schoberg.net -->

            
          
!
            
              /* START Fast & Agile YouTube Embed by Schoberg.net */
.youtube { /* continer (responsive) */
  position: relative;
  cursor: pointer;
  background: #ccc no-repeat center center / cover; 
  padding-bottom: 56.25%; /* 16:9 */
  height: 0px;
  clear:both;
}

.youtube::before { /* play bubble */
  content: '';
  background: rgba(255, 255, 255, .6);
  height: 80px;
  width: 80px;
  display:block;
  margin: -40px 0 0 -40px;
  border-radius: 100px;
  position: absolute;
  top: 50%;
  left: 50%;
  box-shadow: 0 0 20px 3px rgba(51, 51, 51, .8);
  transition: all .1s ease;
  z-index:1;
}

.youtube:hover::before { /* play bubble hover */
  background: rgba(238, 238, 238, .8);
  box-shadow: 0 0 10px 3px rgba(51, 51, 51, .8);
  width: 100px;
  height: 100px;
  margin: -50px 0 0 -50px;
}

.youtube::after { /* Play Triangle */
  content: '';
  width: 0;
  height: 0;
  line-height:0px;
  display:block;
  border-style: solid;
  border-width: 20px 0 20px 40px;
  margin: -20px 0 0 -15px;
  border-color: transparent transparent transparent #333;
  position: absolute;
  top: 50%;
  left: 50%;
  height: 0;
  width: 0;
  z-index:2;
} 
.youtube iframe{ /* youtube embed (responsive) */
  width:100%;
  height:100%;
  position:absolute;
  top:0;
  left:0;
  z-index:3;
}
/* END Fast & Agile YouTube Embed by Schoberg.net */

/*ignore this*/
body{text-align:center;font-family:arial;color:#333;}
            
          
!
            
              $(document).ready(function() {
// START Fast & Agile YouTube Embed by Schoberg.net
  $(".youtube").each(function() {
    // Set the BG image from the youtube ID
    $(this).css('background-image', 'url(//i.ytimg.com/vi/' + this.id + '/hqdefault.jpg)');
    // Click the video div
    $(document).delegate('#' + this.id, 'click', function() {
      // Build embed URL
      var iframe_url = "//www.youtube.com/embed/" + this.id + "?autoplay=1&autohide=1";
      // Grab extra parameters set on div
      if ($(this).data('params')) iframe_url += '&' + $(this).data('params');
      // Build iframe tag
      var iframe = $('<iframe/>', {'allowfullscreen':'allowfullscreen', 'frameborder': '0', 'src': iframe_url})
      // Replace the YouTube thumbnail with YouTube HTML5 Player
      $(this).append(iframe);
    });// /click
  }); // /each video
// END Fast & Agile YouTube Embed by Schoberg.net
}); // /document ready
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console