dynamic dashboard initial

This commit is contained in:
2025-11-04 19:33:47 +01:00
parent 69e07056a1
commit ca623121a3
15 changed files with 1774 additions and 7 deletions

257
apps/ui/static/style.css Normal file
View File

@@ -0,0 +1,257 @@
/* Home Automation Dashboard Styles */
:root {
--primary-color: #3b82f6;
--primary-hover: #2563eb;
--bg-color: #f8fafc;
--card-bg: #ffffff;
--text-primary: #1e293b;
--text-secondary: #64748b;
--border-color: #e2e8f0;
--shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
background-color: var(--bg-color);
color: var(--text-primary);
line-height: 1.6;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 1rem;
}
/* Header */
header {
background-color: var(--card-bg);
border-radius: 0.5rem;
padding: 1.5rem;
margin-bottom: 2rem;
box-shadow: var(--shadow);
}
header h1 {
font-size: 2rem;
font-weight: 700;
color: var(--text-primary);
}
/* Main Content */
main {
margin-bottom: 2rem;
}
/* Room Section */
.room {
background-color: var(--card-bg);
border-radius: 0.5rem;
padding: 1.5rem;
margin-bottom: 1.5rem;
box-shadow: var(--shadow);
}
.room-title {
font-size: 1.5rem;
font-weight: 600;
margin-bottom: 1rem;
color: var(--text-primary);
border-bottom: 2px solid var(--border-color);
padding-bottom: 0.5rem;
}
/* Device Grid */
.devices-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 1rem;
}
/* Tablet: 2 columns */
@media (max-width: 1024px) {
.devices-grid {
grid-template-columns: repeat(2, 1fr);
}
}
/* Mobile: 1 column */
@media (max-width: 640px) {
.devices-grid {
grid-template-columns: 1fr;
}
}
/* Device Tile */
.device-tile {
background-color: var(--bg-color);
border: 1px solid var(--border-color);
border-radius: 0.5rem;
padding: 1rem;
display: flex;
flex-direction: column;
gap: 0.75rem;
transition: all 0.2s;
}
.device-tile:hover {
box-shadow: var(--shadow-lg);
transform: translateY(-2px);
}
.device-header {
display: flex;
align-items: flex-start;
gap: 0.75rem;
}
.device-icon {
font-size: 2.5rem;
flex-shrink: 0;
line-height: 1;
}
.device-info {
flex: 1;
min-width: 0;
}
.device-title {
font-size: 1rem;
font-weight: 600;
color: var(--text-primary);
margin-bottom: 0.25rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.device-id {
font-size: 0.75rem;
color: var(--text-secondary);
font-family: 'Monaco', 'Courier New', monospace;
}
/* Device State */
.device-state {
padding: 0.5rem;
background-color: var(--card-bg);
border-radius: 0.375rem;
text-align: center;
}
.state-text {
font-size: 0.875rem;
font-weight: 500;
color: var(--text-secondary);
}
/* Device Controls */
.device-controls {
display: flex;
gap: 0.5rem;
}
/* Buttons */
.btn {
flex: 1;
padding: 0.625rem 1rem;
border: none;
border-radius: 0.375rem;
font-size: 0.875rem;
font-weight: 600;
cursor: pointer;
transition: all 0.2s;
text-transform: uppercase;
letter-spacing: 0.025em;
}
.btn-on {
background-color: #10b981;
color: white;
}
.btn-on:hover {
background-color: #059669;
}
.btn-off {
background-color: #ef4444;
color: white;
}
.btn-off:hover {
background-color: #dc2626;
}
.btn:active {
transform: scale(0.98);
}
.btn-primary {
background-color: var(--primary-color);
color: white;
}
.btn-primary:hover {
background-color: var(--primary-hover);
}
.btn-primary:active {
transform: scale(0.98);
}
/* Empty State */
.empty-state {
background-color: var(--card-bg);
border-radius: 0.5rem;
padding: 3rem 1.5rem;
text-align: center;
box-shadow: var(--shadow);
}
.empty-state p {
font-size: 1.125rem;
color: var(--text-secondary);
margin-bottom: 0.5rem;
}
.empty-state .hint {
font-size: 0.875rem;
color: var(--text-secondary);
}
/* Footer */
footer {
text-align: center;
padding: 1rem;
color: var(--text-secondary);
font-size: 0.875rem;
}
/* Responsive */
@media (max-width: 768px) {
header h1 {
font-size: 1.5rem;
}
.room-title {
font-size: 1.25rem;
}
.container {
padding: 0.75rem;
}
.room {
padding: 1rem;
}
}