JSFiddle - React, Tailwind, and code Playground

HTML

<div id="red"></div>

CSS

#red{
    position : absolute;
background-color : red;
    width : 100px;
    height : 100px;
}

JavaScript

var red = document.getElementById("red");

var theta = 0;
setInterval(function(){
    red.style.left = parseInt(100 + 100 * Math.cos(theta)) + "px";
    theta += 0.1;
}, 30);

red.onmouseover = function(){
 red.style.backgroundColor = "blue";   
}
red.onmouseout = function(){
 red.style.backgroundColor  = "red";   
}