Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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

              
                <div class="header_sp_nav">
  <span class="nav_line nav_line1"></span>
  <span class="nav_line nav_line2"></span>
  <span class="nav_line nav_line3"></span>
</div>

              
            
!

CSS

              
                body{
  background:#333;
  width:100%;
  height:100%;
}
/*header_sp_nav=====*/
.header_sp_nav{
    width: 50px;
    height: 46px;
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    left:0;
    margin:auto;
    cursor: pointer;
}
.nav_line{
    display: block;
    width: 50px;
    height: 2px;
    background: #fff;
    -webkit-transition: .3s;
    transition: .3s;
}
.nav_line1{
    transform:translateY(0px);
    animation: line1_de 1s ease 0s 1 alternate;
}
@keyframes line1_de{
    0%{
      transform:translateY(22px) rotate(45deg);
    }
  10%{
      transform:translateY(22px) rotate(0deg);
    
    }
    30%{
      transform:translateY(22px) rotate(0deg);
      
    }
    100%{
      transform:translateY(0px);
    }
}
.nav_line2{
    opacity:1;
    transform:translateY(20px);
    animation: line2_de 1s ease 0s 1 alternate; 
}
@keyframes line2_de {
  0%{
    opacity:0;
  }
  90%{
    opacity:1;
  }
}
.nav_line3{
    animation: line3_de 1s ease 0s 1 alternate;
    transform:translateY(40px);
  
}
@keyframes line3_de{
    0%{
      transform:translateY(18px) rotate(-45deg);
    }
    30%{
      transform:translateY(18px) rotate(0deg);
      
    }
    100%{
      transform:translateY(40px);
    }
}
.header_sp_nav.active{
    .nav_line2{
        opacity:0;
        animation: line2 1s ease 0s 1 alternate;
    }
  @keyframes line2{
    0%{
      opacity:1;
    }
    40%{
      opacity:0;
    }
  }
    .nav_line1{
        animation: line1 1s ease 0s 1 alternate;
        transform:translateY(22px) rotate(45deg);

    }
  @keyframes line1{
    0%{
      transform:translateY(0px) rotate(0deg);
    }
    30%{
      transform:translateY(22px) rotate(0deg);
      
    }
    100%{
      transform:translateY(22px) rotate(45deg);
    }
  }
    .nav_line3{
        animation: line3 1s ease 0s 1 alternate;
        transform:translateY(18px) rotate(-45deg);
    }
    @keyframes line3{
    0%{
       transform:translateY(40px) rotate(0deg);
      }
      30%{
        transform:translateY(18px) rotate(0deg);  
      }
    100%{
        transform:translateY(18px) rotate(-45deg);
    }
  }
}

              
            
!

JS

              
                $(function(){  
        var sp_nav = $('.header_sp_nav');
        var nav =$('.nav');


        sp_nav.on('click',function(){
            nav.slideToggle();
            sp_nav.toggleClass('active');
        });

});

              
            
!
999px

Console