JSFiddle - React, Tailwind, and code Playground
by Alex Jones
HTML
<div class="circle">
<span>1</span>
</div>
CSS
body {
background-color: gray;
}
.circle {
width: 100px;
height: 100px;
background-color: white;
border-radius: 50%;
border: 1px dashed black;
position: relative;
display: inline-block;
font-size: 100px;
cursor: pointer;
}
.circle-anim {
-webkit-animation-delay: 100ms;
-webkit-animation: spinZ 600ms, changeOpacity 600ms;
}
.circle span {
width: inherit;
height: inherit;
vertical-align: middle;
z-index: 1;
position: absolute;
color: gray;
text-align: center;
font-size: inherit;
line-height: 100%;
}
@-webkit-keyframes spinZ {
from { -webkit-transform: rotateY(0deg) }
to { -webkit-transform: rotateY(360deg) }
}
@-webkit-keyframes changeOpacity {
0% { opacity: 1; }
50% { opacity: 0; }
100% { opacity: 1; }
}
JavaScript
var $circle = $(".circle");
$circle.on("mouseover", function(el) {
$(this).toggleClass("circle-anim");
});