JSFiddle - React, Tailwind, and code Playground
by afelixj
HTML
<div class="btn-menu"><a href=""><span></span></a></div>
<div class="menu-bg"></div>
CSS
.btn-menu{
width: 30px;
height: 30px;
border: 2px solid red;
position: relative;
z-index: 5;
float: right;
}
.menu-bg {
position: fixed;
left: 0;
top: 0;
bottom: 0;
width: 100%;
z-index: 40;
pointer-events: none;
z-index: 1;
}
.menu-bg:before {
content: '';
height: 1px;
width: 1px;
background: #000;
position: fixed;
right: 30px;
top: 30px;
transition: all ease .3s;
border-radius: 50%;
transform: scale(1);
}
.menu-open .menu-bg:before {
transition: all ease .6s;
transform: scale(500);
border-radius: 50%;
}
JavaScript
var menuButton = document.querySelector('.btn-menu');
menuButton.addEventListener('click', function(e){
e.preventDefault();
document.body.classList.toggle('menu-open');
});