LordeckiyYaya,
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
</head>
<body>
<h1 class="head-p-card" ></h1>
<h1 class="head-p-card" ></h1>
<h1 class="head-p-card" ></h1>
<script>
function preloader(counts, time) {
let out = document.querySelectorAll('h1.head-p-card');
out.forEach((el, i) => {
let count = counts[i] || el.dataset.count || 500;
let n = 0;
let step = count/(30 * time/1000);
el.innerHTML = n;
let timer = () => {
n = Math.min(n + step, count);
el.innerHTML = n.toFixed(0);
n >= count || setTimeout(timer, 30);
}
setTimeout(timer, 30);
})
}
preloader([100, 500, 300], 8000);
</script>
</body>
</html>