Pen Settings

HTML

CSS

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

JavaScript

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

Packages

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.

Behavior

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.

HTML

              
                <!--[if lte IE 9]>
  <style type="text/css">
    .container .overlay.hidden {
      display: none;
    }
  </style>
<![endif]-->

<!--[if IE 8]>
  <style type="text/css">
    .overlay {
      background-color:#2c3e50;
    }
  </style>
<![endif]-->

<div class="container">
  <div class="menu">
    <ul class="links">
      <li>HOME</li>
      <li>ABOUT</li>
      <li>CONTACT</li>
    </ul>
  </div>
  
  <div class="overlay hidden">
    <ul class="options">
      <li class="first label">More Options</li>
      <li class="second">Option A</li>
      <li class="third">Option B</li>
      <li class="fourth">Option C</li>
    </ul>
  </div>
  
  <div class="content">
    <p>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus semper urna id turpis fermentum, in fermentum neque tincidunt. Aliquam erat volutpat. Vestibulum commodo diam massa, quis condimentum erat ultricies vel. In dignissim orci aliquam, rhoncus turpis ultricies, rutrum nisi. Nullam posuere hendrerit dolor, quis pharetra purus tempor vitae. Nam ligula metus, tincidunt quis efficitur quis, aliquam sed nisi. Integer eget arcu in dui fermentum viverra non id ex. In feugiat accumsan condimentum. Mauris sem dui, tempus eu lacinia eu, sodales eget nunc. Morbi pellentesque nisl vel ante malesuada efficitur. Proin vestibulum ex nec mollis gravida.
    </p>
  <p>
Vivamus sed sodales nisl. Integer id velit sit amet neque rhoncus vulputate in sed ex. Quisque sit amet suscipit augue, ac sollicitudin magna. Morbi ut libero ullamcorper, pellentesque metus quis, efficitur augue. Ut blandit faucibus risus vitae pharetra. Sed ante enim, egestas a accumsan a, bibendum vitae orci. Vivamus at erat sit amet nulla ullamcorper lacinia. Integer eleifend auctor interdum. Sed eu turpis in sapien congue bibendum et quis nibh. Maecenas in libero faucibus, varius nulla pulvinar, euismod nibh. Nulla sit amet ex aliquam, venenatis risus id, molestie erat. Nunc mollis, ligula vel laoreet volutpat, nisl urna sollicitudin lorem, a commodo lectus tortor eu tortor.
    </p>
    <p>
Praesent in lorem eget quam vulputate ornare vel et urna. Nam et rutrum ex, eget cursus mi. Praesent lacinia tristique tortor. Quisque nulla lacus, tristique nec ligula eu, pretium viverra dolor. Praesent sit amet pulvinar lectus, finibus hendrerit lorem. Sed porta quam ut tellus aliquet congue. Maecenas placerat scelerisque maximus. Suspendisse vel pretium arcu. Pellentesque eget malesuada purus. Nulla tellus diam, faucibus non eros id, accumsan pulvinar ex. Vivamus ut eleifend sem. Pellentesque elementum sed orci ac fermentum. Vestibulum at egestas ligula. Curabitur sed ornare mi, vel molestie libero. Etiam at elit nec tortor tempor sodales.
    </p>
  </div>
</div>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Raleway);

body {
  background-color:#446CB3;
  font-family: 'Raleway', sans-serif;
}

$navWidth: 200px;
$navLeft: 80px;
$navSize: $navWidth + $navLeft;

$blur: 10px;

.container {
  width:100%;
  height:100%;
  
  .menu {
    background-color:#E4F1FE;
    position:fixed;
    top:0;
    left:$navLeft;
    width:$navWidth;
    height:100%;
    z-index: 2;
    
    ul {
      list-style-type:none;
      height:inherit;
      
      li {
        font-size: 20px;
        transition: all 0.2s ease-in-out;
        -moz-transition: all 0.2s;
        cursor:pointer;
        height:10%;
        
        &:hover {
          color: #4183D7;
        }
      }
    }
  }
  
  .overlay {
    z-index:1;
    background-color:rgba(44, 62, 80, 0.6);
    position:fixed;
    top:0px;
    left:0px;
    width:100%;
    height:100%;
    padding-left: $navSize + 15px;
    transition: all 0.2s ease-in-out;
    -moz-transition: all 0.2s;
    
    .options {
      color:#59ABE3;
      list-style-type:none;
      font-size:30pt;
      
      &:hover {
        li {
          transition: all 0.2s ease-in-out;
          -moz-transition: all 0.2s;
          color: #336E7B;
          
          &.label {
            color: #59ABE3;
          }
        }
      }
      
      li {
        position:relative;
        top:0px;
        
        &:hover {
          color: #59ABE3;
        }
      }
    }
    
    &.hidden {
      z-index:-1;
      opacity:0;
      
      li {
        opacity: 0;
        top:-20px;
      }
    }
    
    .first {
      transition: all 0.2s ease-in-out;
      -moz-transition: all 0.2s;
    }
    
    .second {
      transition: all 0.4s ease-in-out;
      -moz-transition: all 0.4s;
    }
    
    .third {
      transition: all 0.6s ease-in-out;
      -moz-transition: all 0.6s;
    }
    
    .fourth {
      transition: all 0.8s ease-in-out;
      -moz-transition: all 0.8s;
    }
  }
  
  .content {
    padding-left: $navSize + 15px;
    color:#C5EFF7;

    &.blurred {
     -webkit-filter: blur($blur);
     -moz-filter: blur($blur);
     -ms-filter: blur($blur);
     -o-filter: blur($blur);
     -ms-filter: blur($blur);
     filter: blur($blur);
 filter:progid:DXImageTransform.Microsoft.Blur(PixelRadius='$blur');
    }
  }
}
              
            
!

JS

              
                var main = function() {
  setNavListeners();
};

var setNavListeners = function() {
  toggleOverlay($('.menu .links'));
};

var toggleOverlay = function(elements) {
  elements.each(function(i) {
    elements.eq(i).click(function() {
      $('.container .content').toggleClass('blurred');
      $('.container .overlay').toggleClass('hidden');
    })
  });
};

$(document).ready(main);
              
            
!
999px

Console