<style>
.menuicon {
width: 100%;
height: 100%;
cursor: pointer;
border-radius: 50%;
border: none;
outline: none;
position: relative;
padding: 0;
}
.menubg {
background-color: #000;
position: absolute;
width: 100%;
height: 100%;
border-radius: 50%;
z-index: -1;
pointer-events: none;
transition: all 1.0s ease-in-out;
transition-delay: 0.5s;
}
.menuicon.mvleft .menubg{
transform:scale(50);
}
.menuicon span {
position: absolute;
width: 40px;
height: 4px;
top: 50%;
left: 50%;
background: #fff;
border-radius: 2px;
overflow: hidden;
transition: all 0.3s linear;
}
.menuicon span::before {
content: "";
position: absolute;
width: 0;
height: 100%;
top: 0;
right: 0;
background: gray;
transition: all 0.3s linear;
}
.menuicon span:nth-child(1) {
animation: span-first-off 0.5s ease-in-out;
animation-fill-mode: forwards;
}
.menuicon span:nth-child(2) {
animation: span-second-off 0.5s ease-in-out;
animation-fill-mode: forwards;
}
.menuicon span:nth-child(3) {
animation: span-third-off 0.5s ease-in-out;
animation-fill-mode: forwards;
}
.mvleft:hover span::before {
width: 100%;
transition: all 0.3s linear;
}
.mvleft span:nth-child(1) {
animation: span-first-on 0.5s ease-in-out;
animation-fill-mode: forwards;
}
.mvleft span:nth-child(2) {
animation: span-second-on 0.5s ease-in-out;
animation-fill-mode: forwards;
}
.mvleft span:nth-child(3) {
animation: span-third-on 0.5s ease-in-out;
animation-fill-mode: forwards;
}
@keyframes span-first-on {
0% {
transform: translate(-50%, -300%);
}
30% {
transform: translate(-50%, -50%);
}
100% {
transform: translate(-50%, -50%) rotate(-45deg);
}
}
@keyframes span-first-off {
0% {
transform: translate(-50%, -50%) rotate(-45deg);
}
30% {
transform: translate(-50%, -50%) rotate(0deg);
}
100% {
transform: translate(-50%, -300%);
}
}
@keyframes span-second-on {
0% {
transform: translate(-50%, -50%);
}
25% {
background: gray;
}
50% {
transform: translate(-50%, -50%) scale(1);
}
100% {
transform: translate(-150%, -50%) scale(0);
}
}
@keyframes span-second-off {
0% {
transform: translate(-150%, -50%) scale(0);
}
25% {
background: gray;
}
50% {
transform: translate(-50%, -50%) scale(1);
}
100% {
transform: translate(-50%, -50%);
}
}
@keyframes span-third-on {
0% {
transform: translate(-50%, 200%);
}
30% {
transform: translate(-50%, -50%);
}
100% {
transform: translate(-50%, -50%) rotate(45deg);
}
}
@keyframes span-third-off {
0% {
transform: translate(-50%, -50%) rotate(45deg);
}
30% {
transform: translate(-50%, -50%) rotate(0deg);
}
100% {
transform: translate(-50%, 200%);
}
}
</style>