JSFiddle - React, Tailwind, and code Playground
HTML
<ul>
<li>C</li>
<li>C++</li>
<li>Java</li>
<li>PHP</li>
<li>JavaScript</li>
<li>Lisp</li>
<li>Scheme</li>
<li>Haskell</li>
<li>Lua</li>
<li>Python</li>
<li>Ruby</li>
<li>Delphi</li>
<li>Cobol</li>
</ul>
CSS
ul {
width: 500px;
height: 350px;
border: 1px solid red;
margin: 0;
text-align: center;
}
li {
list-style: none;
margin: 24px;
display: inline-block;
font-size: 2em;
position: relative;
}
JavaScript
var randomCoordsInACircle = function(cx, cy, radius) {
var r2 = radius*Math.sqrt(Math.random());
var angle = 2*Math.PI*Math.random();
return {
angle: angle,
x: (r2 * Math.cos(angle) + cx),
y: (r2 * Math.sin(angle) + cy)
}
};
$(function () {
$('li').each(function () {
var rnd = randomCoordsInACircle(0,0,25);
$(this).css({
left: rnd.x.toFixed(0)+'px',
top: rnd.y.toFixed(0)+'px'
});
});
})