This commit is contained in:
salam committed 2026-06-15 10:54:43 +02:00
1 parent 1cb3b0bad9
commit 2bb7fdbc27
3 files changed
+11 -6

No files matched your search

+3 -2
View File
@@ -1,4 +1,4 @@
function animate(element, end, duration = 500) {
function animate(element, end, duration = 500, fixtotwo = false) {
console.log(element, end);
var element = document.getElementById(element);
@@ -21,7 +21,8 @@ function animate(element, end, duration = 500) {
// Calculate current value and round to integer
const currentCount = Math.round(end * easedProgress * 100) / 100;
element.innerHTML = currentCount;
if (fixtotwo) element.innerHTML = currentCount.toFixed(2);
else element.innerHTML = currentCount;
if (progress < 1) {
requestAnimationFrame(updateCount);