JSFiddle - React, Tailwind, and code Playground

by panino

HTML

<div id="unico">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>

CSS

#unico{ margin-left:300px}
#unico div{ background-color:#F00; width:100px; height:20px; margin:5px 0; position:relative}

JavaScript

function posicionar(padre,ang){
	var deplmax=50;
	var hijos=padre.getElementsByTagName('div');
	var paso=2*Math.PI/hijos.length;
	for(var i=0,obj;obj=hijos[i];i++){
		obj.style.left=Math.sin(ang+(paso*i))*deplmax+'px';
	}
}
onload=function(){
	var i=0;
	setInterval(function(){posicionar(document.getElementById('unico'),i+=.1);},15);
}