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.

+ add another resource

Looking for quick-add? Try the external resource search, it's quicker and gives you access to the most recent version of thousands of libraries. ☝️

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

Looking for quick-add? Try the external resource search, it's quicker and gives you access to the most recent version of thousands of libraries. ☝️

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.

            
              <nav>
  <ul>
    <li>Home</li>
    <li>About me</li>
    <li>Blog</li>
    <li>Contact</li>
  </ul>
</nav>
<div class="openNav">
  <div class="icon"></div>
</div>

<div class="wrapper">
  <section>
    <h1>Material design navigation</h1>
    <h2>By Lewi Hussey</h2>
    
    <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus.</p>

    <p>Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. Donec sodales sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit cursus nunc, quis gravida magna mi a libero.</p>

    <p>Fusce vulputate eleifend sapien. Vestibulum purus quam, scelerisque ut, mollis sed, nonummy id, metus. Nullam accumsan lorem in dui. Cras ultricies mi eu turpis hendrerit fringilla. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In ac dui quis mi consectetuer lacinia. Nam pretium turpis et arcu. Duis arcu tortor, suscipit eget, imperdiet nec, imperdiet iaculis, ipsum. Sed aliquam ultrices mauris. Integer ante arcu, accumsan a, consectetuer eget, posuere ut, mauris. Praesent adipiscing. Phasellus ullamcorper ipsum rutrum nunc. Nunc nonummy metus. Vestibulum volutpat pretium libero. Cras id dui. Aenean ut eros et nisl sagittis vestibulum.</p>

    <p>Nullam nulla eros, ultricies sit amet, nonummy id, imperdiet feugiat, pede. Sed lectus. Donec mollis hendrerit risus. Phasellus nec sem in justo pellentesque facilisis. Etiam imperdiet imperdiet orci. Nunc nec neque. Phasellus leo dolor, tempus non, auctor et, hendrerit quis, nisi. Curabitur ligula sapien, tincidunt non, euismod vitae, posuere imperdiet, leo. Maecenas malesuada. Praesent congue erat at massa. Sed cursus turpis vitae tortor. Donec posuere vulputate arcu. Phasellus accumsan cursus velit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed aliquam, nisi quis porttitor congue, elit erat euismod orci, ac placerat dolor lectus quis orci. Phasellus consectetuer vestibulum elit.</p>

    <p>Aenean tellus metus, bibendum sed, posuere ac, mattis non, nunc. Vestibulum fringilla pede sit amet augue. In turpis. Pellentesque posuere. Praesent turpis. Aenean posuere, tortor sed cursus feugiat, nunc augue blandit nunc, eu sollicitudin urna dolor sagittis lacus. Donec elit libero, sodales nec, volutpat a, suscipit non, turpis. Nullam sagittis. Suspendisse pulvinar, augue ac venenatis condimentum, sem libero volutpat nibh, nec pellentesque velit pede quis nunc. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Fusce id purus. Ut varius tincidunt libero. Phasellus dolor. Maecenas vestibulum mollis diam. Pellentesque ut neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. In dui magna, posuere eget, vestibulum et, tempor auctor, justo. In ac felis quis tortor malesuada pretium. Pellentesque auctor neque nec urna. Proin sapien ipsum, porta a, auctor quis, euismod ut, mi. Aenean viverra rhoncus pede. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut non enim eleifend felis pretium feugiat. Vivamus quis mi. Phasellus a est. Phasellus magna. In hac habitasse platea dictumst. Curabitur at lacus ac velit ornare lobortis. Curabitur a felis in nunc fringilla tristique.</p>
  </section>
</div>
            
          
!
            
              *{
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

body{
  font-family: 'Roboto', sans-serif;
  color: lighten(black, 40%);
  line-height: 1.5em;
  position: relative;
}

.navOpen{
  overflow: hidden;
}

.wrapper{
  transition-duration: 0.5s;
  transition-timing-function: swing;
  background-color: white;
  width: 100%;
  height: 100%;
  position: relative;
  padding: 100px 40px;
  
  &.open{
    transform: translateX(250px)  translateY(50px);
    -webkit-transform: translateX(250px)  translateY(50px);
    box-shadow: 0 0 50px fade(black, 20%);
  }
  
  section{
    max-width: 600px;
    margin: 0 auto;
    
    h1{
      font-weight: 300;
      font-size: 30px;
      margin-bottom: 10px;
    }
    
    h2{
      font-weight: 300;
      font-size: 20px;
      margin-bottom: 40px;
    }
    
    p{
      margin-bottom: 40px;
    }
  }
}

.openNav{
  transition-duration: 0.5s;
  transition-timing-function: swing;
  width: 50px;
  height: 50px;
  background-color: #14B9FF;
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 9;
  
  &:hover{
    cursor: pointer;
  }
  
  .icon{
    transition-duration: 0.2s;
    position: absolute;
    width: 30px;
    height: 2px;
    background-color: white;
    top: 24px;
    left: 10px;
    
    &:before, &:after{
      transition-duration: 0.5s;
      background-color: white;
      position: absolute;
      content: "";
      width: 30px;
      height: 2px;
      left: 0px;
    }
    
    &:before{
      top: -7px;
    }
    
    &:after{
      top: 7px;
    }
  }
  
  &.open{
    transform: translateX(250px) translateY(50px);
    
    -webkit-transform: translateX(250px) translateY(50px);
    
    .icon{
      background-color: transparent;
      
      &:before, &:after{
        top: 0;
      }
      
      &:before{
        transform: rotate(-45deg);
        -webkit-transform: rotate(-45deg);
      }
      
      &:after{
        transform: rotate(45deg);
        -webkit-transform: rotate(45deg);
      }
    }
  }
}

nav{
  background-color: #14B9FF;
  width: 100%;
  height: 100%;
  position: fixed;
  left: 0;
  top: 0;
  
  ul{
    width: 250px;
    margin-top: 50px;
    
    &:hover{
      li{
        color: fade(white, 50%);
      }
    }
    
    li{
      transition-duration: 0.25s;
      display: block;
      padding: 5px 40px;
      color: white;
      letter-spacing: 0.02em;
      text-align: right;
      
      &:hover{
        cursor: pointer;
        color: white;
      }
    }
  }
  
  &.open{
  }
}
            
          
!
            
              $(".openNav").click(function() {
  $("body").toggleClass("navOpen");
  $("nav").toggleClass("open");
  $(".wrapper").toggleClass("open");
  $(this).toggleClass("open");
});
            
          
!
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