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 target = parseFloat(counter.getAttribute('data-target'));
const duration = 2000;
const step = target / (duration / 16);
let current = 0;
const updateCounter = () => {
current += step;
if (current < target) {
const startTime = performance.now();
const updateCounter = (currentTime) => {
const elapsed = currentTime - startTime;
const progress = Math.min(elapsed / duration, 1);
// 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);
}
if (progress < 1) {
requestAnimationFrame(updateCounter);
} else {
counter.textContent = target;
}
};
updateCounter();
requestAnimationFrame(updateCounter);
};
// Use Intersection Observer to trigger animation

View File

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