Files
tianpu-ems/frontend/src/pages/BigScreen3D/styles.module.css
Du Wenbo 6a59f9af76 feat: add 3D interactive dashboard and 2D BigScreen pages
- New /bigscreen-3d route: React Three Fiber 3D campus with buildings,
  PV panels, heat pumps, meters, and sensors — all procedural geometry
- Interactive: hover highlight, click to select, camera fly-in to
  device detail views (PV inverter, heat pump, meter, heat meter, sensor)
- Real-time data: 15s polling for overview, 5s for selected device
- Energy flow particles along PV→Building, Grid→Building, Building→HP paths
- HUD overlay with date/clock, bottom metrics bar, device list panel
- New /bigscreen route: 2D dashboard with energy flow diagram, charts
- New /devices route: device management page
- Vite config: optimizeDeps.force for R3F dep consistency
- Data backfill script for testing

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 22:43:48 +08:00

330 lines
5.9 KiB
CSS

/* BigScreen 3D - Dark monitoring theme */
.container {
width: 100vw;
height: 100vh;
background: #0a1628;
position: relative;
overflow: hidden;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
color: #e0e8f0;
}
.placeholder {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
color: #00d4ff;
}
.placeholderTitle {
font-size: 2rem;
margin-bottom: 1rem;
}
/* Canvas fills entire screen */
.canvasWrapper {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
}
/* HUD overlay on top of canvas */
.hudOverlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 10;
pointer-events: none;
}
/* Header bar */
.header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px 24px;
background: linear-gradient(180deg, rgba(6, 30, 62, 0.95) 0%, transparent 100%);
pointer-events: none;
}
.headerDate {
font-size: 14px;
color: #8899aa;
min-width: 200px;
}
.headerTitle {
font-size: 24px;
font-weight: 700;
background: linear-gradient(90deg, #00d4ff, #00ff88, #00d4ff);
background-size: 200% auto;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
animation: shimmer 3s linear infinite;
text-align: center;
}
@keyframes shimmer {
to { background-position: 200% center; }
}
.headerClock {
font-size: 20px;
font-weight: 600;
color: #00d4ff;
font-variant-numeric: tabular-nums;
min-width: 200px;
text-align: right;
}
/* Bottom metrics bar */
.metricsBar {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
display: flex;
justify-content: center;
gap: 24px;
padding: 16px 24px;
background: linear-gradient(0deg, rgba(6, 30, 62, 0.95) 0%, transparent 100%);
pointer-events: none;
}
.metricCard {
display: flex;
flex-direction: column;
align-items: center;
padding: 8px 20px;
background: rgba(0, 212, 255, 0.08);
border: 1px solid rgba(0, 212, 255, 0.2);
border-radius: 8px;
min-width: 140px;
}
.metricLabel {
font-size: 12px;
color: #8899aa;
margin-bottom: 4px;
}
.metricValue {
font-size: 22px;
font-weight: 700;
color: #00d4ff;
font-variant-numeric: tabular-nums;
}
.metricUnit {
font-size: 12px;
color: #8899aa;
margin-left: 4px;
}
/* Left device list panel */
.deviceListPanel {
position: absolute;
top: 60px;
left: 16px;
width: 240px;
max-height: calc(100vh - 160px);
overflow-y: auto;
background: rgba(6, 30, 62, 0.85);
border: 1px solid rgba(0, 212, 255, 0.25);
border-radius: 8px;
padding: 12px;
z-index: 20;
pointer-events: auto;
}
.deviceListPanel::-webkit-scrollbar {
width: 4px;
}
.deviceListPanel::-webkit-scrollbar-thumb {
background: rgba(0, 212, 255, 0.3);
border-radius: 2px;
}
.deviceGroupTitle {
font-size: 13px;
font-weight: 600;
color: #00d4ff;
padding: 8px 0 4px;
border-bottom: 1px solid rgba(0, 212, 255, 0.15);
margin-bottom: 4px;
cursor: pointer;
user-select: none;
}
.deviceItem {
display: flex;
align-items: center;
padding: 6px 8px;
border-radius: 4px;
cursor: pointer;
transition: background 0.2s;
gap: 8px;
}
.deviceItem:hover {
background: rgba(0, 212, 255, 0.1);
}
.deviceItemActive {
background: rgba(0, 212, 255, 0.15);
border: 1px solid rgba(0, 212, 255, 0.3);
}
.statusDot {
width: 8px;
height: 8px;
border-radius: 50%;
flex-shrink: 0;
}
.deviceName {
font-size: 12px;
color: #e0e8f0;
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.deviceValue {
font-size: 11px;
color: #00d4ff;
font-variant-numeric: tabular-nums;
}
/* Right device info panel */
.deviceInfoPanel {
position: absolute;
top: 60px;
right: 16px;
width: 300px;
max-height: calc(100vh - 160px);
overflow-y: auto;
background: rgba(6, 30, 62, 0.9);
border: 1px solid rgba(0, 212, 255, 0.25);
border-radius: 8px;
padding: 16px;
z-index: 20;
pointer-events: auto;
}
.infoPanelHeader {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 12px;
padding-bottom: 8px;
border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}
.infoPanelTitle {
font-size: 16px;
font-weight: 600;
color: #e0e8f0;
}
.closeBtn {
background: none;
border: 1px solid rgba(0, 212, 255, 0.3);
color: #8899aa;
font-size: 14px;
cursor: pointer;
padding: 2px 8px;
border-radius: 4px;
transition: all 0.2s;
}
.closeBtn:hover {
color: #00d4ff;
border-color: #00d4ff;
}
.paramRow {
display: flex;
justify-content: space-between;
align-items: center;
padding: 6px 0;
border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.paramLabel {
font-size: 13px;
color: #8899aa;
}
.paramValue {
font-size: 15px;
font-weight: 600;
color: #00d4ff;
font-variant-numeric: tabular-nums;
}
.detailBtn {
width: 100%;
margin-top: 12px;
padding: 8px;
background: rgba(0, 212, 255, 0.15);
border: 1px solid rgba(0, 212, 255, 0.4);
border-radius: 6px;
color: #00d4ff;
font-size: 14px;
cursor: pointer;
transition: all 0.2s;
}
.detailBtn:hover {
background: rgba(0, 212, 255, 0.25);
}
/* Return button (detail view) */
.returnBtn {
position: absolute;
top: 70px;
left: 50%;
transform: translateX(-50%);
padding: 8px 24px;
background: rgba(6, 30, 62, 0.9);
border: 1px solid rgba(0, 212, 255, 0.4);
border-radius: 20px;
color: #00d4ff;
font-size: 14px;
cursor: pointer;
z-index: 25;
pointer-events: auto;
transition: all 0.2s;
}
.returnBtn:hover {
background: rgba(0, 212, 255, 0.2);
}
/* 3D label styles (used inside drei Html) */
.label3d {
font-size: 11px;
color: #e0e8f0;
background: rgba(6, 30, 62, 0.8);
padding: 2px 8px;
border-radius: 4px;
border: 1px solid rgba(0, 212, 255, 0.2);
white-space: nowrap;
pointer-events: none;
}
.label3dValue {
color: #00d4ff;
font-weight: 600;
margin-left: 4px;
}