JSFiddle - React, Tailwind, and code Playground

by Borisko

HTML

<img src="http://icons.iconarchive.com/icons/barkerbaggies/pool-ball/256/Ball-2-icon.png" class="imganim"/>

CSS

.imganim
    {
    width:100px;
    height:100px;
    position:relative;
    -webkit-animation: myfirst 1s infinite; /* Chrome, Safari, Opera */
    animation: myfirst 1s infinite;
    }

    /* Chrome, Safari, Opera */
    @-webkit-keyframes myfirst
    {
    0%   { left:0px; top:0px;-webkit-transform:rotate(0deg)}
    50%  {left:100%; margin-left:-100px;-webkit-transform:rotate(360deg)}
    100% {left:0px; top:0px;-webkit-transform:rotate(0deg)}
    }

    /* Standard syntax */
    @keyframes myfirst
    {
    0%   { left:0px; top:0px;transform:rotate(0deg)}
    50%  {left:100%; margin-left:-100px;transform:rotate(360deg)}
    100% {left:0px; top:0px;transform:rotate(0deg)}
    }