JSFiddle - React, Tailwind, and code Playground
HTML
<div class="center">
<div class="button spin"><span>I reset :(</span></div>
<div class="button shove"><span>I don't reset :)</span></div>
</div>
CSS
/* START - relates to the question */
@-webkit-keyframes shove
{
0% { margin-left: 0px; }
100% { margin-left: 50px; }
}
.spin {
-webkit-transition: all 0.4s linear;
}
.spin:hover {
-webkit-transform: rotate(-180deg);
}
.shove:hover span
{
-webkit-animation: shove 0.8s;
-webkit-animation-fill-mode: forwards;
}
/* END - question */
/* 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;
}
span { cursor: default; }
.spin { margin-bottom:10px; }
/* END - styling */