diff --git a/menu.html b/menu.html index 8bf0e79..81757bf 100644 --- a/menu.html +++ b/menu.html @@ -2,7 +2,7 @@ - + Menú - IntegraRepara @@ -10,7 +10,11 @@ body { background-color: #f4f7f9; -webkit-tap-highlight-color: transparent; } .fade-in { animation: fadeIn 0.4s ease-out forwards; } @keyframes fadeIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } } - .bottom-nav-safe { padding-bottom: env(safe-area-inset-bottom); } + + /* Ajustes precisos para móviles con Notch/Barra inferior (iPhone) */ + .safe-bottom-nav { padding-bottom: calc(env(safe-area-inset-bottom) + 12px); } + .main-content { padding-bottom: calc(env(safe-area-inset-bottom) + 90px); } + .app-card { box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05); } @@ -18,7 +22,7 @@
-
+

HOY

@@ -30,7 +34,7 @@
-
+
@@ -70,13 +74,13 @@
-
-
- - @@ -99,46 +103,34 @@ lucide.createIcons(); - // 1. Mostrar nombre y fecha const rawName = localStorage.getItem("userName") || "Operario"; - document.getElementById('opName').innerText = rawName.split(' ')[0]; // Coge solo el primer nombre + document.getElementById('opName').innerText = rawName.split(' ')[0]; const options = { weekday: 'long', day: 'numeric', month: 'long' }; document.getElementById('headerDate').innerText = new Date().toLocaleDateString('es-ES', options); - // 2. Cargar notificaciones de fondo fetchBadges(); }); async function fetchBadges() { try { - // Pedimos los servicios activos al servidor const res = await fetch(`${API_URL}/services/active`, { headers: { "Authorization": `Bearer ${localStorage.getItem("token")}` } }); const data = await res.json(); if (data.ok) { - // Filtramos los bloqueos del sistema const services = data.services.filter(s => s.provider !== 'SYSTEM_BLOCK'); let sinCitaCount = 0; let conCitaCount = 0; - // Contamos cuáles tienen fecha y cuáles no services.forEach(s => { const raw = s.raw_data || {}; - // Excluimos los terminados/anulados - const stId = String(raw.status_operativo || ""); - // Solo contamos los que están "vivos" - if (raw.scheduled_date) { - conCitaCount++; - } else { - sinCitaCount++; - } + if (raw.scheduled_date) conCitaCount++; + else sinCitaCount++; }); - // Pintamos los globos si hay datos if (sinCitaCount > 0) { const b1 = document.getElementById('badgeAsignados'); b1.innerText = `${sinCitaCount} pendiente${sinCitaCount > 1 ? 's' : ''}`; @@ -150,7 +142,7 @@ b2.classList.remove('hidden'); } } - } catch (e) { console.log("Error cargando badges de notificación"); } + } catch (e) { console.log("Error cargando badges"); } } function logout() {