Fix Mapa Res Intermedia

This commit is contained in:
2025-10-03 13:53:11 -03:00
parent b8c8c1260d
commit 9e0e7f0ee6
2 changed files with 215 additions and 133 deletions

View File

@@ -20,9 +20,11 @@
/* Contenedor para alinear título y selector */ /* Contenedor para alinear título y selector */
.header-top-row { .header-top-row {
display: flex; display: flex;
justify-content: flex-start; /* Alinea los items al inicio */ justify-content: flex-start;
/* Alinea los items al inicio */
align-items: center; align-items: center;
gap: 2rem; /* Añade un espacio de separación de 2rem entre el selector y el breadcrumb */ gap: 2rem;
/* Añade un espacio de separación de 2rem entre el selector y el breadcrumb */
} }
.categoria-selector { .categoria-selector {
@@ -160,7 +162,8 @@
.resultados-column { .resultados-column {
flex: 1; flex: 1;
overflow-y: auto; overflow-y: auto;
padding: 1.25rem; /* ANTES: 1.5rem */ padding: 1.25rem;
/* ANTES: 1.5rem */
transition: all 0.5s ease-in-out; transition: all 0.5s ease-in-out;
min-width: 320px; min-width: 320px;
} }
@@ -169,8 +172,10 @@
.partido-fila { .partido-fila {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 0.75rem; /* ANTES: 1rem */ gap: 0.75rem;
padding: 0.75rem 0; /* ANTES: 1rem 0 */ /* ANTES: 1rem */
padding: 0.75rem 0;
/* ANTES: 1rem 0 */
border-bottom: 1px solid #f0f0f0; border-bottom: 1px solid #f0f0f0;
border-left: 5px solid; border-left: 5px solid;
border-radius: 12px; border-radius: 12px;
@@ -197,7 +202,8 @@
grid-template-columns: 1fr auto; grid-template-columns: 1fr auto;
grid-template-rows: auto auto; grid-template-rows: auto auto;
align-items: center; align-items: center;
gap: 0.25rem 0.75rem; /* ANTES: gap: 0.25rem 1rem */ gap: 0.25rem 0.75rem;
/* ANTES: gap: 0.25rem 1rem */
} }
.partido-top-row { .partido-top-row {
@@ -211,7 +217,8 @@
.partido-nombre { .partido-nombre {
font-weight: 700; font-weight: 700;
font-size: 1rem; /* ANTES: 1.05rem */ font-size: 1rem;
/* ANTES: 1.05rem */
color: #212529; color: #212529;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
@@ -220,7 +227,8 @@
} }
.candidato-nombre { .candidato-nombre {
font-size: 0.75rem; /* ANTES: 0.8rem */ font-size: 0.75rem;
/* ANTES: 0.8rem */
color: #6c757d; color: #6c757d;
text-transform: uppercase; text-transform: uppercase;
font-weight: 500; font-weight: 500;
@@ -234,19 +242,22 @@
} }
.partido-porcentaje { .partido-porcentaje {
font-size: 1.35rem; /* ANTES: 1.5rem */ font-size: 1.35rem;
/* ANTES: 1.5rem */
font-weight: 700; font-weight: 700;
display: block; display: block;
} }
.partido-votos { .partido-votos {
font-size: 0.9rem; /* ANTES: 1rem */ font-size: 0.9rem;
/* ANTES: 1rem */
color: #666; color: #666;
display: block; display: block;
} }
.partido-barra-background { .partido-barra-background {
height: 12px; /* ANTES: 20px */ height: 12px;
/* ANTES: 20px */
background-color: #f0f0f0; background-color: #f0f0f0;
border-radius: 4px; border-radius: 4px;
grid-column: 1 / 3; grid-column: 1 / 3;
@@ -262,19 +273,23 @@
.panel-estado-recuento { .panel-estado-recuento {
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
padding-bottom: 1rem; /* ANTES: 1.5rem */ padding-bottom: 1rem;
margin-bottom: 1rem; /* ANTES: 1.5rem */ /* ANTES: 1.5rem */
margin-bottom: 1rem;
/* ANTES: 1.5rem */
border-bottom: 1px solid #e0e0e0; border-bottom: 1px solid #e0e0e0;
} }
.estado-item { .estado-item {
width: 95px; /* ANTES: 100px */ width: 95px;
/* ANTES: 100px */
text-align: center; text-align: center;
} }
.estado-item span { .estado-item span {
margin-top: 0.5rem; margin-top: 0.5rem;
font-size: 0.85rem; /* ANTES: 0.9rem */ font-size: 0.85rem;
/* ANTES: 0.9rem */
color: #666; color: #666;
display: block; display: block;
} }
@@ -539,25 +554,26 @@
} }
.municipio-search-container { .municipio-search-container {
min-width: 280px; /* Ancho mínimo para el buscador en desktop */ min-width: 280px;
/* Ancho mínimo para el buscador en desktop */
} }
/* --- MEDIA QUERY PARA RESPONSIVE (REFACTORIZADA) --- */ /* --- MEDIA QUERY PARA RESPONSIVE (REFACTORIZADA) --- */
@media (max-width: 800px) { @media (max-width: 800px) {
.panel-nacional-container { .panel-nacional-container {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100vh; height: 100vh;
padding: 0; padding: 0;
border: none; border: none;
border-radius: 0; border-radius: 0;
} }
.panel-header { .panel-header {
flex-shrink: 0; flex-shrink: 0;
padding: 1rem; padding: 1rem;
border-radius: 0; border-radius: 0;
} }
.panel-main-content { .panel-main-content {
@@ -628,18 +644,21 @@
margin-bottom: 90px; margin-bottom: 90px;
} }
.zoom-controls-container, .mapa-volver-btn { .zoom-controls-container,
.mapa-volver-btn {
top: 15px; top: 15px;
} }
.header-bottom-row { .header-bottom-row {
flex-direction: column; flex-direction: column;
align-items: stretch; /* Para que ambos elementos ocupen el ancho completo */ align-items: stretch;
/* Para que ambos elementos ocupen el ancho completo */
gap: 1rem; gap: 1rem;
} }
.municipio-search-container { .municipio-search-container {
min-width: 100%; /* El buscador ocupa todo el ancho en móvil */ min-width: 100%;
/* El buscador ocupa todo el ancho en móvil */
} }
@media (max-width: 900px) and (orientation: landscape) { @media (max-width: 900px) and (orientation: landscape) {
@@ -650,7 +669,9 @@
height: 85vh; height: 85vh;
min-height: 400px; min-height: 400px;
} }
.mapa-column, .resultados-column {
.mapa-column,
.resultados-column {
position: static; position: static;
height: auto; height: auto;
width: auto; width: auto;
@@ -660,157 +681,215 @@
flex: 3; flex: 3;
overflow-y: auto; overflow-y: auto;
} }
.resultados-column { .resultados-column {
flex: 2; flex: 2;
min-width: 300px; min-width: 300px;
} }
.mobile-results-card-container { display: none; }
.panel-toggle-btn { display: flex; } .mobile-results-card-container {
display: none;
}
.panel-toggle-btn {
display: flex;
}
} }
} }
/* --- ESTILOS PARA LA TARJETA DE RESULTADOS EN MÓVIL (ACTUALIZADOS) --- */ /* --- ESTILOS PARA LA TARJETA DE RESULTADOS EN MÓVIL (ACTUALIZADOS) --- */
.mobile-results-card-container { .mobile-results-card-container {
position: absolute; position: absolute;
bottom: 10px; bottom: 10px;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
z-index: 40; z-index: 40;
width: 95%; width: 95%;
max-width: 450px; max-width: 450px;
background-color: rgba(255, 255, 255, 0.95); background-color: rgba(255, 255, 255, 0.95);
border-radius: 12px; border-radius: 12px;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15); box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
backdrop-filter: blur(8px); backdrop-filter: blur(8px);
-webkit-backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
border: 1px solid rgba(0, 0, 0, 0.1); border: 1px solid rgba(0, 0, 0, 0.1);
transition: all 0.3s ease-in-out; transition: all 0.3s ease-in-out;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.mobile-results-card-container.view-resultados .collapsible-section { .mobile-results-card-container.view-resultados .collapsible-section {
display: none; display: none;
} }
.mobile-results-card-container.view-resultados .mobile-card-view-toggle { .mobile-results-card-container.view-resultados .mobile-card-view-toggle {
border-top: none; border-top: none;
} }
.collapsible-section { .collapsible-section {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.mobile-results-header { .mobile-results-header {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: 12px 18px; /* REDUCIDO */ padding: 12px 18px;
cursor: pointer; /* REDUCIDO */
cursor: pointer;
} }
.mobile-results-header .header-info { .mobile-results-header .header-info {
display: flex; /* AÑADIDO */ display: flex;
align-items: baseline; /* AÑADIDO */ /* AÑADIDO */
gap: 12px; /* AÑADIDO */ align-items: baseline;
/* AÑADIDO */
gap: 12px;
/* AÑADIDO */
} }
.mobile-results-header .header-info h4 { .mobile-results-header .header-info h4 {
margin: 0; margin: 0;
font-size: 1.2rem; font-size: 1.2rem;
font-weight: 700; font-weight: 700;
} }
/* SELECTOR ESPECÍFICO PARA EL TEXTO DE ACCIÓN */ /* SELECTOR ESPECÍFICO PARA EL TEXTO DE ACCIÓN */
.mobile-results-header .header-info .header-action-text { .mobile-results-header .header-info .header-action-text {
font-size: 0.8rem; font-size: 0.8rem;
color: #6c757d; color: #6c757d;
font-weight: 500; font-weight: 500;
text-transform: uppercase; text-transform: uppercase;
} }
.mobile-results-header .header-toggle-icon { .mobile-results-header .header-toggle-icon {
font-size: 1.5rem; font-size: 1.5rem;
color: #007bff; color: #007bff;
transition: transform 0.3s; transition: transform 0.3s;
} }
.mobile-results-content { .mobile-results-content {
max-height: 0; max-height: 0;
opacity: 0; opacity: 0;
overflow: hidden; overflow: hidden;
transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out, padding 0.3s ease-in-out; transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out, padding 0.3s ease-in-out;
padding: 0 15px; padding: 0 15px;
border-top: 1px solid transparent; border-top: 1px solid transparent;
} }
.mobile-results-card-container.expanded .mobile-results-content { .mobile-results-card-container.expanded .mobile-results-content {
max-height: 500px; max-height: 500px;
opacity: 1; opacity: 1;
padding: 5px 15px 15px 15px; padding: 5px 15px 15px 15px;
border-top-color: #e0e0e0; border-top-color: #e0e0e0;
} }
.mobile-result-row { .mobile-result-row {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 10px; gap: 10px;
padding: 8px 0; padding: 8px 0;
border-bottom: 1px solid #f0f0f0; border-bottom: 1px solid #f0f0f0;
border-left: 4px solid; border-left: 4px solid;
padding-left: 8px; padding-left: 8px;
}
.mobile-result-row:last-child {
border-bottom: none;
} }
.mobile-result-row:last-child { border-bottom: none; }
.mobile-result-logo { .mobile-result-logo {
flex-shrink: 0; flex-shrink: 0;
width: 40px; width: 40px;
height: 40px; height: 40px;
border-radius: 8px; border-radius: 8px;
box-sizing: border-box; box-sizing: border-box;
} }
.mobile-result-logo img {
width: 100%; .mobile-result-logo img {
height: 100%; width: 100%;
border-radius: 8px; height: 100%;
} border-radius: 8px;
.mobile-result-info { flex-grow: 1; min-width: 0; } }
.mobile-result-party-name { display: block; font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mobile-result-candidate-name { display: block; font-size: 0.75rem; color: #6c757d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .mobile-result-info {
.mobile-result-stats { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; } flex-grow: 1;
.mobile-result-stats strong { font-size: 0.95rem; font-weight: 700; } min-width: 0;
.mobile-result-stats span { font-size: 0.7rem; color: #6c757d; } }
.no-results-text { padding: 1rem; text-align: center; color: #6c757d; font-size: 0.9rem; }
.mobile-result-party-name {
display: block;
font-weight: 600;
font-size: 0.9rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.mobile-result-candidate-name {
display: block;
font-size: 0.75rem;
color: #6c757d;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.mobile-result-stats {
display: flex;
flex-direction: column;
align-items: flex-end;
flex-shrink: 0;
}
.mobile-result-stats strong {
font-size: 0.95rem;
font-weight: 700;
}
.mobile-result-stats span {
font-size: 0.7rem;
color: #6c757d;
}
.no-results-text {
padding: 1rem;
text-align: center;
color: #6c757d;
font-size: 0.9rem;
}
.mobile-card-view-toggle { .mobile-card-view-toggle {
display: flex; display: flex;
padding: 5px; padding: 5px;
background-color: rgba(230, 230, 230, 0.6); background-color: rgba(230, 230, 230, 0.6);
border-top: 1px solid rgba(0, 0, 0, 0.08); border-top: 1px solid rgba(0, 0, 0, 0.08);
} }
.mobile-card-view-toggle .toggle-btn { .mobile-card-view-toggle .toggle-btn {
flex: 1; flex: 1;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
gap: 8px; gap: 8px;
padding: 10px 15px; /* Aumentado para pantallas más grandes */ padding: 10px 15px;
border: none; /* Aumentado para pantallas más grandes */
background-color: transparent; border: none;
border-radius: 25px; background-color: transparent;
cursor: pointer; border-radius: 25px;
font-size: 1rem; /* Mantenido para pantallas más grandes */ cursor: pointer;
font-weight: 500; font-size: 1rem;
color: #555; /* Mantenido para pantallas más grandes */
transition: all 0.2s ease-in-out; font-weight: 500;
color: #555;
transition: all 0.2s ease-in-out;
} }
.mobile-card-view-toggle .toggle-btn.active { .mobile-card-view-toggle .toggle-btn.active {
background-color: #007bff; background-color: #007bff;
color: white; color: white;
box-shadow: 0 2px 5px rgba(0, 123, 255, 0.2); box-shadow: 0 2px 5px rgba(0, 123, 255, 0.2);
} }
/* Ajustes para pantallas pequeñas como el iPhone SE */ /* Ajustes para pantallas pequeñas como el iPhone SE */
@@ -821,15 +900,19 @@
.mobile-results-header .header-info h4 { .mobile-results-header .header-info h4 {
font-size: 0.75rem; font-size: 0.75rem;
text-transform: uppercase; /* Se achica el título */ text-transform: uppercase;
/* Se achica el título */
} }
.mobile-results-header .header-info .header-action-text { .mobile-results-header .header-info .header-action-text {
font-size: 0.7rem; /* Se achica el texto de acción */ font-size: 0.7rem;
/* Se achica el texto de acción */
} }
.mobile-card-view-toggle .toggle-btn { .mobile-card-view-toggle .toggle-btn {
padding: 6px 10px; /* Se reduce el padding de los botones */ padding: 6px 10px;
font-size: 0.8rem; /* Se achica la fuente de los botones */ /* Se reduce el padding de los botones */
font-size: 0.8rem;
/* Se achica la fuente de los botones */
} }
} }

View File

@@ -54,8 +54,7 @@ interface MapaNacionalProps {
// --- CONFIGURACIONES DEL MAPA --- // --- CONFIGURACIONES DEL MAPA ---
const desktopProjectionConfig = { scale: 700, center: [-65, -40] as [number, number] }; const desktopProjectionConfig = { scale: 700, center: [-65, -40] as [number, number] };
const mobileProjectionConfig = { scale: 1100, center: [-64, -42.5] as [number, number] }; const mobileProjectionConfig = { scale: 1050, center: [-64, -43] as [number, number] };
// --- LÍNEA A CALIBRAR ---
const mobileSmallProjectionConfig = { scale: 900, center: [-64, -43] as [number, number] }; const mobileSmallProjectionConfig = { scale: 900, center: [-64, -43] as [number, number] };