$("html").on("mousedown", ".ripple-light", function(evt) {
var btnlight = $(evt.currentTarget);
var xx = evt.pageX - btnlight.offset().left;
var yy = evt.pageY - btnlight.offset().top;
var duration1 = 2000;
var animationFrame1, animationStart1;
var animationStep1 = function(timestamp1) {
if (!animationStart1) {
animationStart1 = timestamp1;
}
var frame1 = timestamp1 - animationStart1;
if (frame1 < duration1) {
var easing1 = (frame1/duration1) * (10 - (frame1/duration1));
var circle1 = "circle at " + xx + "px " + yy + "px";
var color1 = "rgba(255, 255, 255, .5)";
var stop1 = 99 * easing1 + "%";
btnlight.css({
"background-image": "radial-gradient(" + circle1 + ", " + color1 + " " + stop1 + ", transparent " + stop1 + ")"
});
animationFrame1 = window.requestAnimationFrame(animationStep1);
} else {
$(btnlight).css({
"background-image": "none"
});
window.cancelAnimationFrame(animationFrame1);
}
};
animationFrame = window.requestAnimationFrame(animationStep1);
});
.btn {
padding: 10px 20px;
background: #2BBBAD;
color: white;
border: 0;
font-size: 15px;
box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12);
cursor: pointer;
border-radius: 4px;
outline: 0;
text-transform: uppercase;
user-select: none;
transition: all .2s;
}
.btn:hover,.btn:focus {
box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2), 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12);
}
.btn:active {
box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12);
}
<script src="https://code.jquery.com/jquery-3.5.1.js" integrity="sha256-QWo7LDvxbWT2tbbQ97B53yJnYU3WhH/C8ycbRAkjPDc=" crossorigin="anonymous"></script>
<button class="btn ripple-light">Hello, World! </button>