JSFiddle - React, Tailwind, and code Playground
by Igor Mello
HTML
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<pre>
<a href="#"><span id="badgeAnimation" class="badge"> </span></a>
</pre>
<button id="doIt">Do it!</button>
<button id="stopAnimation" >Stop</button>
CSS
/* Ripple Out */
@-webkit-keyframes hvr-ripple-out {
100% {
top: -12px;
right: -12px;
bottom: -12px;
left: -12px;
opacity: 0;
}
}
@keyframes hvr-ripple-out {
100% {
top: -12px;
right: -12px;
bottom: -12px;
left: -12px;
opacity: 0;
}
}
.hvr-ripple-out {
display: inline-block;
vertical-align: middle;
-webkit-transform: translateZ(0);
transform: translateZ(0);
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
-moz-osx-font-smoothing: grayscale;
position: relative;
border:1px solid black;
border-radius:35px;
animation-iteration-count: infinite;
}
.hvr-ripple-out:before {
content: '';
position: absolute;
border: #e1e1e1 solid 6px;
top: 0;
right: 0;
bottom: 0;
left: 0;
-webkit-animation-duration: 1s;
animation-duration: 1s;
border:1px solid black;
border-radius:35px;
animation-iteration-count: infinite;
}
.hvr-ripple-out:before {
-webkit-animation-name: hvr-ripple-out;
animation-name: hvr-ripple-out;
}
.badge{background-color:black;}
JavaScript
$("#doIt").click(function()
{
//Start animação
//alert("ok");
$("#badgeAnimation").addClass('hvr-ripple-out');
});
$("#stopAnimation").click(function()
{
//Stop animação
//alert("ok");
$("#badgeAnimation").removeClass('hvr-ripple-out');
});