css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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

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

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <input type="checkbox" role="button" title="menu" id="nav_check" />
<label for="nav_check" class="burger wrapper" aria-hidden="true" title="menu">
  <span class="burger box">
    <span class="burger inner"></span>
  </span>
</label>
<nav>
  <ul>
    <li><a href="#">Home</a></li>
    <li><a href="#">About</a></li>
    <li><a href="#">Projects</a></li>
    <li><a href="#">Products</a></li>
    <li><a href="#">Company</a></li>
  </ul>
</nav>
<main class="main">
  <section id="content">
    <article>
    <h1>Sliding side menu with pure CSS</h1>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam quis purus et ex luctus accumsan. Nulla maximus ac neque quis ultrices. Sed volutpat congue ipsum, quis vestibulum odio sodales et. Suspendisse vel posuere eros. Morbi faucibus nulla urna, id vehicula tortor posuere vitae. Donec non convallis neque. Donec id turpis sed metus lacinia vehicula.</p>
      
      <p>Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.</p>
    </article>
  </section>
</main>

            
          
!
            
              // ******************************
// Normalize (ignore me!)
// ******************************
$fonts:Lato,Arial,"Hiragino Kaku Gothic Pro W3",Meiryo,sans-serif;
$bg_color:#333;
$font_color:#ccc;
$link_color:#ccc;
$link_hover_color:#aaa;

* {
  &:before,
  &:after{
    box-sizing:border-box;
    padding:0;
    margin:0;
  }
}
body{
  font-family:$fonts;
  color: $font_color;
  text-align: center;
  margin:0;
  overflow-x:hidden;
  background-color:#fff;
  a, a:visited{
    color: $link_color;
    text-decoration:none;
  }
  a:hover{
    color: $link_hover_color;
  }
}
// ******************************
// End of Normalize
// ******************************

// For extend styles
%burger_common {
  display:block;
  position:absolute;
  width:40px;
  height:4px;
  border-radius:2px;
  background-color:#fff;
}
%transition_all_04s_easeinout {
  transition:all .3s ease-in-out;
}
%backface_visibility_hidden{
  backface-visibility:hidden;
  -webkit-backface-visibility:hidden;
}

// Main style
main {
  margin: 0 auto;
  transform-style:preserve-3d;
  transform:perspective(500px);
  
  #content {
    position:relative;
    top:0;
    padding:38vh 10vw 20vh;
    background-color:$bg_color;
    @extend %transition_all_04s_easeinout;
    @extend %backface_visibility_hidden;
  }
  article {
    h1 {
      font-size:45px;
      font-weight:bold;
      margin:0 0 100px 0;
    }
  }
}

.burger{
  display:inline-block;
  &.wrapper{
    position:absolute;
    top:0;
    left:0;
    cursor:pointer;
    
    // Page overlay on mouseover
    &::before{
      content:'';
      position:fixed;
      top:0;
      left:0;
      width:100%;
      height:100%;
      z-index:1;
      background-color:rgba(#000, 0.4);
      pointer-events:none;
      @extend %transition_all_04s_easeinout;
      @extend %backface_visibility_hidden;
      opacity:0;
    }
  }
  &.box{
    position:fixed;
    width:40px;
    height:24px;
    padding:15px;
    z-index:3;
  }
  &.inner{
    @extend %burger_common;
    top:50%;
    margin-top:-2px;
    transition:all .3s cubic-bezier(.55,.055,.675,.19);
    &::before,
    &::after{
      @extend %burger_common;
      content:'';
    }
    &::before{
      top:-10px;
      transition:top .1s .34s ease-in, opacity .1s ease-in-out;
    }
    &:after{
      bottom:-10px;
      transition:bottom .1s .34s ease-in, transform .3s cubic-bezier(.55,.055,.675,.19), -webkit-transform .3s cubic-bezier(.55,.055,.675,.19);
    }
  }
}

nav {
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
  width:25vw;
  overflow-y:scroll;
  -ms-overflow-style:none;
  text-align:left;
  background-color:#000;
	z-index: 2;
  transform:translateX(-100%);
  @extend %transition_all_04s_easeinout;
  @extend %backface_visibility_hidden;
  &::-webkit-scrollbar{
    display:none;
  }
  ul {
    list-style-type:none;
    padding:0;
    margin:80px 0 0;
    transform:translateX(-100%);
    transition:all .3s cubic-bezier(0.49, 0.24, 0, 1.32) .2s;
    @extend %backface_visibility_hidden;
    li {
      line-height:1.2;
      a{
        display:block;
        padding:10px 5vw;
        margin:12px 0;
      }
    }
  }
}

#nav_check{
  position:absolute;
  visibility:hidden;
  
  // When the menu has shown
  &:checked {
    & + .burger{
      &.wrapper{
        &::before{
          opacity: 1;
          pointer-events: auto;
        }
      }
      
      .inner{
        transition:all .3s cubic-bezier(.215,.61,.355,1) .14s;
        transform:rotate(225deg);
        &::before{
          top:0;
          opacity:0;
          transition:top .1s ease-out, opacity .1s .14s ease-out;
        }
        &::after{
          bottom:0;
          transition:bottom .1s ease-out,transform .3s .14s cubic-bezier(.215,.61,.355,1), -webkit-transform .3s .14s cubic-bezier(.215,.61,.355,1);
          transform:rotate(-90deg);
        }
      }
   }
    
    & ~ nav {
      transform:translateX(0);
      ul {
        transform:translateX(0);
      }
    }
    
    & ~ main #content {
      transform-origin: left center;
      transform:translateX(15vw) translateZ(-20vw) rotateY(-13deg);
      filter:blur(3px);
    }
  }
}


            
          
!
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