JSFiddle - React, Tailwind, and code Playground

HTML

<i>D</i>

CSS

i {
  position: relative;
  left:0px;
}

JavaScript

var a = $('i'), b = [0,300];
(function f() {
a.animate({'left': b.reverse()[0]}, 800, f)
})();