PFEE/dashboard-sqdc/src/styles/RangeChartModal.css
paul.roost ca05e334a7 feat: Implement server-side API for categories, KPIs, and measurements
- 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.
2025-10-21 13:31:14 +02:00

153 lines
2.4 KiB
CSS

.range-chart-modal-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
}
.range-chart-modal {
background: white;
border-radius: 12px;
padding: 2rem;
max-width: 90%;
width: 1100px;
max-height: 90vh;
overflow-y: auto;
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
animation: slideIn 0.3s ease-out;
}
@keyframes slideIn {
from {
transform: translateY(-50px);
opacity: 0;
}
to {
transform: translateY(0);
opacity: 1;
}
}
.range-chart-modal-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1.5rem;
padding-bottom: 1rem;
border-bottom: 2px solid #f0f0f0;
}
.range-chart-modal-header h2 {
margin: 0;
font-size: 1.8rem;
color: #333;
}
.range-chart-modal-close {
background: none;
border: none;
font-size: 1.5rem;
cursor: pointer;
color: #999;
transition: all 0.3s ease;
padding: 0;
width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
}
.range-chart-modal-close:hover {
color: #333;
background: #f5f5f5;
border-radius: 4px;
}
/* RANGE SELECTOR */
.range-chart-modal-range-selector {
display: flex;
gap: 0.8rem;
margin-bottom: 1.5rem;
flex-wrap: wrap;
}
.range-option {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0.6rem 1rem;
border: 2px solid #e0e0e0;
border-radius: 6px;
cursor: pointer;
transition: all 0.3s ease;
background: white;
font-weight: 600;
color: #333;
}
.range-option input {
display: none;
}
.range-option:hover {
border-color: #6496ff;
background: #f8f9ff;
}
.range-option.active {
background: #6496ff;
color: white;
border-color: #6496ff;
}
.range-chart-modal-body {
margin-bottom: 1.5rem;
background: #f9f9f9;
border-radius: 8px;
padding: 1rem;
}
.range-chart-modal-footer {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 1rem;
padding-top: 1rem;
border-top: 2px solid #f0f0f0;
color: #666;
}
.range-chart-modal-footer p {
margin: 0.5rem 0;
font-size: 0.95rem;
}
@media (max-width: 768px) {
.range-chart-modal {
width: 95%;
padding: 1rem;
}
.range-chart-modal-body {
height: 300px;
}
.range-chart-modal-range-selector {
flex-direction: column;
}
.range-option {
flex: 1;
}
.range-chart-modal-footer {
grid-template-columns: 1fr;
}
}