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.


                <div class="video-hero">
	<h1>Expanding Video Hero<span>click play to start</span></h1>
	<a href="#0" class="play"><span>Click to play video</span></a>
	<div class="overlay"></div>
	<img class="vid-cap" src="" alt="Man biking in woods">
	<iframe src=";byline=0&amp;portrait=0&amp;color=57c0d4" width="1060" height="596" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen class="video" aria-hidden="true" tabindex="-1"></iframe>

<div class="sub-hero">
	<h2>Heading Here</h2>
	<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Minima esse dicta, soluta nisi asperiores et perspiciatis, quos nesciunt officiis <a href="#">quod consectetur</a> repellendus magni cupiditate accusamus dolorum blanditiis, maiores expedita. Id.</p>


                @import url(,700);

$babyBear: 320px;
$toddlerBear: 600px;
$mamaBear: 768px;
$papaBear: 993px;
$grandpaBear: 1200px;

html, body {
  height: 100%;

body {
  max-width: 1060px;
  margin: 0 auto;
  font-family: 'Rokkitt', serif;
  font-size: 120%;

.video-hero {
  max-height: 178px;
  position: relative;
  overflow: hidden;
  transition: all 1s ease-in-out;
  background: #000;
  @media(min-width: $toddlerBear){
    max-height: 300px;
  @media(min-width: $mamaBear){
    max-height: 380px;
  h1, .play, .overlay, .video {
    position: absolute;
  h1 {
    top: 10px;
    text-align: center;
    z-index: 155;
    width: 100%;
    color: #fff;
    font-size: 25px;
    span {
      display: block;
      font-size: 80%;
      font-weight: 200;
    @media(min-width: $toddlerBear){
      top: 20px;
      font-size: 60px;
    @media(min-width: $mamaBear){
      top: 40px;
  .play {
    bottom: 10%;
    left: 50%;
    margin-left: -35px;
    z-index: 200;
    color: #fff;
    text-decoration: none;
    background: url("");
    width: 70px;
    height: 70px;
    background-size: 100%;
    span {
      display: inline-block;
      text-indent: -999em;
    &:hover {
      opacity: .8;
    @media(min-width: $toddlerBear){
      bottom: 12%;
    @media(min-width: $mamaBear){
      bottom: 20%;
  .vid-cap { 
    width: 100%; 
    height: auto; 
    z-index: 100;
    position: relative;
  .overlay {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,.5);
    z-index: 150;
  .video {
    top: 0;
    left: 0;
    z-index: 50;

.sub-hero {
  padding: 0 1em;
  margin-bottom: 100px;
  h2 { font-size: 30px; }



	var $parent = $('.video-hero'),
			$video = $parent.find('iframe'),
			$playButton = $(".play"),
			$itemsToFadeOut = $(".vid-cap,.overlay,h1"),
			f = $video[0],
			url = $video.attr('src').split('?')[0],
			activeVideoClass = "video-started";

			// setup fitVids

			// handle play click
				// grab height of video
				var videoHeight = $video.height();
				// add class to hero when video is triggered
				// fade out the play button
				// fade out poster image, overlay, and heading
				// toggle accessibility features
					"aria-hidden" : "false",
					"tabindex" : "0"
				// set focus to video for accessibility control
				// set height of hero based on height of video
				// send play command to Vimeo api

			// send play to vimeo api
			var runCommand = function(cmd){
				var data = {method : cmd};
				f.contentWindow.postMessage(JSON.stringify(data), url);
			// handle resize
				var videoHeight = $video.height();
				if($(".video-started").size() === 1){