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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

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.

            
              <header>
  <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 50 50" version="1.1" class="menu_toggle">
<path d="M 0 9 L 0 11 L 50 11 L 50 9 Z M 0 24 L 0 26 L 50 26 L 50 24 Z M 0 39 L 0 41 L 50 41 L 50 39 Z " />
</svg>
  <nav>
    <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 50 50" version="1.1" class="close">
    <path d="M 7.71875 6.28125 L 6.28125 7.71875 L 23.5625 25 L 6.28125 42.28125 L 7.71875 43.71875 L 25 26.4375 L 42.28125 43.71875 L 43.71875 42.28125 L 26.4375 25 L 43.71875 7.71875 L 42.28125 6.28125 L 25 23.5625 Z "/>
    </svg>
    <ul>
      <li class="nav-one">
        <a>home</a>
      </li>
      <li class="nav-two">
        <a>about</a>
      </li>
      <li class="nav-three">
        <a>blog</a>
      </li>
      <li class="nav-four">
        <a>project</a>
      </li>
    </ul>
  </nav>
</header>
            
          
!
            
              html {
  min-height: 100%;  
}

body{
  font-family: sans-serif;
  background-image: linear-gradient(to top, #9890e3 0%, #b1f4cf 100%);
}

.menu_toggle, 
.close {
  width: 30px;
  height: 30px;
}

.menu_toggle {
  fill: #ffff;
}

.close {
  fill: #000;
}

header {
  float: left;
  display: block;
  margin-right: 2.35765%;
  width: 100%; 
}

header:last-child {
  margin-right: 0; 
}

header nav {
  text-align: center; 
}

header nav ul{ 
  list-style-type: none;
  padding: 0;
  margin-top:30px;
}

header nav li {
  padding: 1em 0;
  border-bottom: 1px solid #999; 
}

header nav li:hover{
  background:#87ED91;
}

header nav li a {
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: bold;
  cursor:pointer;
}

.menu {
  position: absolute;
  left: 1em;
  top: 1em; 
}

nav {
  border-top: 5px solid #87ED91;
  box-shadow: 0 12px 15px 0 rgba(0, 0, 0, 0.24);
  position: absolute;
  height: 100%;
  width: 320px;
  top: 0;
  left: 0;
  overflow: scroll;
  background: #fff;
  transition: transform 0.15s cubic-bezier(0.55, 0.085, 0.68, 0.53);
  transform: translateX(-320px); 
}

.sideMenuToggle {
  transform: translateX(0) !important;
}

.close{
  float: right;
  margin: 7px 18px;
}
            
          
!
            
              const tl = new TimelineMax();
const defaultDirection = {
  alpha: 0,
  xPercent: "-=50", 
  ease: Back.easeOut
};
/*
* direction
* @param {String} direction of the list append 'available: top, bottom, right, left
* @param {String} percent of the offset
*/
const direction = (direction, percent) => {
  switch(direction) {
    case 'top':
      return { ...defaultDirection, xPercent: null, yPercent: percent };
    case 'bottom':
      return {...defaultDirection, xPercent: null, yPercent: percent };
    case 'left':
      return { ...defaultDirection, xPercent: percent };
    case 'right':
      return { ...defaultDirection, xPercent: percent };
  }
}
const menu = (() => {
  const $toggle = document.querySelector('.menu_toggle');
  const $sideMenu = document.querySelector('nav');
  const $close = document.querySelector('.close');
  $toggle.addEventListener('click', () => {
    $sideMenu.classList.toggle('sideMenuToggle');
    tl.staggerFrom('li', .5, direction('left', '-=50'), 0.2);
  });
  $close.addEventListener('click', function(){
    $sideMenu.classList.remove('sideMenuToggle');
  });
})();

            
          
!
999px
Loading ..................

Console