LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

CSS
@-webkit-keyframes slideInLeft {
  0% {
    -webkit-transform: translate3d(-250px, 0, 0);
            transform: translate3d(-250px, 0, 0);
    visibility: visible;
  }
  100% {
    -webkit-transform: translate3d(0, 0, 0);
            transform: translate3d(0, 0, 0);
  }
}
@keyframes slideInLeft {
  0% {
    -webkit-transform: translate3d(-250px, 0, 0);
            transform: translate3d(-250px, 0, 0);
    visibility: visible;
  }
  100% {
    -webkit-transform: translate3d(0, 0, 0);
            transform: translate3d(0, 0, 0);
  }
}
@-webkit-keyframes slideOutLeft {
  0% {
    -webkit-transform: translate3d(0, 0, 0);
            transform: translate3d(0, 0, 0);
  }
  100% {
    -webkit-transform: translate3d(-250px, 0, 0);
            transform: translate3d(-250px, 0, 0);
    visibility: hidden;
  }
}
@keyframes slideOutLeft {
  0% {
    -webkit-transform: translate3d(0, 0, 0);
            transform: translate3d(0, 0, 0);
  }
  100% {
    -webkit-transform: translate3d(-250px, 0, 0);
            transform: translate3d(-250px, 0, 0);
    visibility: hidden;
  }
}
* {
  box-sizing: border-box;
}

body:after {
  background: white;
  content: '';
  height: 100%;
  left: 0;
  opacity: 0;
  overflow: auto;
  padding: 0;
  position: absolute;
  top: 0;
  -webkit-transition: all 0.4s ease;
  transition: all 0.4s ease;
  width: 100%;
}
body.open {
  overflow: hidden;
}
body.open:after {
  opacity: 1;
  visibility: visible;
}

.b-nav {
  position: absolute;
  z-index: 11;
}
.b-nav:not(.open) {
  visibility: hidden;
}
.b-nav li {
  color: #444444;
  list-style-type: none;
  padding: 10px;
  text-align: left;
  -webkit-transform: translateX(-250px);
          transform: translateX(-250px);
}
.b-nav li:not(.open) {
  -webkit-animation-duration: 0.4s;
          animation-duration: 0.4s;
  -webkit-animation-fill-mode: both;
          animation-fill-mode: both;
  -webkit-animation-name: slideOutLeft;
          animation-name: slideOutLeft;
}
.b-nav li:first-child {
  padding-top: 120px;
}
.b-nav.open {
  visibility: visible;
}
.b-nav.open li {
  -webkit-animation-duration: 0.4s;
          animation-duration: 0.4s;
  -webkit-animation-fill-mode: both;
          animation-fill-mode: both;
  -webkit-animation-name: slideInLeft;
          animation-name: slideInLeft;
}

.b-link {
  background: transparent;
  border-left: rgba(68, 68, 68, 0) solid 2px;
  color: #444444;
  font-family: Helvetica-Neue, Helvetica, Arial, sans-serif;
  font-size: 24px;
  font-weight: 300;
  margin-left: 30px;
  text-decoration: none;
  -webkit-transition: all 0.4s ease;
  transition: all 0.4s ease;
  width: auto;
}
.b-link:hover, .b-link--active {
  border-left: #444444 solid 2px;
  padding-left: 30px;
}

.b-menu {
  background: white;
  border: white solid 2px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-block;
  height: 60px;
  padding-left: 15.5px;
  padding-top: 17.5px;
  position: relative;
  -webkit-transition: all 0.4s ease;
  transition: all 0.4s ease;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
  width: 60px;
  z-index: 12;
}
.b-menu:hover {
  border: #444444 solid 2px;
}

.b-bun {
  background: #444444;
  position: relative;
  -webkit-transition: all 0.4s ease;
  transition: all 0.4s ease;
}
.b-bun--top {
  height: 2px;
  top: 0;
  width: 25px;
}
.b-bun--mid {
  height: 2px;
  top: 8px;
  width: 25px;
}
.b-bun--bottom {
  height: 2px;
  top: 16px;
  width: 25px;
}

.b-brand {
  color: white;
  font-family: Helvetica-Neue, Helvetica, Arial, sans-serif;
  font-size: 24px;
  font-weight: 300;
  margin-left: 30px;
  position: relative;
  text-decoration: none;
  top: -21.42857px;
  -webkit-transition: all 0.4s ease;
  transition: all 0.4s ease;
  z-index: 13;
}

.b-container {
  height: 60px;
  left: 30px;
  position: absolute;
  top: 30px;
}
.b-container:hover:not(.open) .bun-top,
.b-container:hover:not(.open) .bun-mid,
.b-container:hover:not(.open) .bun-bottom {
  background: white;
}
.b-container.open .b-main {
  border: #444444 solid 2px;
}
.b-container.open .b-bun--top {
  background: #444444;
  top: 9px;
  -webkit-transform: rotate(45deg);
          transform: rotate(45deg);
}
.b-container.open .b-bun--mid {
  opacity: 0;
}
.b-container.open .b-bun--bottom {
  background: #444444;
  top: 5px;
  -webkit-transform: rotate(-45deg);
          transform: rotate(-45deg);
}
.b-container.open .b-brand {
  color: #444444;
}
JS
'use strict';

(function() {
  var body = document.body;
  var burgerMenu = document.getElementsByClassName('b-menu')[0];
  var burgerContain = document.getElementsByClassName('b-container')[0];
  var burgerNav = document.getElementsByClassName('b-nav')[0];

  burgerMenu.addEventListener('click', function toggleClasses() {
    [body, burgerContain, burgerNav].forEach(function (el) {
      el.classList.toggle('open');
    });
  }, false);
})();

Description

Download it for use on you next website with bower (bower install burger)
Term
Mon, 11/27/2017 - 21:29

Related Codes

Pen ID
Pen ID
Pen ID
Square Adv