JSFiddle - React, Tailwind, and code Playground

HTML

<html>
    
    <body>
        <div style="margin: 300px auto;position: absolute;padding:0; width: 100%; overflow: hidden; height:300px;">
            <img id='cat' src="http://habr.habrastorage.org/comment_images/41d/1b4/925/41d1b49255673ab576194f7dd16d8dec.gif" alt="" />
        </div>
    </body>

</html>

CSS

#cat {
        position: absolute;
        right: -20%;
    }
    body {
        overflow: hidden;
    }

JavaScript

var elem = document.getElementById('cat');
var pos = -20;


var timer = setInterval(function () {
    pos++;

    elem.style.right = (pos / 3) + '%';
    if (pos == 300) {
        pos = -25;
    }

}, 40);