C генерацией числа тоже разобрался, осталось сделать десяти секундный интервал запуска генерации числа.
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<style>
#brick {
width: 10px;
height: 20px;
background: #EE6B47;
position: relative;
cursor: pointer;
}
#path {
outline: 1px solid #E8C48E;
width: 810px;
height: 20px;
}
</style>
<script src="https://js.cx/libs/animate.js"></script>
</head>
<body>
<div id="path">
<div id="brick"></div>
</div>
<script>
function randomInteger(min, max) {
var rand = min - 0.5 + Math.random() * (max - min + 1)
rand = Math.round(rand);
return rand;
}
var sum = ( randomInteger(1, 800) );
function makeEaseOut(timing) {
return function(timeFraction) {
return 1 - timing(1 - timeFraction);
}
}
function bounce(timeFraction) {
for (var a = 0, b = 1, result; 1; a += b, b /= 2) {
if (timeFraction >= (7 - 4 * a) / 11) {
return -Math.pow((11 - 6 * a - 11 * timeFraction) / 4, 2) + Math.pow(b, 2)
}
}
}
var bounceEaseOut = makeEaseOut(bounce);
if (sum > 0) {
animate({
duration: 5000,
timing: bounceEaseOut,
draw: function(progress) {
brick.style.left = progress * sum + 'px';
}
});
};
</script>
</body>
</html>