JSFiddle - React, Tailwind, and code Playground
by tjnicolaides
HTML
<div class="circle-button"></div>
CSS
body {
background: #333;
}
.circle-button {
width: 250px;
height: 250px;
border-radius: 50%;
position: relative;
box-shadow: 0 1px 2px rgba(0,0,0,0.1);
cursor: default;
background: #7FFFA5;
margin: 50px auto;
}
.circle-button.active {
-webkit-animation: aniBoth 2s linear;
}
.circle-button.stop {
background: red;
}
@-webkit-keyframes aniBoth {
0% { -webkit-transform: scale(1.0); }
5% { -webkit-transform: scale(0.8); }
55% { -webkit-transform: scale(10.0); }
100% { opacity: 0; }
}
JavaScript
$('.circle-button').on('click', function(){
var $btn = $(this);
$btn.addClass('active');
setTimeout(function(){
$btn.toggleClass('stop');
$btn.removeClass('active');
}, 2000);
});