Thứ Hai, 14 tháng 12, 2015

Animated Navigation Icons Examples



 
 
 
 
 

.menu1,
.menu2,
.menu3,
.menu4,
.menu5 {
  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;
  width: 6em;
  -webkit-tap-highlight-color: transparent;
}

.menu1 span,
.menu2 span,
.menu3 span,
.menu4 span,
.menu5 span {
  background: #222222;
  border-radius: 2em;
  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);
  -ms-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);
  -ms-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);
  -ms-transform: rotate(90deg);
  transform: rotate(90deg);
  top: 2.5em;
}

.open.menu2 span:nth-child(2) {
  -webkit-transform: rotate(0deg);
  -ms-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);
  -ms-transform: translateY(1.6em);
  transform: translateY(1.6em);
}

.open.menu3 span:nth-child(3) {
  -webkit-transform: translateY(-1.6em);
  -ms-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);
  -ms-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);
  -ms-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);
  -ms-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);
  -ms-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);
  -ms-transform: rotate(45deg);
  transform: rotate(45deg);
  width: 100%;
}

.open.menu5 span:nth-child(3) {
  border-radius: 2em;
  -webkit-transform: rotate(-45deg);
  -ms-transform: rotate(-45deg);
  transform: rotate(-45deg);
  width: 100%;
}

.open.menu5 span:nth-child(4) { opacity: 0; }

Không có nhận xét nào:

Đăng nhận xét