Fix: Remove duplicate CSS, fix counter animation, ensure modals are hidden

This commit is contained in:
Roberth Rajala 2026-02-01 17:33:36 +01:00
parent 1524944b52
commit 0c61760313
2 changed files with 18 additions and 18 deletions

View File

@ -72,20 +72,31 @@ function initCounters() {
const animateCounter = (counter) => { const animateCounter = (counter) => {
const target = parseFloat(counter.getAttribute('data-target')); const target = parseFloat(counter.getAttribute('data-target'));
const duration = 2000; const duration = 2000;
const step = target / (duration / 16); const startTime = performance.now();
let current = 0;
const updateCounter = (currentTime) => {
const updateCounter = () => { const elapsed = currentTime - startTime;
current += step; const progress = Math.min(elapsed / duration, 1);
if (current < target) {
// Easing function for smooth animation
const easeOutQuart = 1 - Math.pow(1 - progress, 4);
const current = target * easeOutQuart;
// Format based on target value
if (target % 1 === 0) {
counter.textContent = Math.round(current);
} else {
counter.textContent = current.toFixed(1); counter.textContent = current.toFixed(1);
}
if (progress < 1) {
requestAnimationFrame(updateCounter); requestAnimationFrame(updateCounter);
} else { } else {
counter.textContent = target; counter.textContent = target;
} }
}; };
updateCounter(); requestAnimationFrame(updateCounter);
}; };
// Use Intersection Observer to trigger animation // Use Intersection Observer to trigger animation

View File

@ -1518,17 +1518,6 @@ body {
color: var(--color-text); color: var(--color-text);
} }
/* ========================================
Service Modals - Hide by default
======================================== */
.service-modal {
display: none !important;
}
.service-modal.active {
display: flex !important;
}
/* ======================================== /* ========================================
Service Status Checking Service Status Checking
======================================== */ ======================================== */