<input type="checkbox" aria-label="Open the menu">
input {
width: 150px;
aspect-ratio: 1;
display: grid;
box-sizing: border-box;
-webkit-appearance:none;
-moz-appearance:none;
appearance:none;
cursor:pointer;
}
input:before,
input:after {
content:"";
grid-area:1/1;
transition:.3s;
}
input:before {
background:
radial-gradient(closest-side at 12.5% 25%,#000 96%,#0000) 0 0/80% 40%,
linear-gradient(#000 50%,#0000 0) top/80% 40% repeat-y;
}
input:after {
padding: 10%;
background:
radial-gradient(closest-side at 50% 12.5%,#000 96%,#0000) top /20% 80% repeat-y,
radial-gradient(closest-side at 12.5% 50%,#000 96%,#0000) left/80% 20% repeat-x,
conic-gradient(from 90deg at 33% 33%, #0000 90deg, #000 0)
100% 100%/60% 60% padding-box content-box;
transform: translate(-100%) translateZ(0) rotate(45deg);
opacity:0;
}
input:checked:before {
transform: translate(100%);
opacity:0;
}
input:checked:after {
transform: translate(0) translateZ(0) rotate(45deg);
opacity:1;
}
body {
min-height: 100vh;
margin: 0;
display: grid;
place-content: center;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.