.hamburger.demo
.stripe
.stripe
.stripe
View Compiled
// Colors:
$first-gradient-color: #A6FFA7;
$second-gradient-color: #A6DAFF;
$third-gradient-color: #BCA6FF;
// Proportions:
$icon-height: 30px;
$rotate-reverse: true;
html,
body {
height: 100%;
}
body {
margin: 0;
background: linear-gradient(45deg, $first-gradient-color, $second-gradient-color, $third-gradient-color);
}
.hamburger {
position: relative;
width: $icon-height * 1.4;
height: $icon-height;
cursor: pointer;
}
.demo {
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.stripe {
position: absolute;
width: 100%;
height: 20%;
background: #333;
transition: all .3s,
top .2s,
opacity .2s;
}
.stripe:first-child {
top: 0;
}
.stripe:nth-child(2) {
top: 40%;
}
.stripe:last-child {
top: 80%;
}
.hamburger:hover .stripe:first-child {
top: 40%;
transform: rotate(45deg);
}
.hamburger:hover .stripe:nth-child(2) {
opacity: 0;
}
.hamburger:hover .stripe:last-child {
top: 40%;
@if $rotate-reverse {
transform: rotate(135deg);
} @else {
transform: rotate(-45deg);
}
}
View Compiled
// Nothing here
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.