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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                #cover
nav#main-nav
  #nav-button
    span.fa.fa-navicon
  ul#nav-list
    li
      a(href="#") Nav Item 1
    li
      a(href="#") Nav Item 2
    li
      a(href="#") Nav Item 3
    li
      a(href="#") Nav Item 4
    li
      a(href="#") Nav Item 5
 
// Extra  
#content
  h1 Navigation Experiment

              
            
!

CSS

              
                @import "compass/css3";

@import url(https://fonts.googleapis.com/css?family=Noto+Sans);
  
*, *:before, *:after {  box-sizing: border-box; }

html, body {
  height: 100%;
  width: 100%;
}

$button-color: #65d3e3;
$top-grad: #2c3e50  ;
$bottom-grad: #51606f;

body{
  background: #fff;
  font-family: 'Noto Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

// Cover content with overlay when navigation is triggered. It would be nice to close the navigation if the overlay is clicked, but I am not sure how to code that.
#cover{
  opacity: 0;
  visibility: hidden;
  width: 100%;
  height: 100%;
  position: fixed;
  z-index: 1;
  transition: opacity 0.2s ease-in-out;

  &.display{
    background: rgba(0,0,0,0.2);
    opacity: 1;
    visibility: visible;
  }
}

#main-nav{
  background: linear-gradient(to bottom, $top-grad 0%, $bottom-grad 100%);
  z-index:1;
  height: 100%;
  width: 5em;
  position: fixed;
  overflow: hidden;
  transition: background 0.3s ease-in-out,
    width 0.3s ease;
  &.show{
    background: $button-color;
    width: 18em;
  }
}

#nav-button{
  background: $button-color;
  height: 3em;
  width: 3em; 
  border-radius: 50%;
  box-shadow: 0 2px 5px 0 rgba(0,0,0,.25);
  top: 1em;
  left: 1em;
  position: relative;
  user-select: none;
  color: #333;
  transition: all 0.3s ease-in-out;
  overflow: hidden;
  
  .fa{
    position: absolute;
    top: 0;
    left: 0.2em;
    right: 0;
    bottom: 0;
    margin: auto;
    display: block;
    width: 1em;
    height: 1em;
    font-size: 1em;
    opacity: 1;
    transition: opacity 0.4s ease-in-out;
  }
  
  &:hover{
    cursor:pointer;
    box-shadow: 0 7px 15px 0 rgba(0,0,0,.3);
    color: #222;
  }
  
  &.width{ 
    width: 80em;
    height: 80em;
    top: -37.5em;
    left: -37.5em;
    box-shadow: none;
    //animation: curve 1s linear;
    //animation-fill-mode: forwards;
    
    &:before {
      content:'';
      display: block;
      width: 0.4em;
      height: 0.4em;
      border-radius: 50%;
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      margin: auto;
      animation: color 0.3s linear;
    }
  }
}

@keyframes color {
  0% {
      box-shadow: 0;
	}
	30% {
      box-shadow: 0 0 10px 25px rgba(12,121,137,0.5); /* feather / spread */
	}
}

/*@keyframes curve {
  0% {
		transform: rotate(0deg)
		           translate(0px)
		           rotate(0deg);
	}
	100% {
		transform: rotate(60deg)
		           translate(200px) 
		           rotate(-60deg);
	}
}*/

#nav-list{
  position: absolute;
  top: 7em; 
  padding: 0 0 0 2em;
  opacity: 0;
  width: 100%;
  transition: opacity 0.2s ease;
  //transition-delay: 0s;

  a{
    color: #444;
    text-decoration: none;
    font-size: 0.9em;
    display: block;
    width :100%;
    padding: 1.2em 0;
    transition: color 0.2s ease-in-out;
    &:hover{
      color: #000;
    }
  }
  
  &.nav-show{
    opacity: 1;
  }
}

// Extras
#content{
  padding: 0 0 0 7em;
  h1{
    padding: 1.25em 0;
    letter-spacing: 0.03em;
    font-size: 1.4em;
  }
}
              
            
!

JS

              
                // My poor javascript skillz.
$('#nav-button').click( function(){
    $(this).toggleClass('width');
    $(this).parent().toggleClass('show');
    $(this).children().toggleClass( 'fa-navicon').toggleClass( 'fa-close');
    $('#nav-list').toggleClass('nav-show'); $('#cover').toggleClass('display'); 
});
              
            
!
999px

Console