JSFiddle - React, Tailwind, and code Playground
by nikolya223
HTML
<div class="box"><span>СПАН</span> </div>
CSS
body {padding:50px;}
.box {
width: 300px;
height: 100px;
border: 1px solid green;
border-radius: 13px;
box-shadow: 0 4px 0px 0px green, 0 0 2px rgba(0,0,0,.3);
}
.active{
box-shadow: 0 4px 0px 0px transparent, 0 0 2px rgba(0,0,0,.3);
margin-top: 2px;
}
.box.active span{
margin-top: 38px;
}
.box span{
display: block;
margin-top: 40px;
position: relative;
text-align: center;
}
JavaScript
$('.box')
.on('mousedown',function(){
$(this).addClass('active');
})
.on('mouseup',function(){
$(this).removeClass('active');
});