From af9bae309392cae179ebd040c011f8c39d3ccb5f Mon Sep 17 00:00:00 2001 From: dadaloop82 Date: Wed, 6 May 2026 05:15:44 +0000 Subject: [PATCH] fix: remove skeleton shimmer from dashboard stat cards --- assets/css/style.css | 15 --------------- assets/js/app.js | 8 -------- index.html | 8 ++++---- 3 files changed, 4 insertions(+), 27 deletions(-) diff --git a/assets/css/style.css b/assets/css/style.css index b55427e..5856056 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -498,21 +498,6 @@ body { color: var(--primary); } -/* Skeleton pulse while stat is loading */ -.stat-value.stat-loading { - color: transparent; - background: linear-gradient(90deg, var(--border) 25%, var(--bg-dark, #e2e8f0) 50%, var(--border) 75%); - background-size: 200% 100%; - animation: stat-shimmer 1.2s infinite; - border-radius: 6px; - min-width: 2rem; - display: inline-block; -} -@keyframes stat-shimmer { - 0% { background-position: 200% 0; } - 100% { background-position: -200% 0; } -} - .stat-label { font-size: 0.85rem; color: var(--text-light); diff --git a/assets/js/app.js b/assets/js/app.js index 027af84..e0fb003 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -2339,11 +2339,6 @@ function showPage(pageId, param = null) { // Page-specific init switch(pageId) { case 'dashboard': - // Show skeleton on stat-cards while data loads - ['dispensa', 'frigo', 'freezer', 'spesa'].forEach(loc => { - const el = document.getElementById(`stat-${loc}`); - if (el) { el.textContent = '…'; el.classList.add('stat-loading'); } - }); loadDashboard(); break; case 'inventory': @@ -2763,7 +2758,6 @@ async function loadDashboard() { const count = s ? s.product_count : 0; const el = document.getElementById(`stat-${loc}`); el.textContent = count; - el.classList.remove('stat-loading'); total += count; }); // Add non-standard locations @@ -8694,11 +8688,9 @@ async function loadShoppingCount() { } else { el.textContent = '-'; } - el.classList.remove('stat-loading'); } catch { const el = document.getElementById('stat-spesa'); el.textContent = '-'; - el.classList.remove('stat-loading'); } // Smart urgency badge: use cached data if fresh (< 2 min), else fetch if (smartShoppingItems.length > 0 && (Date.now() - _smartShoppingLastFetch) < 2 * 60 * 1000) { diff --git a/index.html b/index.html index b9c5762..a8e56d5 100644 --- a/index.html +++ b/index.html @@ -102,22 +102,22 @@
🗄️ - + - Dispensa
🧊 - + - Frigo
❄️ - + - Freezer
🛒 - + - Spesa