JSFiddle - React, Tailwind, and code Playground

by Mi_Creativity

HTML

<div id="test"></div>

CSS

body{
  overflow:hidden;
}
#test{
  width:80px;
  height:50px;
  background-color:orange;
  position:relative;
  top:0;
  left:0;
  opacity:0;
}

JavaScript

var test = document.getElementById('test'),
	left = 0, top = 0, opa = 0;
  
simple();

function simple(){
    left += 10;
    top += 10;
    opa += 0.03;
    test.style.left = left.toString() +'px';
    test.style.top = top.toString() +'px';
    test.style.opacity = opa;
    var timer = setTimeout(simple, 40);
}