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

              
                <div class="nav-toggle">
  <div class="toggle-botton">
    <div class="top-left"></div>
    <div class="top-right"></div>
    <div class="middle"></div>
    <div class="bottom-left"></div>
    <div class="bottom-right"></div>
  </div>
  <h1 class="logo">Logo</h1>
</div>

<div class="overlay">
  <nav class="main-nav">
    <ul>
      <li><a href="#">Home</a></li>
      <li><a href="#">About</a></li>
      <li><a href="#">Blog</a></li>
      <li><a href="#">Work</a></li>
      <li><a href="#">Contact</a></li>
    </ul>
  </nav>
</div>

<div class="tall">
Put the page content here
</div>
              
            
!

CSS

              
                $time: 300ms

body
  background-color: rgba(0,0,0,0.3)  
  
*
  box-sizing: border-box

a
  text-decoration: none
  
h1,h2,h3,h4,h5,h6
  font-weight: 400

.tall
  height: 2000px
  width: 100%
  margin-top: 100px
  font-size: 100px
  margin-left: 10px
  
  
.overlay
  position: fixed
  z-index: 1
  background-color: rgba(0,0,0,1)
  left: 0
  top: 0
  right: 0
  bottom: 0
  opacity: 0
  pointer-events: none
  transition: all $time ease-in-out
  
  .main-nav
    width: 100%
    margin: 100px 0 0 20px
    position: absolute
    top: 20%
    transition: all $time ease-in-out
    
    li
      font-size: 40px
      padding: 10px
      width: auto
        
      a
        color: white
      
  
.nav-toggle
  position: fixed
  top: 20px
  left: 0
  width: 150px
  height: 50px
  background-color: black
  z-index: 2
  
  .toggle-botton
    position: absolute
    height: 100%
    width: 30%
    background-color: red
    cursor: pointer
    display: flex
    align-items: center
    
    .middle
      width: 60%
      height: 3px
      opacity: 1
      position: absolute
      background-color: white
      top: 50%
      left: 50%
      transform: translate(-50%,-50%)
      transition: all $time ease-in-out
      
    
    .top-left
      width: 30%
      height: 3px
      position: absolute
      background-color: white
      top: 30%
      left: 50%
      transform: translate(-100%,-50%)
      transition: all $time ease-in-out
      
    .top-right
      width: 30%
      height: 3px
      position: absolute
      background-color: white
      top: 30%
      left: 50%
      transform: translate(0%,-50%)
      transition: all $time ease-in-out
      
    .bottom-left
      width: 30%
      height: 3px
      position: absolute
      background-color: white
      bottom: 25%
      left: 50%
      transform: translate(-100%,-50%)
      transition: all $time ease-in-out
      
    .bottom-right
      width: 30%
      height: 3px
      position: absolute
      background-color: white
      bottom: 25%
      left: 50%
      transform: translate(0%,-50%)
      transition: all $time ease-in-out
      
  &.is-active
    .toggle-botton
      .middle
        opacity: 0
      .top-left
        top: 30%
        left: 50%
        transform: translate(-70%,-50%) rotate(45deg)
        transform-origin: left center
      .bottom-right
        bottom: 25%
        left: 50%
        transform-origin: right center
        transform: translate(-30%,-50%) rotate(45deg)
      .top-right
        top: 30%
        left: 50%
        transform-origin: right center
        transform: translate(-30%,-50%) rotate(-45deg)   
      .bottom-left
        bottom: 25%
        left: 50%
        transform-origin: left center
        transform: translate(-70%,-50%) rotate(-45deg)                
        
  &.is-active + .overlay
    opacity: 1
    pointer-events: auto    
    .main-nav
      top: 0%
  
  &.is-active .logo
    background-color: white
    color: black
      
.logo
  display: block
  position: absolute
  width: 70%
  height: 100%
  background-color: transparent
  left: 30%
  color: white
  line-height: 50px
  text-align: center
  font-size: 20px
  transition: all $time ease-in-out
  letter-spacing: 5px
    
/*##############################*/
/*####### MEDIA QUERIES #######*/
/*##############################*/

@media screen and (max-width: 600px)
  .tall
    font-size: 40px
    
  .logo
    font-size: 16px
  
  .overlay .main-nav li
    font-size: 30px
              
            
!

JS

              
                $(function(){
  $('.toggle-botton').on('click',function(){
    $('.nav-toggle').toggleClass('is-active')
  })
  
  $('.main-nav li a').on('click',function(){
    $('.nav-toggle').toggleClass('is-active');
  })
})
              
            
!
999px

Console