- Added Express server with SQLite database connection. - Created API endpoints to fetch categories, KPIs, measurements, and statistics. - Implemented error handling for database operations. feat: Create ChartModal component for visualizing KPI data - Developed ChartModal to display line charts for KPI measurements. - Integrated Chart.js for rendering charts with responsive design. - Added styling for modal and chart components. feat: Add ExportModal component for exporting KPI data - Implemented ExportModal to allow users to select data ranges for export. - Included radio buttons for predefined time ranges (last week, month, year, all data). - Styled modal for better user experience. feat: Introduce RangeChartModal for dynamic range selection - Created RangeChartModal to visualize KPI data over user-selected time ranges. - Integrated radio buttons for selecting different time ranges. - Enhanced chart rendering with Chart.js. refactor: Create useSQLiteDatabase hook for data fetching - Developed custom hook to manage fetching categories, KPIs, and measurements. - Improved error handling and loading states for better user feedback. style: Add CSS styles for modals and charts - Created styles for ChartModal, ExportModal, and RangeChartModal. - Ensured responsive design for various screen sizes.
386 lines
6.3 KiB
CSS
386 lines
6.3 KiB
CSS
.home-page {
|
|
color: white;
|
|
}
|
|
|
|
/* STATS OVERVIEW */
|
|
.stats-overview {
|
|
margin-bottom: 2rem;
|
|
}
|
|
|
|
.overview-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-bottom: 1.5rem;
|
|
gap: 2rem;
|
|
}
|
|
|
|
.overview-header h1 {
|
|
font-size: 1.8rem;
|
|
margin: 0;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
/* TIME RANGE SELECTOR */
|
|
.time-range-selector {
|
|
display: flex;
|
|
gap: 0.5rem;
|
|
background: rgba(255, 255, 255, 0.1);
|
|
border-radius: 8px;
|
|
padding: 0.4rem;
|
|
}
|
|
|
|
.time-btn {
|
|
padding: 0.5rem 1rem;
|
|
border: none;
|
|
background: transparent;
|
|
color: white;
|
|
font-weight: 600;
|
|
font-size: 0.9rem;
|
|
cursor: pointer;
|
|
border-radius: 6px;
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
.time-btn:hover {
|
|
background: rgba(255, 255, 255, 0.2);
|
|
}
|
|
|
|
.time-btn.active {
|
|
background: rgba(255, 255, 255, 0.3);
|
|
color: white;
|
|
}
|
|
|
|
/* STAT CARDS - UNIFIED WITH CATEGORIES */
|
|
.stats-cards {
|
|
display: contents;
|
|
}
|
|
|
|
.stat-card {
|
|
background: rgba(255, 255, 255, 0.98);
|
|
border-radius: 8px;
|
|
padding: 1.5rem;
|
|
text-align: center;
|
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
|
transition: all 0.3s ease;
|
|
color: #333;
|
|
}
|
|
|
|
.stat-card:hover {
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
|
|
}
|
|
|
|
.stat-number {
|
|
font-size: 2.2rem;
|
|
font-weight: bold;
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
|
|
.stat-label {
|
|
font-size: 0.9rem;
|
|
font-weight: 600;
|
|
color: #555;
|
|
}
|
|
|
|
/* TOP KPIs SECTION */
|
|
.top-kpis-section {
|
|
background: rgba(255, 255, 255, 0.98);
|
|
border-radius: 8px;
|
|
padding: 1.5rem;
|
|
color: #333;
|
|
}
|
|
|
|
.top-kpis-section h2 {
|
|
font-size: 1.3rem;
|
|
margin-bottom: 1.2rem;
|
|
color: #333;
|
|
}
|
|
|
|
/* CATEGORIES GRID - CÔTE À CÔTE */
|
|
.main-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
|
|
gap: 1.5rem;
|
|
margin-top: 2rem;
|
|
}
|
|
|
|
/* CATEGORY SECTION */
|
|
.category-section {
|
|
background: rgba(255, 255, 255, 0.98);
|
|
border-radius: 8px;
|
|
padding: 1.5rem;
|
|
color: #333;
|
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
.category-section:hover {
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
|
|
}
|
|
|
|
.category-header {
|
|
margin-bottom: 1.2rem;
|
|
}
|
|
|
|
.category-header h2 {
|
|
font-size: 1.3rem;
|
|
margin: 0;
|
|
color: #333;
|
|
}
|
|
|
|
/* GRILLE DES STATS À L'INTÉRIEUR DU BLOC */
|
|
.stats-grid-inner {
|
|
display: grid;
|
|
grid-template-columns: repeat(2, 1fr);
|
|
gap: 1.2rem;
|
|
}
|
|
|
|
.stat-card-inner {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 1rem;
|
|
background: rgba(100, 150, 255, 0.08);
|
|
border-radius: 6px;
|
|
padding: 1.2rem;
|
|
border: 1px solid rgba(100, 150, 255, 0.15);
|
|
}
|
|
|
|
.stat-card-inner:last-child {
|
|
grid-column: 1 / -1;
|
|
justify-content: center;
|
|
gap: 1rem;
|
|
}
|
|
|
|
.stat-card-inner .stat-number {
|
|
font-size: 2rem;
|
|
font-weight: bold;
|
|
color: #333;
|
|
min-width: auto;
|
|
}
|
|
|
|
.stat-card-inner .stat-label {
|
|
font-size: 0.85rem;
|
|
font-weight: 600;
|
|
color: #666;
|
|
flex: none;
|
|
}
|
|
|
|
/* STAT CARDS - UNIFIED WITH CATEGORIES */
|
|
.stats-cards {
|
|
display: contents;
|
|
}
|
|
|
|
.stat-card {
|
|
background: rgba(255, 255, 255, 0.98);
|
|
border-radius: 8px;
|
|
padding: 1.5rem;
|
|
text-align: center;
|
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
|
transition: all 0.3s ease;
|
|
color: #333;
|
|
}
|
|
|
|
.stat-card:hover {
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
|
|
}
|
|
|
|
.stat-number {
|
|
font-size: 2.2rem;
|
|
font-weight: bold;
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
|
|
.stat-label {
|
|
font-size: 0.9rem;
|
|
font-weight: 600;
|
|
color: #555;
|
|
}
|
|
|
|
/* TOP KPIs SECTION */
|
|
.top-kpis-section {
|
|
background: rgba(255, 255, 255, 0.98);
|
|
border-radius: 8px;
|
|
padding: 1.5rem;
|
|
color: #333;
|
|
}
|
|
|
|
.top-kpis-section h2 {
|
|
font-size: 1.3rem;
|
|
margin-bottom: 1.2rem;
|
|
color: #333;
|
|
}
|
|
|
|
/* CATEGORY SECTION */
|
|
.category-section {
|
|
background: rgba(255, 255, 255, 0.98);
|
|
border-radius: 8px;
|
|
padding: 1.5rem;
|
|
color: #333;
|
|
}
|
|
|
|
.category-header h2 {
|
|
font-size: 1.2rem;
|
|
margin: 0 0 1rem 0;
|
|
padding-bottom: 0.8rem;
|
|
border-bottom: 2px solid rgba(0, 0, 0, 0.1);
|
|
}
|
|
|
|
.kpi-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
|
|
gap: 1rem;
|
|
}
|
|
|
|
/* SUMMARY SECTION */
|
|
.summary-section {
|
|
padding: 1rem;
|
|
background: linear-gradient(135deg, #f5f7fa 0%, #e8ebf0 100%);
|
|
border-radius: 6px;
|
|
border-left: 4px solid #667eea;
|
|
}
|
|
|
|
.summary-section h3 {
|
|
font-size: 1rem;
|
|
margin-bottom: 0.8rem;
|
|
color: #333;
|
|
}
|
|
|
|
.alerts-list {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 0.6rem;
|
|
margin-bottom: 1rem;
|
|
max-height: 180px;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
.alert-item {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.6rem;
|
|
padding: 0.7rem;
|
|
border-radius: 4px;
|
|
background: white;
|
|
border-left: 3px solid #ddd;
|
|
}
|
|
|
|
.alert-item.critical {
|
|
border-left-color: #e74c3c;
|
|
background: rgba(231, 76, 60, 0.05);
|
|
}
|
|
|
|
.alert-item.warning {
|
|
border-left-color: #f39c12;
|
|
background: rgba(243, 156, 18, 0.05);
|
|
}
|
|
|
|
.alert-item.good {
|
|
border-left-color: #27ae60;
|
|
background: rgba(39, 174, 96, 0.05);
|
|
}
|
|
|
|
.alert-icon {
|
|
font-size: 1.2rem;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.alert-content {
|
|
flex: 1;
|
|
min-width: 0;
|
|
}
|
|
|
|
.alert-title {
|
|
font-size: 0.8rem;
|
|
color: #666;
|
|
margin-bottom: 0.2rem;
|
|
}
|
|
|
|
.alert-value {
|
|
font-size: 0.95rem;
|
|
font-weight: 600;
|
|
color: #333;
|
|
}
|
|
|
|
.score-section {
|
|
text-align: center;
|
|
padding: 0.8rem;
|
|
background: white;
|
|
border-radius: 4px;
|
|
border: 1px solid #e0e0e0;
|
|
}
|
|
|
|
.score-label {
|
|
font-size: 0.8rem;
|
|
color: #999;
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
|
|
.score-circle {
|
|
font-size: 2rem;
|
|
font-weight: bold;
|
|
color: #667eea;
|
|
}
|
|
|
|
.category-section {
|
|
padding: 1rem;
|
|
background: #f9f9f9;
|
|
border-radius: 6px;
|
|
border-left: 4px solid #ddd;
|
|
}
|
|
|
|
.category-section h3 {
|
|
font-size: 1rem;
|
|
margin-bottom: 0.8rem;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
color: #333;
|
|
}
|
|
|
|
.kpis-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
|
|
gap: 0.8rem;
|
|
}
|
|
|
|
/* RESPONSIVE */
|
|
@media (max-width: 1200px) {
|
|
.kpis-grid {
|
|
grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
|
|
}
|
|
|
|
.categories-grid {
|
|
grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
|
|
}
|
|
}
|
|
|
|
@media (max-width: 768px) {
|
|
.overview-header {
|
|
flex-direction: column;
|
|
align-items: flex-start;
|
|
}
|
|
|
|
.overview-header h1 {
|
|
font-size: 1.3rem;
|
|
}
|
|
|
|
.stats-grid {
|
|
grid-template-columns: repeat(2, 1fr);
|
|
}
|
|
|
|
.top-kpis-section {
|
|
padding: 1rem;
|
|
}
|
|
|
|
.categories-grid {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
|
|
.kpis-grid {
|
|
grid-template-columns: repeat(2, 1fr);
|
|
}
|
|
}
|