JSFiddle - React, Tailwind, and code Playground
JavaScript
const max = 200;
const min = 40;
const focus = 0.4; // 0 - 1
let numbs = [];
function randomFocusBorders(max, min) {
const middle = (max - min) / 2;
let x = Math.floor(middle * Math.pow(Math.random(), focus));
if (Math.random() < 0.5) x = middle - x;
else x = middle + x;
x += min;
return x;
}
for (let i = 0; i < 100; i++) {
numbs.push(randomFocusBorders(max, min));
}
numbs.sort((a, b) => {
return a > b ? 1 : -1;
});
console.log(numbs);