Feat Widgets Cards y Optimización de Consultas

This commit is contained in:
2025-09-28 19:04:09 -03:00
parent 67634ae947
commit 3b0eee25e6
71 changed files with 5415 additions and 442 deletions

View File

@@ -1,27 +1,35 @@
/* src/features/legislativas/provinciales/CongresoWidget.css */
.congreso-container {
display: flex;
/* Se reduce ligeramente el espacio entre el gráfico y el panel */
gap: 1rem;
gap: 1.5rem;
background-color: #ffffff;
border: 1px solid #e0e0e0;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
padding: 1rem;
border-radius: 8px;
max-width: 800px;
max-width: 900px;
margin: 20px auto;
font-family: "Public Sans", system-ui, sans-serif;
color: #333333;
align-items: center;
}
.congreso-grafico {
/* --- CAMBIO PRINCIPAL: Se aumenta la proporción del gráfico --- */
flex: 1 1 65%;
flex: 2;
min-width: 300px;
display: flex;
flex-direction: column;
}
.congreso-hemiciclo-wrapper {
flex-grow: 1;
display: flex;
align-items: center;
justify-content: center;
width: 100%;
}
.congreso-hemiciclo-wrapper.is-hovering .party-block:not(:hover) {
opacity: 0.4;
}
.congreso-grafico svg {
@@ -30,35 +38,139 @@
animation: fadeIn 0.8s ease-in-out;
}
@keyframes fadeIn {
from {
opacity: 0;
transform: scale(0.9);
}
/* --- NUEVOS ESTILOS PARA EL FOOTER DEL GRÁFICO --- */
.congreso-footer {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.5rem 1rem 0 1rem;
margin-top: auto; /* Empuja el footer a la parte inferior del contenedor flex */
font-size: 0.8em;
color: #666;
border-top: 1px solid #eee;
}
to {
opacity: 1;
transform: scale(1);
}
.footer-legend {
display: flex;
gap: 1.5rem; /* Espacio entre los items de la leyenda */
}
.footer-legend-item {
display: flex;
align-items: center;
gap: 0.5rem; /* Espacio entre el icono y el texto */
}
.footer-timestamp {
font-weight: 500;
}
/* --- ESTILOS PARA HOVER --- */
/* Estilo base para cada círculo de escaño */
.seat-circle {
transition: all 0.2s ease-in-out;
}
.party-block {
cursor: pointer;
transition: opacity 0.2s ease-in-out;
}
.party-block:hover .seat-circle {
stroke: #333 !important; /* Borde oscuro para resaltar */
stroke-width: 1.5px !important;
stroke-opacity: 1;
filter: brightness(1.1);
}
/* CORRECCIÓN: El selector ahora apunta al wrapper correcto */
.congreso-hemiciclo-wrapper.is-hovering .party-block:not(:hover) {
opacity: 0.3; /* Hacemos el desvanecimiento más pronunciado */
}
.congreso-grafico svg {
width: 100%;
height: auto;
animation: fadeIn 0.8s ease-in-out;
}
@keyframes fadeIn {
from { opacity: 0; transform: scale(0.9); }
to { opacity: 1; transform: scale(1); }
}
/* --- INICIO DE NUEVOS ESTILOS PARA EL FOOTER DEL GRÁFICO --- */
.congreso-footer {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.75rem 0.5rem 0 0.5rem;
margin-top: auto;
font-size: 0.8em;
color: #666;
border-top: 1px solid #eee;
}
.footer-legend {
display: flex;
gap: 1.25rem;
align-items: center;
}
.footer-legend-item {
display: flex;
align-items: center;
gap: 0.6rem;
font-size: 1.1em;
}
/* Creamos una clase base para ambos iconos para compartir tamaño */
.legend-icon {
display: inline-block;
width: 14px; /* Tamaño base para ambos iconos */
height: 14px;
border-radius: 50%;
box-sizing: border-box;
}
/* Estilo para el icono de "Bancas en juego" (círculo sólido) */
.legend-icon--solid {
background-color: #888;
border: 1px solid #777;
}
/* Estilo para el icono de "Bancas previas" (anillo translúcido) */
.legend-icon--ring {
background-color: rgba(136, 136, 136, 0.3); /* #888 con opacidad */
border: 1px solid #888; /* Borde sólido del mismo color */
}
.footer-timestamp {
font-weight: 500;
font-size: 0.75em;
}
.congreso-summary {
/* --- CAMBIO PRINCIPAL: Se reduce la proporción del panel de datos --- */
flex: 1 1 35%;
flex: 1;
border-left: 1px solid #e0e0e0;
/* Se reduce el padding para dar aún más espacio al gráfico */
padding-left: 1rem;
padding-left: 1.25rem; /* Un poco más de padding */
display: flex;
flex-direction: column;
justify-content: flex-start;
}
.congreso-summary h3 {
margin-top: 0;
margin-bottom: 0.75rem; /* Margen inferior reducido */
font-size: 1.4em;
color: #212529;
}
.chamber-tabs {
display: flex;
margin-bottom: 1.5rem;
margin-bottom: 1rem; /* Margen inferior reducido */
border: 1px solid #dee2e6;
border-radius: 6px;
overflow: hidden;
@@ -66,7 +178,7 @@
.chamber-tabs button {
flex: 1;
padding: 0.75rem 0.5rem;
padding: 0.5rem 0.5rem;
border: none;
background-color: #f8f9fa;
color: #6c757d;
@@ -94,7 +206,7 @@
display: flex;
justify-content: space-between;
align-items: baseline;
margin-bottom: 0.5rem;
margin-bottom: 0.25rem; /* Margen inferior muy reducido */
font-size: 1.1em;
}
@@ -107,7 +219,15 @@
.congreso-summary hr {
border: none;
border-top: 1px solid #e0e0e0;
margin: 1.5rem 0;
margin: 1rem 0; /* Margen vertical reducido */
}
/* Contenedor de la lista de partidos para aplicar el scroll */
.partido-lista-container {
flex-grow: 1; /* Ocupa el espacio vertical disponible */
overflow-y: auto; /* Muestra el scrollbar si es necesario */
min-height: 0; /* Truco de Flexbox para que el scroll funcione */
padding-right: 8px; /* Espacio para el scrollbar */
}
.partido-lista {
@@ -119,14 +239,14 @@
.partido-lista li {
display: flex;
align-items: center;
margin-bottom: 0.75rem;
margin-bottom: 0.85rem; /* Un poco más de espacio entre items */
}
.partido-color-box {
width: 14px;
height: 14px;
border-radius: 3px;
margin-right: 10px;
width: 16px; /* Cuadro de color más grande */
height: 16px;
border-radius: 4px; /* Un poco más cuadrado */
margin-right: 12px;
flex-shrink: 0;
}
@@ -139,19 +259,54 @@
font-size: 1.1em;
}
/* --- Media Query para Responsividad Móvil --- */
/* --- Media Query para Responsividad Móvil (HASTA 768px) --- */
@media (max-width: 768px) {
.congreso-container {
flex-direction: column;
padding: 1.5rem;
padding: 0.5rem;
height: auto;
max-height: none;
}
.congreso-summary {
border-left: none;
padding-left: 0;
margin-top: 2rem;
border-top: 1px solid #e0e0e0;
padding-top: 1.5rem;
}
.partido-lista-container {
overflow-y: visible;
max-height: none;
}
.congreso-footer {
flex-direction: column; /* Apila la leyenda y el timestamp verticalmente */
align-items: flex-start; /* Alinea todo a la izquierda */
gap: 0.5rem; /* Añade un pequeño espacio entre la leyenda y el timestamp */
padding: 0.75rem 0rem; /* Ajusta el padding para móvil */
align-items: center;
}
.footer-legend {
gap: 0.75rem; /* Reduce el espacio entre los items de la leyenda */
}
.footer-legend-item{
font-size: 1em;
}
.footer-timestamp {
font-size: 0.75em; /* Reduce el tamaño de la fuente para que quepa mejor */
}
}
/* --- Media Query para Escritorio (DESDE 769px en adelante) --- */
@media (min-width: 769px) {
.congreso-container {
flex-direction: row;
align-items: stretch;
height: 500px;
}
}