JSFiddle - React, Tailwind, and code Playground

HTML

<div>foo</div>

CSS

div {
    width: 200px;
    height: 100px;
    background-color: red;
}

JavaScript

var element = document.querySelector('div')

var animation  = element.animate([{
		transform: "translate(0px, 0)"
	}, {
		transform: "translate(200px, 0)"
	}], {
		duration: 1000,
		iterations: 1,
		delay: 0,
		easing: 'cubic-bezier(0.4, 0, 0.2, 1)',
		direction: 'normal',
		fill: 'both'
});

animation.onfinish = function(e){
console.log('finish', e)
element.style.transform = "translate(400px, 0)"
}

console.log(animation)