JSFiddle - React, Tailwind, and code Playground
by Marco
CSS
.dinamic{
height: 300px;
width: 300px;
position: absolute;
left: 200px;
top: 100px;
border: 1px solid #333;
}
JavaScript
for(i=0;i<5;i++){
var rotate=Math.floor(Math.random() * (360 - 1 + 1)) + 1;
var color = 'rgb(' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ')';
console.log(color)
$('<div class="dinamic"></div>').css({
'-moz-transform': 'rotate(' + rotate + 'deg)',
WebkitTransform: 'rotate(' + rotate + 'deg)',
'transform': 'rotate(' + rotate + 'deg)',
'background-color':color
}).appendTo('body')
}