JSFiddle - React, Tailwind, and code Playground
by Ken Z
HTML
<div class="liljon">
<div id="bubbles">
<div class="bubble x1 show"></div>
<div class="bubble x2 show"></div>
<div class="bubble x3 show"></div>
</div>
</div>
CSS
body {
background: #000;
}
div.liljon div#bubbles .bubble {
overflow: hidden;
position: absolute;
-webkit-transition: all 500ms ease;
-moz-transition: all 500ms ease;
-ms-transition: all 500ms ease;
-o-transition: all 500ms ease;
transition: all 500ms ease;
opacity: 0;
display: none;
border-radius: 50%;
border: 1px solid rgba(255, 255, 255, 0.4);
background: -moz-radial-gradient(center, ellipse cover, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.1) 65%, rgba(255, 255, 255, 0.8) 75%, rgba(255, 255, 255, 0.8) 100%);
/* FF3.6+ */
background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%, rgba(255, 255, 255, 0)), color-stop(65%, rgba(255, 255, 255, 0.1)), color-stop(75%, rgba(255, 255, 255, 0.8)), color-stop(100%, rgba(255, 255, 255, 0.8)));
/* Chrome,Safari4+ */
background: -webkit-radial-gradient(center, ellipse cover, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.1) 65%, rgba(255, 255, 255, 0.8) 75%, rgba(255, 255, 255, 0.8) 100%);
/* Chrome10+,Safari5.1+ */
background: -o-radial-gradient(center, ellipse cover, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.1) 65%, rgba(255, 255, 255, 0.8) 75%, rgba(255, 255, 255, 0.8) 100%);
/* Opera 12+ */
background: -ms-radial-gradient(center, ellipse cover, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.1) 65%, rgba(255, 255, 255, 0.8) 75%, rgba(255, 255, 255, 0.8) 100%);
/* IE10+ */
background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.1) 65%, rgba(255, 255, 255, 0.8) 75%, rgba(255, 255, 255, 0.8) 100%);
/* W3C */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ffffff', endColorstr='#ccffffff', GradientType=1);
/* IE6-9 fallback on horizontal gradient */
text-align: center;
}
div.liljon div#bubbles .bubble.show {
opacity: 1;
display: table-cell;
vertical-align: middle;
}
div.liljon div#bubbles .bubble:after {
position: absolute;
left: -15%;
top:...
JavaScript
// Set the hover and hoverOut
jQuery('.bubble').hover(function () {
// Pause the CSS animation
jQuery(this).css('-webkit-animation-play-state', 'paused').css('animation-play-state', 'paused');
}, function () {
jQuery(this).delay(1000).queue( function (next) {
// Run the animation again after a delay
jQuery(this).css('-webkit-animation-play-state', 'running').css('animation-play-state', 'running').css({zIndex: jQuery(this).data('oldZindex')});
next();
});
});