JSFiddle - React, Tailwind, and code Playground
by vals
HTML
<div class="flyin">TEST</div>
CSS
.flyin:not(.animation_done) {
-webkit-animation: flyin 5s ease;
margin-left: 0px;
opacity: 0;
}
@-webkit-keyframes flyin {
from {
margin-left: -210px;
opacity: 1;
}
to {
margin-left: 0px;
opacity: 1;
}
}
.animation_done {
margin-left: 0px;
transition: margin-left 4s ease;
}
.animation_done:hover {
margin-left: 10px;
}
JavaScript
$(document).on("animationend webkitAnimationEnd", function(e) {
$(e.target).addClass("animation_done");
});