<input type="checkbox" id="hi">
<label class="menu" for="hi">
<div class="bar"></div>
<div class="bar"></div>
<div class="bar"></div>
</label>
* {
box-sizing: border-box;
}
body,
html {
margin: 0;
padding: 0;
}
body {
background: #e78a53; // Just randomly typed this color
}
.menu {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
cursor: pointer;
transition: 0.5s ease;
height: 50px;
&:hover .bar {
box-shadow: 1px 1px 7px 1px RGBa(0, 0, 0, 0.3);
}
.bar {
width: 55px;
height: 10px;
background: #fff;
box-shadow: 1px 1px 3px RGBa(0, 0, 0, 0.4);
border-radius: 2px;
transition: 0.4s ease;
&:not(:first-child) {
margin-top: 10px;
}
}
}
#hi {
position: absolute;
left: -999px;
top: -999px;
}
#hi:checked + .menu {
transform: translate(-50%,-50%) rotatey(180deg);
.bar {
transform: rotatey(180deg) rotatex(360deg);
&:first-child {
transform: rotate(-45deg);
margin-top: 20px;
}
&:nth-child(2) {
opacity: 0;
}
&:nth-child(3) {
margin-top: -30px;
transform: rotate(45deg);
}
}
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.