LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code

Animated Navicons

CSS
/* ========= Menu Icon Base ======== */
.menu1, .menu2, .menu3, .menu4, .menu5, .menu6 {
  cursor: pointer;
  display: inline-block;
  font-size: 10px;
  height: 6em;
  margin: 2%;
  position: relative;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
  -webkit-transition: 0.2s ease-in-out;
  transition: 0.2s ease-in-out;
  width: 6em;
  -webkit-tap-highlight-color: transparent;
}
.menu1 span, .menu2 span, .menu3 span, .menu4 span, .menu5 span, .menu6 span {
  background: #222;
  border-radius: 2em;
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
  height: 0.8em;
  position: absolute;
  -webkit-transition: 0.2s ease-in-out;
  transition: 0.2s ease-in-out;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* ============ Menu1 ============ */
.menu1 span {
  left: 0;
}
.menu1 span:nth-child(1) {
  top: 1em;
}
.menu1 span:nth-child(2) {
  top: 2.6em;
}
.menu1 span:nth-child(3) {
  top: 4.2em;
}
.open.menu1 span:nth-child(1) {
  -webkit-transform: rotate(45deg) translate(1.1em, 1.1em);
          transform: rotate(45deg) translate(1.1em, 1.1em);
}
.open.menu1 span:nth-child(2) {
  opacity: 0;
}
.open.menu1 span:nth-child(3) {
  -webkit-transform: rotate(-45deg) translate(1.1em, -1.1em);
          transform: rotate(-45deg) translate(1.1em, -1.1em);
}

/* ============ Menu2 ============ */
.menu2 span {
  left: 0;
}
.menu2 span:nth-child(1) {
  top: 2.5em;
}
.menu2 span:nth-child(2) {
  -webkit-transform: rotate(90deg);
          transform: rotate(90deg);
  top: 2.5em;
}
.open.menu2 span:nth-child(2) {
  -webkit-transform: rotate(0deg);
          transform: rotate(0deg);
}

/* ============ Menu3 ============ */
.menu3 span {
  left: 0;
}
.menu3 span:nth-child(1) {
  top: 1em;
}
.menu3 span:nth-child(2) {
  top: 2.6em;
}
.menu3 span:nth-child(3) {
  top: 4.2em;
}
.open.menu3 span:nth-child(1) {
  -webkit-transform: translateY(1.6em);
          transform: translateY(1.6em);
}
.open.menu3 span:nth-child(3) {
  -webkit-transform: translateY(-1.6em);
          transform: translateY(-1.6em);
}

/* ============ Menu4 ============ */
.menu4 span {
  width: 50%;
}
.menu4 span:nth-child(1) {
  border-radius: 2em 0 0 2em;
  left: 0;
  top: 1em;
}
.menu4 span:nth-child(2) {
  border-radius: 0 2em 2em 0;
  top: 1em;
  right: 0;
}
.menu4 span:nth-child(3) {
  left: 0;
  top: 2.6em;
  width: 100%;
}
.menu4 span:nth-child(4) {
  border-radius: 2em 0 0 2em;
  left: 0;
  top: 4.2em;
}
.menu4 span:nth-child(5) {
  border-radius: 0 2em 2em 0;
  right: 0;
  top: 4.2em;
}
.open.menu4 span:nth-child(1) {
  -webkit-transform: rotate(45deg) translate(0.8em);
          transform: rotate(45deg) translate(0.8em);
}
.open.menu4 span:nth-child(2) {
  -webkit-transform: rotate(-45deg) translate(-0.9em);
          transform: rotate(-45deg) translate(-0.9em);
}
.open.menu4 span:nth-child(3) {
  opacity: 0;
}
.open.menu4 span:nth-child(4) {
  -webkit-transform: rotate(-45deg) translate(0.8em);
          transform: rotate(-45deg) translate(0.8em);
}
.open.menu4 span:nth-child(5) {
  -webkit-transform: rotate(45deg) translate(-0.9em);
          transform: rotate(45deg) translate(-0.9em);
}

/* ============ Menu5 ============ */
.menu5 span {
  width: 100%;
}
.menu5 span:nth-child(1) {
  left: 0;
  top: 1em;
}
.menu5 span:nth-child(2) {
  border-radius: 0 2em 2em 0;
  right: 0;
  top: 2.6em;
  width: 50%;
}
.menu5 span:nth-child(3) {
  border-radius: 2em 0 0 2em;
  left: 0;
  top: 2.6em;
  width: 50%;
}
.menu5 span:nth-child(4) {
  left: 0;
  top: 4.2em;
}
.open.menu5 span:nth-child(1) {
  opacity: 0;
}
.open.menu5 span:nth-child(2) {
  border-radius: 2em;
  -webkit-transform: rotate(45deg);
          transform: rotate(45deg);
  width: 100%;
}
.open.menu5 span:nth-child(3) {
  border-radius: 2em;
  -webkit-transform: rotate(-45deg);
          transform: rotate(-45deg);
  width: 100%;
}
.open.menu5 span:nth-child(4) {
  opacity: 0;
}

/* ============ Menu6 ============ */
.menu6 span {
  left: 0;
}
.menu6 span:nth-child(1) {
  top: 2.5em;
}
.menu6 span:nth-child(2) {
  -webkit-transform: rotate(90deg);
          transform: rotate(90deg);
  top: 2.5em;
}
.open.menu6 {
  -webkit-transform: rotate(135deg) translatey(0.3em);
          transform: rotate(135deg) translatey(0.3em);
}

*, *:after, *:before {
  box-sizing: border-box;
}

body {
  background: #ecf0f1;
  overflow-Y: scroll;
  text-align: center;
}

h1 {
  color: #222;
  font-family: 'Roboto', sans-serif;
  font-size: 4em;
}

section {
  margin: 0 auto;
}
JS
$('.icon').on('click', function() {
    $(this).toggleClass('open');
});
Host Instantly Drag and Drop Website Builder

 

Description

Expanding on the work of Bennet Feeley http://codepen.io/bennettfeely/details/twbyA
Term
Mon, 11/27/2017 - 21:57

Related Codes

Pen ID
Pen ID
Pen ID