Hi I have menu which is three dots with animation. I have to transform to X when I click the three dots. The demo link is: demo
HTML:
<div class="dots">
<div class="dot"></div>
</div>
CSS:
html, body {
height: 100%;
background: black;
}
.dots {
position: absolute;
right: 20px;
}
.dot,
.dot:before,
.dot:after {
position: absolute;
width: 6px;
height: 6px;
border-radius: 20px;
background-color: #fff;
transform: rotate(270deg);
cursor: pointer;
}
.dot {
top: 50px;
right: 0;
}
.dot:before,
.dot:after {
content: "";
}
.dot:before {
right: 10px;
transition: right .3s ease-out;
}
.dot:after {
left: 10px;
transition: left .3s ease-out;
}
.dots:hover .dot:before {
right: -10px;
}
.dots:hover .dot:after {
left: -10px;
}
In the current code on hover the dots moves left to right.What I wanted is on hover the the dots should move from it's position and then transform to X on click. Confused how to fix this I want something like hamberger menu but with the dots instead of three lines. Any suggestions?