Spaces:
Running
Running
Download index.html from doctopanda/epidemc2: direct link, hf CLI and curl.
- Browser
- Download file 72 kB
-
https://huggingface.co/spaces/doctopanda/epidemc2/resolve/main/index.html
- Command line
-
hf download hf://spaces/doctopanda/epidemc2/index.html
-
curl -L -o index.html https://huggingface.co/spaces/doctopanda/epidemc2/resolve/main/index.html
72 kB
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vigilancia Epidemiológica - Sonora</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyB41DRUbKWJHPxaFjMAwdrzWzbVKartNGg&callback=initMap&libraries=places&v=weekly" defer></script>
<style>
#map {
height: 70vh;
width: 100%;
border-radius: 0.5rem;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
.chart-container {
height: 300px;
width: 100%;
}
.custom-marker {
background-color: #3B82F6;
width: 24px;
height: 24px;
border-radius: 50%;
border: 2px solid white;
display: flex;
align-items: center;
justify-content: center;
color: white;
font-weight: bold;
}
.hospital-marker {
background-color: #EF4444;
}
.clinic-marker {
background-color: #10B981;
}
.health-center-marker {
background-color: #8B5CF6;
}
.sidebar {
transition: all 0.3s ease;
}
@media (max-width: 768px) {
.sidebar {
position: absolute;
z-index: 1000;
width: 80%;
left: -100%;
}
.sidebar.active {
left: 0;
}
}
.disease-tag {
display: inline-block;
padding: 0.25rem 0.5rem;
border-radius: 0.25rem;
font-size: 0.75rem;
font-weight: 500;
}
.disease-covid {
background-color: #3B82F620;
color: #3B82F6;
}
.disease-dengue {
background-color: #EF444420;
color: #EF4444;
}
.disease-influenza {
background-color: #10B98120;
color: #10B981;
}
.disease-irag {
background-color: #F59E0B20;
color: #F59E0B;
}
.pulse-animation {
animation: pulse 2s infinite;
}
@keyframes pulse {
0% {
transform: scale(1);
opacity: 1;
}
50% {
transform: scale(1.05);
opacity: 0.8;
}
100% {
transform: scale(1);
opacity: 1;
}
}
.heatmap-gradient {
background: linear-gradient(90deg, #10B981 0%, #F59E0B 50%, #EF4444 100%);
height: 8px;
border-radius: 4px;
}
.auth-container {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0,0,0,0.5);
z-index: 2000;
justify-content: center;
align-items: center;
}
.auth-box {
background-color: white;
border-radius: 0.5rem;
width: 90%;
max-width: 400px;
padding: 2rem;
box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
.auth-tabs {
display: flex;
border-bottom: 1px solid #e5e7eb;
margin-bottom: 1.5rem;
}
.auth-tab {
padding: 0.5rem 1rem;
cursor: pointer;
font-weight: 500;
color: #6b7280;
border-bottom: 2px solid transparent;
}
.auth-tab.active {
color: #3b82f6;
border-bottom-color: #3b82f6;
}
.auth-form {
display: none;
}
.auth-form.active {
display: block;
}
</style>
</head>
<body class="bg-gray-50">
<!-- Auth Modals -->
<div id="authContainer" class="auth-container">
<div class="auth-box">
<div class="auth-tabs">
<div class="auth-tab active" data-tab="login">Iniciar sesión</div>
<div class="auth-tab" data-tab="register">Registrarse</div>
<div class="auth-tab" data-tab="forgot">Recuperar cuenta</div>
</div>
<!-- Login Form -->
<div id="loginForm" class="auth-form active">
<h2 class="text-xl font-bold mb-4 text-gray-800">Iniciar sesión</h2>
<form id="login">
<div class="mb-4">
<label class="block text-gray-700 text-sm font-medium mb-1" for="login-email">Correo electrónico</label>
<input type="email" id="login-email" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" required>
</div>
<div class="mb-4">
<label class="block text-gray-700 text-sm font-medium mb-1" for="login-password">Contraseña</label>
<input type="password" id="login-password" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" required>
</div>
<div class="flex items-center justify-between mb-4">
<div class="flex items-center">
<input type="checkbox" id="remember-me" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded">
<label for="remember-me" class="ml-2 block text-sm text-gray-700">Recordarme</label>
</div>
<a href="#" class="text-sm text-blue-600 hover:text-blue-800" id="showForgot">¿Olvidaste tu contraseña?</a>
</div>
<button type="submit" class="w-full bg-blue-600 text-white py-2 px-4 rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2">
Iniciar sesión
</button>
</form>
</div>
<!-- Register Form -->
<div id="registerForm" class="auth-form">
<h2 class="text-xl font-bold mb-4 text-gray-800">Registrarse</h2>
<form id="register">
<div class="mb-4">
<label class="block text-gray-700 text-sm font-medium mb-1" for="register-name">Nombre completo</label>
<input type="text" id="register-name" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" required>
</div>
<div class="mb-4">
<label class="block text-gray-700 text-sm font-medium mb-1" for="register-email">Correo electrónico</label>
<input type="email" id="register-email" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" required>
</div>
<div class="mb-4">
<label class="block text-gray-700 text-sm font-medium mb-1" for="register-password">Contraseña</label>
<input type="password" id="register-password" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" required>
</div>
<div class="mb-4">
<label class="block text-gray-700 text-sm font-medium mb-1" for="register-confirm">Confirmar contraseña</label>
<input type="password" id="register-confirm" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" required>
</div>
<div class="mb-4">
<label class="block text-gray-700 text-sm font-medium mb-1" for="register-role">Rol</label>
<select id="register-role" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" required>
<option value="">Seleccionar rol</option>
<option value="epidemiologo">Epidemiólogo</option>
<option value="medico">Médico</option>
<option value="enfermera">Enfermero/a</option>
<option value="administrador">Administrador</option>
</select>
</div>
<div class="mb-4">
<label class="block text-gray-700 text-sm font-medium mb-1" for="register-institution">Institución</label>
<input type="text" id="register-institution" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" required>
</div>
<div class="flex items-center mb-4">
<input type="checkbox" id="register-terms" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded" required>
<label for="register-terms" class="ml-2 block text-sm text-gray-700">
Acepto los <a href="#" class="text-blue-600 hover:text-blue-800">términos y condiciones</a>
</label>
</div>
<button type="submit" class="w-full bg-blue-600 text-white py-2 px-4 rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2">
Registrarse
</button>
</form>
</div>
<!-- Forgot Password Form -->
<div id="forgotForm" class="auth-form">
<h2 class="text-xl font-bold mb-4 text-gray-800">Recuperar contraseña</h2>
<form id="forgot">
<div class="mb-4">
<label class="block text-gray-700 text-sm font-medium mb-1" for="forgot-email">Correo electrónico</label>
<input type="email" id="forgot-email" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" required>
</div>
<div class="mb-4 text-sm text-gray-600">
Te enviaremos un enlace para restablecer tu contraseña a tu correo electrónico.
</div>
<button type="submit" class="w-full bg-blue-600 text-white py-2 px-4 rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2">
Enviar enlace
</button>
</form>
</div>
<div class="text-center mt-4">
<button id="closeAuth" class="text-sm text-gray-600 hover:text-gray-800">Cancelar</button>
</div>
</div>
</div>
<!-- Main App (hidden until login) -->
<div id="appContent" class="hidden">
<div class="flex flex-col md:flex-row h-screen">
<!-- Sidebar -->
<div class="sidebar bg-white w-full md:w-80 p-4 shadow-md overflow-y-auto">
<div class="flex justify-between items-center mb-6">
<h1 class="text-2xl font-bold text-blue-600">
<i class="fas fa-shield-virus mr-2"></i> Vigilancia Epidemiológica
</h1>
<button id="closeSidebar" class="md:hidden text-gray-500">
<i class="fas fa-times"></i>
</button>
</div>
<div class="mb-6">
<h2 class="text-lg font-semibold mb-2 text-gray-700">
<i class="fas fa-map-marker-alt mr-2 text-blue-500"></i> Sonora, México
</h2>
<div class="flex items-center text-sm text-gray-600">
<i class="fas fa-info-circle mr-2"></i>
<span>Plataforma de monitoreo en tiempo real</span>
</div>
<div class="mt-3 text-xs text-gray-500">
<i class="fas fa-clock mr-1"></i> Actualizado: <span id="update-time">hace 5 minutos</span>
</div>
</div>
<div class="mb-6">
<div class="flex justify-between items-center mb-2">
<h3 class="font-medium text-gray-700">
<i class="fas fa-filter mr-2 text-blue-500"></i> Filtros
</h3>
<button class="text-xs text-blue-500 hover:text-blue-700">Reiniciar</button>
</div>
<div class="space-y-3">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Tipo de establecimiento</label>
<div class="flex flex-wrap gap-2">
<button class="filter-btn active bg-blue-100 text-blue-700 px-3 py-1 rounded-full text-xs hover:bg-blue-200" data-type="all">
Todos
</button>
<button class="filter-btn bg-red-100 text-red-700 px-3 py-1 rounded-full text-xs hover:bg-red-200" data-type="hospital">
Hospitales
</button>
<button class="filter-btn bg-green-100 text-green-700 px-3 py-1 rounded-full text-xs hover:bg-green-200" data-type="clinic">
Clínicas
</button>
<button class="filter-btn bg-purple-100 text-purple-700 px-3 py-1 rounded-full text-xs hover:bg-purple-200" data-type="healthcenter">
Centros de Salud
</button>
</div>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Municipio</label>
<select class="w-full border border-gray-300 rounded-md px-3 py-2 text-sm focus:ring-blue-500 focus:border-blue-500">
<option>Todos</option>
<option>Hermosillo</option>
<option>Ciudad Obregón</option>
<option>Nogales</option>
<option>San Luis Río Colorado</option>
<option>Navojoa</option>
</select>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Rango de fechas</label>
<div class="flex space-x-2">
<input type="date" class="flex-1 border border-gray-300 rounded-md px-3 py-2 text-sm focus:ring-blue-500 focus:border-blue-500">
<input type="date" class="flex-1 border border-gray-300 rounded-md px-3 py-2 text-sm focus:ring-blue-500 focus:border-blue-500">
</div>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Enfermedad</label>
<select class="w-full border border-gray-300 rounded-md px-3 py-2 text-sm focus:ring-blue-500 focus:border-blue-500">
<option>Todas</option>
<option>COVID-19</option>
<option>Dengue</option>
<option>Influenza</option>
<option>IRAG</option>
</select>
</div>
</div>
</div>
<div class="mb-6">
<h3 class="font-medium text-gray-700 mb-2">
<i class="fas fa-chart-line mr-2 text-blue-500"></i> Indicadores
</h3>
<div class="grid grid-cols-2 gap-3">
<div class="bg-blue-50 p-3 rounded-lg border border-blue-100">
<div class="flex justify-between items-start">
<div>
<div class="text-xs text-blue-600 font-medium">Casos activos</div>
<div class="text-xl font-bold text-blue-800">1,245</div>
<div class="text-xs text-blue-600 flex items-center">
<i class="fas fa-arrow-up mr-1"></i> +12% semanal
</div>
</div>
<div class="bg-blue-100 p-2 rounded-full text-blue-600">
<i class="fas fa-procedures"></i>
</div>
</div>
</div>
<div class="bg-green-50 p-3 rounded-lg border border-green-100">
<div class="flex justify-between items-start">
<div>
<div class="text-xs text-green-600 font-medium">Tasa de incidencia</div>
<div class="text-xl font-bold text-green-800">23.4%</div>
<div class="text-xs text-green-600 flex items-center">
<i class="fas fa-arrow-down mr-1"></i> -2% semanal
</div>
</div>
<div class="bg-green-100 p-2 rounded-full text-green-600">
<i class="fas fa-chart-pie"></i>
</div>
</div>
</div>
<div class="bg-yellow-50 p-3 rounded-lg border border-yellow-100">
<div class="flex justify-between items-start">
<div>
<div class="text-xs text-yellow-600 font-medium">Hospitalizados</div>
<div class="text-xl font-bold text-yellow-800">187</div>
<div class="text-xs text-yellow-600 flex items-center">
<i class="fas fa-arrow-up mr-1"></i> +5% semanal
</div>
</div>
<div class="bg-yellow-100 p-2 rounded-full text-yellow-600">
<i class="fas fa-hospital-user"></i>
</div>
</div>
</div>
<div class="bg-purple-50 p-3 rounded-lg border border-purple-100">
<div class="flex justify-between items-start">
<div>
<div class="text-xs text-purple-600 font-medium">Letalidad</div>
<div class="text-xl font-bold text-purple-800">1.8%</div>
<div class="text-xs text-purple-600">Estable</div>
</div>
<div class="bg-purple-100 p-2 rounded-full text-purple-600">
<i class="fas fa-heartbeat"></i>
</div>
</div>
</div>
</div>
<div class="mt-3">
<div class="flex justify-between text-xs text-gray-500 mb-1">
<span>Bajo</span>
<span>Medio</span>
<span>Alto</span>
</div>
<div class="heatmap-gradient"></div>
</div>
</div>
<div>
<div class="flex justify-between items-center mb-2">
<h3 class="font-medium text-gray-700">
<i class="fas fa-bell mr-2 text-blue-500"></i> Alertas recientes
</h3>
<span class="text-xs text-gray-500">3 nuevas</span>
</div>
<div class="space-y-2">
<div class="flex items-start p-3 bg-red-50 rounded-lg border border-red-100 pulse-animation">
<div class="bg-red-100 p-2 rounded-full text-red-500 mr-3">
<i class="fas fa-exclamation-triangle"></i>
</div>
<div>
<div class="text-sm font-medium text-red-800">Brote de dengue</div>
<div class="text-xs text-red-600 mb-1">Nogales - 5 nuevos casos</div>
<div class="flex items-center text-xs text-gray-500">
<i class="fas fa-clock mr-1"></i> Hace 2 horas
</div>
</div>
</div>
<div class="flex items-start p-3 bg-yellow-50 rounded-lg border border-yellow-100">
<div class="bg-yellow-100 p-2 rounded-full text-yellow-500 mr-3">
<i class="fas fa-exclamation-circle"></i>
</div>
<div>
<div class="text-sm font-medium text-yellow-800">Aumento IRAG</div>
<div class="text-xs text-yellow-600 mb-1">Hermosillo - +15% casos</div>
<div class="flex items-center text-xs text-gray-500">
<i class="fas fa-clock mr-1"></i> Hoy, 10:45 AM
</div>
</div>
</div>
<div class="flex items-start p-3 bg-blue-50 rounded-lg border border-blue-100">
<div class="bg-blue-100 p-2 rounded-full text-blue-500 mr-3">
<i class="fas fa-info-circle"></i>
</div>
<div>
<div class="text-sm font-medium text-blue-800">Actualización semanal</div>
<div class="text-xs text-blue-600 mb-1">Nuevos datos disponibles</div>
<div class="flex items-center text-xs text-gray-500">
<i class="fas fa-clock mr-1"></i> Hoy, 8:30 AM
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Main Content -->
<div class="flex-1 flex flex-col overflow-hidden">
<!-- Header -->
<header class="bg-white shadow-sm p-4 flex items-center justify-between">
<button id="toggleSidebar" class="md:hidden text-gray-600 hover:text-gray-800">
<i class="fas fa-bars"></i>
</button>
<div class="flex items-center space-x-4">
<div class="relative">
<input type="text" placeholder="Buscar ubicación..." class="border border-gray-300 rounded-full pl-10 pr-4 py-2 text-sm w-64 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
<i class="fas fa-search absolute left-3 top-3 text-gray-400"></i>
</div>
<div class="relative">
<select class="appearance-none border border-gray-300 rounded-md pl-3 pr-8 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
<option>Todas las enfermedades</option>
<option>COVID-19</option>
<option>Dengue</option>
<option>Influenza</option>
<option>IRAG</option>
</select>
<i class="fas fa-chevron-down absolute right-3 top-3 text-gray-400 pointer-events-none"></i>
</div>
<button class="bg-blue-600 text-white px-4 py-2 rounded-md text-sm hover:bg-blue-700 transition flex items-center shadow-sm">
<i class="fas fa-plus mr-2"></i> Nuevo reporte
</button>
</div>
<div class="flex items-center space-x-3">
<div class="relative">
<button class="text-gray-500 hover:text-gray-700 relative">
<i class="fas fa-bell"></i>
<span class="absolute -top-1 -right-1 bg-red-500 text-white text-xs rounded-full h-4 w-4 flex items-center justify-center">3</span>
</button>
</div>
<div class="flex items-center">
<div class="relative">
<img src="https://randomuser.me/api/portraits/men/32.jpg" alt="User" class="h-8 w-8 rounded-full mr-2">
<span class="absolute bottom-0 right-0 bg-green-500 rounded-full w-2 h-2 border border-white"></span>
</div>
<div class="flex flex-col">
<span class="text-sm font-medium" id="user-name">Dr. López</span>
<span class="text-xs text-gray-500" id="user-role">Epidemiólogo</span>
</div>
<button id="logoutBtn" class="ml-2 text-gray-500 hover:text-gray-700">
<i class="fas fa-sign-out-alt"></i>
</button>
</div>
</div>
</header>
<!-- Map and Data Section -->
<main class="flex-1 overflow-auto p-4 bg-gray-50">
<div class="mb-4 flex justify-between items-center">
<h2 class="text-xl font-bold text-gray-800">
<i class="fas fa-map-marked-alt mr-2 text-blue-600"></i> Mapa de Vigilancia Epidemiológica
</h2>
<div class="flex space-x-2">
<button id="locateMe" class="bg-white border border-gray-300 px-3 py-1 rounded-md text-sm flex items-center hover:bg-gray-50">
<i class="fas fa-location-arrow mr-2 text-blue-600"></i> Mi ubicación
</button>
<button class="bg-white border border-gray-300 px-3 py-1 rounded-md text-sm flex items-center hover:bg-gray-50">
<i class="fas fa-layer-group mr-2 text-blue-600"></i> Capas
</button>
<button class="bg-white border border-gray-300 px-3 py-1 rounded-md text-sm flex items-center hover:bg-gray-50">
<i class="fas fa-download mr-2 text-blue-600"></i> Exportar
</button>
</div>
</div>
<!-- Map Container -->
<div id="map" class="mb-6"></div>
<!-- Quick Stats -->
<div class="grid grid-cols-2 md:grid-cols-4 gap-4 mb-6">
<div class="bg-white p-4 rounded-lg shadow flex items-center">
<div class="bg-blue-100 p-3 rounded-full text-blue-600 mr-3">
<i class="fas fa-virus"></i>
</div>
<div>
<div class="text-sm text-gray-500">Casos COVID-19</div>
<div class="text-lg font-bold">876</div>
</div>
</div>
<div class="bg-white p-4 rounded-lg shadow flex items-center">
<div class="bg-red-100 p-3 rounded-full text-red-600 mr-3">
<i class="fas fa-bug"></i>
</div>
<div>
<div class="text-sm text-gray-500">Casos Dengue</div>
<div class="text-lg font-bold">215</div>
</div>
</div>
<div class="bg-white p-4 rounded-lg shadow flex items-center">
<div class="bg-green-100 p-3 rounded-full text-green-600 mr-3">
<i class="fas fa-lungs-virus"></i>
</div>
<div>
<div class="text-sm text-gray-500">Casos Influenza</div>
<div class="text-lg font-bold">98</div>
</div>
</div>
<div class="bg-white p-4 rounded-lg shadow flex items-center">
<div class="bg-yellow-100 p-3 rounded-full text-yellow-600 mr-3">
<i class="fas fa-lungs"></i>
</div>
<div>
<div class="text-sm text-gray-500">Casos IRAG</div>
<div class="text-lg font-bold">56</div>
</div>
</div>
</div>
<!-- Data Visualization -->
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6 mb-6">
<!-- Cases by Municipality -->
<div class="bg-white p-4 rounded-lg shadow">
<div class="flex justify-between items-center mb-3">
<h3 class="font-medium text-gray-700 flex items-center">
<i class="fas fa-city mr-2 text-blue-500"></i> Casos por municipio
</h3>
<select class="text-xs border border-gray-200 rounded px-2 py-1 focus:outline-none focus:ring-1 focus:ring-blue-500">
<option>Últimos 7 días</option>
<option>Últimos 14 días</option>
<option>Últimos 30 días</option>
</select>
</div>
<div class="chart-container">
<canvas id="municipalityChart"></canvas>
</div>
</div>
<!-- Disease Distribution -->
<div class="bg-white p-4 rounded-lg shadow">
<div class="flex justify-between items-center mb-3">
<h3 class="font-medium text-gray-700 flex items-center">
<i class="fas fa-virus mr-2 text-green-500"></i> Distribución de enfermedades
</h3>
<div class="text-xs text-gray-500">Total: 1,245 casos</div>
</div>
<div class="chart-container">
<canvas id="diseaseChart"></canvas>
</div>
</div>
<!-- Weekly Trend -->
<div class="bg-white p-4 rounded-lg shadow">
<div class="flex justify-between items-center mb-3">
<h3 class="font-medium text-gray-700 flex items-center">
<i class="fas fa-chart-bar mr-2 text-purple-500"></i> Tendencia semanal
</h3>
<div class="flex space-x-1">
<button class="text-xs bg-purple-50 text-purple-600 px-2 py-1 rounded">Casos</button>
<button class="text-xs bg-gray-100 text-gray-600 px-2 py-1 rounded">Hospitalizaciones</button>
</div>
</div>
<div class="chart-container">
<canvas id="trendChart"></canvas>
</div>
</div>
</div>
<!-- Recent Reports -->
<div class="bg-white p-4 rounded-lg shadow mb-6">
<div class="flex justify-between items-center mb-4">
<h3 class="font-medium text-gray-700 flex items-center">
<i class="fas fa-file-medical mr-2 text-blue-500"></i> Reportes recientes
</h3>
<button class="text-blue-600 text-sm flex items-center hover:text-blue-800">
<i class="fas fa-sync-alt mr-1"></i> Actualizar
</button>
</div>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Fecha</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Establecimiento</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Enfermedad</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Casos</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Estado</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Acciones</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<tr class="hover:bg-gray-50">
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Hoy, 11:30</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">Hospital General</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<span class="disease-tag disease-covid">COVID-19</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">12</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<span class="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-yellow-100 text-yellow-800">
Pendiente
</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<button class="text-blue-600 hover:text-blue-800 mr-2" title="Ver detalles">
<i class="fas fa-eye"></i>
</button>
<button class="text-green-600 hover:text-green-800" title="Analizar">
<i class="fas fa-chart-line"></i>
</button>
</td>
</tr>
<tr class="hover:bg-gray-50">
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Ayer, 16:45</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">Clínica IMSS #55</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<span class="disease-tag disease-dengue">Dengue</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">5</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<span class="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-green-100 text-green-800">
Verificado
</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<button class="text-blue-600 hover:text-blue-800 mr-2" title="Ver detalles">
<i class="fas fa-eye"></i>
</button>
<button class="text-green-600 hover:text-green-800" title="Analizar">
<i class="fas fa-chart-line"></i>
</button>
</td>
</tr>
<tr class="hover:bg-gray-50">
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Ayer, 09:15</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">Centro de Salud Urbano</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<span class="disease-tag disease-influenza">Influenza</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">3</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<span class="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-green-100 text-green-800">
Verificado
</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<button class="text-blue-600 hover:text-blue-800 mr-2" title="Ver detalles">
<i class="fas fa-eye"></i>
</button>
<button class="text-green-600 hover:text-green-800" title="Analizar">
<i class="fas fa-chart-line"></i>
</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- Health Centers Table -->
<div class="bg-white p-4 rounded-lg shadow">
<div class="flex justify-between items-center mb-4">
<h3 class="font-medium text-gray-700 flex items-center">
<i class="fas fa-hospital mr-2 text-red-500"></i> Centros de salud en Sonora
</h3>
<div class="flex items-center space-x-2">
<div class="relative">
<input type="text" placeholder="Buscar centro..." class="border border-gray-300 rounded-md pl-8 pr-3 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500 w-48">
<i class="fas fa-search absolute left-2 top-2 text-gray-400"></i>
</div>
<button class="text-blue-600 text-sm flex items-center hover:text-blue-800">
<i class="fas fa-sync-alt mr-1"></i> Actualizar
</button>
</div>
</div>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Nombre</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Tipo</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Municipio</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Casos activos</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Tasa incidencia</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Acciones</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<tr class="hover:bg-gray-50">
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="flex-shrink-0 h-10 w-10 bg-red-100 rounded-full flex items-center justify-center text-red-600">
<i class="fas fa-hospital"></i>
</div>
<div class="ml-4">
<div class="text-sm font-medium text-gray-900">Hospital General del Estado</div>
<div class="text-sm text-gray-500">Hermosillo</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-red-100 text-red-800">
Hospital
</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Hermosillo</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-sm text-gray-900 font-medium">87</div>
<div class="text-xs text-gray-500">+5 hoy</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<div class="flex items-center">
<div class="w-16 bg-gray-200 rounded-full h-1.5 mr-2">
<div class="bg-blue-600 h-1.5 rounded-full" style="width: 62%"></div>
</div>
<span>12.4%</span>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<button class="text-blue-600 hover:text-blue-800 mr-2" title="Ver detalles">
<i class="fas fa-eye"></i>
</button>
<button class="text-green-600 hover:text-green-800" title="Analizar">
<i class="fas fa-chart-line"></i>
</button>
<button class="text-purple-600 hover:text-purple-800" title="Contactar">
<i class="fas fa-phone-alt"></i>
</button>
</td>
</tr>
<tr class="hover:bg-gray-50">
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="flex-shrink-0 h-10 w-10 bg-green-100 rounded-full flex items-center justify-center text-green-600">
<i class="fas fa-clinic-medical"></i>
</div>
<div class="ml-4">
<div class="text-sm font-medium text-gray-900">Clínica IMSS #55</div>
<div class="text-sm text-gray-500">Ciudad Obregón</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">
Clínica
</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Ciudad Obregón</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-sm text-gray-900 font-medium">42</div>
<div class="text-xs text-gray-500">+2 hoy</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<div class="flex items-center">
<div class="w-16 bg-gray-200 rounded-full h-1.5 mr-2">
<div class="bg-blue-600 h-1.5 rounded-full" style="width: 45%"></div>
</div>
<span>9.1%</span>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<button class="text-blue-600 hover:text-blue-800 mr-2" title="Ver detalles">
<i class="fas fa-eye"></i>
</button>
<button class="text-green-600 hover:text-green-800" title="Analizar">
<i class="fas fa-chart-line"></i>
</button>
<button class="text-purple-600 hover:text-purple-800" title="Contactar">
<i class="fas fa-phone-alt"></i>
</button>
</td>
</tr>
<tr class="hover:bg-gray-50">
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="flex-shrink-0 h-10 w-10 bg-purple-100 rounded-full flex items-center justify-center text-purple-600">
<i class="fas fa-hospital-alt"></i>
</div>
<div class="ml-4">
<div class="text-sm font-medium text-gray-900">Centro de Salud Urbano</div>
<div class="text-sm text-gray-500">Nogales</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-purple-100 text-purple-800">
Centro de Salud
</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Nogales</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-sm text-gray-900 font-medium">28</div>
<div class="text-xs text-gray-500">+1 hoy</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<div class="flex items-center">
<div class="w-16 bg-gray-200 rounded-full h-1.5 mr-2">
<div class="bg-blue-600 h-1.5 rounded-full" style="width: 38%"></div>
</div>
<span>7.6%</span>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<button class="text-blue-600 hover:text-blue-800 mr-2" title="Ver detalles">
<i class="fas fa-eye"></i>
</button>
<button class="text-green-600 hover:text-green-800" title="Analizar">
<i class="fas fa-chart-line"></i>
</button>
<button class="text-purple-600 hover:text-purple-800" title="Contactar">
<i class="fas fa-phone-alt"></i>
</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</main>
</div>
</div>
</div>
</div>
<script>
// Simulación de base de datos de usuarios
const users = [
{
email: "admin@saludsonora.gob.mx",
password: "admin123",
name: "Dr. López",
role: "Epidemiólogo",
institution: "Secretaría de Salud Sonora"
},
{
email: "medico@hospital.com",
password: "medico123",
name: "Dra. García",
role: "Médico",
institution: "Hospital General del Estado"
}
];
// Mostrar modal de autenticación al cargar la página
document.addEventListener('DOMContentLoaded', function() {
const authContainer = document.getElementById('authContainer');
authContainer.style.display = 'flex';
// Ocultar contenido principal
document.getElementById('appContent').classList.add('hidden');
// Inicializar el mapa (pero oculto hasta el login)
initMap();
});
// Manejo de pestañas de autenticación
const authTabs = document.querySelectorAll('.auth-tab');
authTabs.forEach(tab => {
tab.addEventListener('click', function() {
// Remover clase active de todas las pestañas
authTabs.forEach(t => t.classList.remove('active'));
// Agregar clase active a la pestaña clickeada
this.classList.add('active');
// Ocultar todos los formularios
document.querySelectorAll('.auth-form').forEach(form => {
form.classList.remove('active');
});
// Mostrar el formulario correspondiente
const tabId = this.getAttribute('data-tab');
document.getElementById(tabId + 'Form').classList.add('active');
});
});
// Mostrar formulario de recuperación de contraseña
document.getElementById('showForgot').addEventListener('click', function(e) {
e.preventDefault();
// Remover clase active de todas las pestañas
authTabs.forEach(t => t.classList.remove('active'));
// Agregar clase active a la pestaña de recuperación
document.querySelector('.auth-tab[data-tab="forgot"]').classList.add('active');
// Ocultar todos los formularios
document.querySelectorAll('.auth-form').forEach(form => {
form.classList.remove('active');
});
// Mostrar el formulario de recuperación
document.getElementById('forgotForm').classList.add('active');
});
// Cerrar modal de autenticación
document.getElementById('closeAuth').addEventListener('click', function() {
document.getElementById('authContainer').style.display = 'none';
});
// Manejo de formulario de login
document.getElementById('login').addEventListener('submit', function(e) {
e.preventDefault();
const email = document.getElementById('login-email').value;
const password = document.getElementById('login-password').value;
// Verificar credenciales
const user = users.find(u => u.email === email && u.password === password);
if (user) {
// Login exitoso
document.getElementById('authContainer').style.display = 'none';
document.getElementById('appContent').classList.remove('hidden');
// Actualizar información del usuario en la interfaz
document.getElementById('user-name').textContent = user.name;
document.getElementById('user-role').textContent = user.role;
// Mostrar notificación de éxito
alert(`Bienvenido, ${user.name}!`);
} else {
// Credenciales incorrectas
alert('Correo electrónico o contraseña incorrectos');
}
});
// Manejo de formulario de registro
document.getElementById('register').addEventListener('submit', function(e) {
e.preventDefault();
const name = document.getElementById('register-name').value;
const email = document.getElementById('register-email').value;
const password = document.getElementById('register-password').value;
const confirm = document.getElementById('register-confirm').value;
const role = document.getElementById('register-role').value;
const institution = document.getElementById('register-institution').value;
// Validaciones básicas
if (password !== confirm) {
alert('Las contraseñas no coinciden');
return;
}
if (!document.getElementById('register-terms').checked) {
alert('Debes aceptar los términos y condiciones');
return;
}
// Verificar si el usuario ya existe
if (users.some(u => u.email === email)) {
alert('Este correo electrónico ya está registrado');
return;
}
// Registrar nuevo usuario
users.push({
email,
password,
name,
role,
institution
});
// Mostrar mensaje de éxito
alert('Registro exitoso! Por favor inicia sesión.');
// Cambiar a pestaña de login
authTabs.forEach(t => t.classList.remove('active'));
document.querySelector('.auth-tab[data-tab="login"]').classList.add('active');
document.querySelectorAll('.auth-form').forEach(form => {
form.classList.remove('active');
});
document.getElementById('loginForm').classList.add('active');
// Limpiar formulario
document.getElementById('register').reset();
});
// Manejo de formulario de recuperación de contraseña
document.getElementById('forgot').addEventListener('submit', function(e) {
e.preventDefault();
const email = document.getElementById('forgot-email').value;
// Verificar si el email existe
if (users.some(u => u.email === email)) {
alert('Se ha enviado un enlace de recuperación a tu correo electrónico');
} else {
alert('Este correo electrónico no está registrado');
}
});
// Cerrar sesión
document.getElementById('logoutBtn').addEventListener('click', function() {
// Ocultar contenido principal
document.getElementById('appContent').classList.add('hidden');
// Mostrar modal de autenticación
document.getElementById('authContainer').style.display = 'flex';
// Cambiar a pestaña de login
authTabs.forEach(t => t.classList.remove('active'));
document.querySelector('.auth-tab[data-tab="login"]').classList.add('active');
document.querySelectorAll('.auth-form').forEach(form => {
form.classList.remove('active');
});
document.getElementById('loginForm').classList.add('active');
});
// Inicialización del mapa
function initMap() {
const sonora = { lat: 29.0892, lng: -110.9613 };
const map = new google.maps.Map(document.getElementById("map"), {
zoom: 6,
center: sonora,
mapTypeControl: true,
streetViewControl: false,
fullscreenControl: true,
});
// Marcadores de ejemplo
const markers = [
{
position: { lat: 29.0669, lng: -110.9780 }, // Hermosillo
title: "Hospital General del Estado",
type: "hospital",
cases: 87,
diseases: ["COVID-19", "Dengue"]
},
{
position: { lat: 27.4826, lng: -109.9297 }, // Ciudad Obregón
title: "Clínica IMSS #55",
type: "clinic",
cases: 42,
diseases: ["COVID-19", "Influenza"]
},
{
position: { lat: 31.3057, lng: -110.9428 }, // Nogales
title: "Centro de Salud Urbano",
type: "healthcenter",
cases: 28,
diseases: ["Dengue", "IRAG"]
}
];
// Agregar marcadores al mapa
markers.forEach(markerInfo => {
const marker = new google.maps.Marker({
position: markerInfo.position,
map: map,
title: markerInfo.title,
icon: {
path: google.maps.SymbolPath.CIRCLE,
fillColor: getMarkerColor(markerInfo.type),
fillOpacity: 1,
strokeColor: "#fff",
strokeWeight: 2,
scale: 10
}
});
// InfoWindow para cada marcador
const infoWindow = new google.maps.InfoWindow({
content: `
<div class="p-2">
<h3 class="font-bold text-lg">${markerInfo.title}</h3>
<p class="text-sm">${markerInfo.type === 'hospital' ? 'Hospital' : markerInfo.type === 'clinic' ? 'Clínica' : 'Centro de Salud'}</p>
<div class="mt-2">
<p class="text-sm font-medium">Casos activos: <span class="font-bold">${markerInfo.cases}</span></p>
<div class="flex flex-wrap gap-1 mt-1">
${markerInfo.diseases.map(disease =>
`<span class="disease-tag ${getDiseaseClass(disease)}">${disease}</span>`
).join('')}
</div>
</div>
</div>
`
});
marker.addListener("click", () => {
infoWindow.open(map, marker);
});
});
// Botón de ubicación
document.getElementById('locateMe').addEventListener('click', function() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(
(position) => {
const pos = {
lat: position.coords.latitude,
lng: position.coords.longitude,
};
// Centrar mapa en la ubicación del usuario
map.setCenter(pos);
map.setZoom(14);
// Agregar marcador de ubicación
new google.maps.Marker({
position: pos,
map: map,
title: "Tu ubicación",
icon: {
path: google.maps.SymbolPath.CIRCLE,
fillColor: "#3B82F6",
fillOpacity: 1,
strokeColor: "#fff",
strokeWeight: 2,
scale: 10
}
});
},
() => {
alert("No se pudo obtener tu ubicación");
}
);
} else {
alert("Tu navegador no soporta geolocalización");
}
});
}
// Funciones auxiliares
function getMarkerColor(type) {
switch(type) {
case 'hospital': return '#EF4444';
case 'clinic': return '#10B981';
case 'healthcenter': return '#8B5CF6';
default: return '#3B82F6';
}
}
function getDiseaseClass(disease) {
switch(disease) {
case 'COVID-19': return 'disease-covid';
case 'Dengue': return 'disease-dengue';
case 'Influenza': return 'disease-influenza';
case 'IRAG': return 'disease-irag';
default: return '';
}
}
// Manejo del sidebar en móviles
document.getElementById('toggleSidebar').addEventListener('click', function() {
document.querySelector('.sidebar').classList.toggle('active');
});
document.getElementById('closeSidebar').addEventListener('click', function() {
document.querySelector('.sidebar').classList.remove('active');
});
// Filtros de marcadores
document.querySelectorAll('.filter-btn').forEach(btn => {
btn.addEventListener('click', function() {
document.querySelectorAll('.filter-btn').forEach(b => b.classList.remove('active'));
this.classList.add('active');
// Aquí iría la lógica para filtrar los marcadores en el mapa
// basado en el tipo seleccionado (data-type)
});
});
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=doctopanda/epidemc2" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vigilancia Epidemiológica - Sonora</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyB41DRUbKWJHPxaFjMAwdrzWzbVKartNGg&callback=initMap&libraries=places&v=weekly" defer></script>
<style>
#map {
height: 70vh;
width: 100%;
border-radius: 0.5rem;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
.chart-container {
height: 300px;
width: 100%;
}
.custom-marker {
background-color: #3B82F6;
width: 24px;
height: 24px;
border-radius: 50%;
border: 2px solid white;
display: flex;
align-items: center;
justify-content: center;
color: white;
font-weight: bold;
}
.hospital-marker {
background-color: #EF4444;
}
.clinic-marker {
background-color: #10B981;
}
.health-center-marker {
background-color: #8B5CF6;
}
.sidebar {
transition: all 0.3s ease;
}
@media (max-width: 768px) {
.sidebar {
position: absolute;
z-index: 1000;
width: 80%;
left: -100%;
}
.sidebar.active {
left: 0;
}
}
.disease-tag {
display: inline-block;
padding: 0.25rem 0.5rem;
border-radius: 0.25rem;
font-size: 0.75rem;
font-weight: 500;
}
.disease-covid {
background-color: #3B82F620;
color: #3B82F6;
}
.disease-dengue {
background-color: #EF444420;
color: #EF4444;
}
.disease-influenza {
background-color: #10B98120;
color: #10B981;
}
.disease-irag {
background-color: #F59E0B20;
color: #F59E0B;
}
.pulse-animation {
animation: pulse 2s infinite;
}
@keyframes pulse {
0% {
transform: scale(1);
opacity: 1;
}
50% {
transform: scale(1.05);
opacity: 0.8;
}
100% {
transform: scale(1);
opacity: 1;
}
}
.heatmap-gradient {
background: linear-gradient(90deg, #10B981 0%, #F59E0B 50%, #EF4444 100%);
height: 8px;
border-radius: 4px;
}