JSFiddle - React, Tailwind, and code Playground
HTML
<div class="center">
<div class="button spin">
<span class="inline">I reset :(</span>
</div>
<div class="button spin">
<span class="block">I don't reset :)</span>
</div>
</div>
CSS
/* START - relates to the question/answer */
@-webkit-keyframes spin
{
0% { -webkit-transform: rotate(0deg); }
100% { -webkit-transform: rotate(-180deg); }
}
.spin:hover span
{
-webkit-animation: spin 0.8s;
-webkit-animation-fill-mode: forwards;
}
.block { display:block; }
/* END - question/answer */
/* START - styling */
.center
{
width:160px;
height:90px;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
}
.button
{
width:160px;
height:40px;
border: 1px solid #bbb;
border-radius: 10px;
text-align: center;
line-height: 40px;
}
.spin { margin-bottom:10px; }
/* END - styling */