Files
ESP32-ThermoPro-Bridge/frontend/static/style.css
T
Keith Solomon 9e32b1b179 feat: add PWA frontend for CYD ThermoPro dashboard
Add a Flask backend + SQLite + HTML/CSS/JS PWA that:
- Polls the CYD /api/latest endpoint
- Stores readings, sessions, and freeform notes in SQLite
- Displays probe cards with target setpoints and preset options
- Renders temperature history with Chart.js
- Serves a PWA manifest and dark-themed dashboard

Also update cyd-bridge/README.md with verified bringup instructions.
2026-07-20 20:14:48 -05:00

226 lines
3.7 KiB
CSS

:root {
--bg: #121212;
--surface: #1e1e1e;
--text: #f0f0f0;
--muted: #a0a0a0;
--accent: #ff6b35;
--ok: #4caf50;
--warn: #ff9800;
--danger: #f44336;
--radius: 12px;
--shadow: 0 2px 8px rgba(0,0,0,0.4);
}
* { box-sizing: border-box; }
body {
margin: 0;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
background: var(--bg);
color: var(--text);
line-height: 1.5;
}
header {
background: var(--surface);
padding: 1rem;
box-shadow: var(--shadow);
position: sticky;
top: 0;
z-index: 10;
}
header h1 {
margin: 0 0 0.5rem;
font-size: 1.5rem;
color: var(--accent);
}
#status-bar {
display: flex;
gap: 1rem;
font-size: 0.9rem;
color: var(--muted);
}
#status-bar .ok { color: var(--ok); }
#status-bar .warn { color: var(--warn); }
#status-bar .danger { color: var(--danger); }
main {
padding: 1rem;
max-width: 1200px;
margin: 0 auto;
}
.panel {
background: var(--surface);
border-radius: var(--radius);
padding: 1rem;
box-shadow: var(--shadow);
margin-bottom: 1rem;
}
.panel h2 {
margin-top: 0;
font-size: 1.1rem;
color: var(--accent);
}
#session-controls form {
display: flex;
flex-direction: column;
gap: 0.5rem;
margin-top: 0.75rem;
}
#session-controls input,
#session-controls textarea,
#session-controls select {
background: #2a2a2a;
border: 1px solid #333;
color: var(--text);
padding: 0.6rem;
border-radius: 6px;
font: inherit;
}
#session-controls textarea {
min-height: 80px;
resize: vertical;
}
#session-controls button {
background: var(--accent);
color: #fff;
border: none;
padding: 0.7rem 1rem;
border-radius: 6px;
cursor: pointer;
font-weight: bold;
}
#session-controls button:disabled {
background: #444;
cursor: not-allowed;
}
#end-session-btn {
margin-top: 0.5rem;
width: 100%;
}
#probe-cards {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
gap: 1rem;
}
.probe-card {
background: var(--surface);
border-radius: var(--radius);
padding: 1rem;
box-shadow: var(--shadow);
border-left: 4px solid var(--muted);
transition: border-color 0.2s;
}
.probe-card.connected {
border-left-color: var(--ok);
}
.probe-card .header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 0.5rem;
}
.probe-card .name {
font-weight: bold;
font-size: 1.1rem;
}
.probe-card .target {
font-size: 0.85rem;
color: var(--muted);
}
.probe-card .temp {
font-size: 2.5rem;
font-weight: 300;
margin: 0.5rem 0;
}
.probe-card .temp.disconnected {
color: var(--muted);
font-size: 1.8rem;
}
.probe-card .footer {
display: flex;
justify-content: space-between;
font-size: 0.85rem;
color: var(--muted);
}
.setpoint-editor {
margin-top: 0.75rem;
display: flex;
gap: 0.5rem;
flex-wrap: wrap;
}
.setpoint-editor input {
flex: 1;
min-width: 80px;
background: #2a2a2a;
border: 1px solid #333;
color: var(--text);
padding: 0.4rem;
border-radius: 4px;
}
.setpoint-editor button {
background: #333;
color: var(--text);
border: 1px solid #444;
padding: 0.4rem 0.7rem;
border-radius: 4px;
cursor: pointer;
}
.chart-controls {
display: flex;
gap: 1rem;
align-items: center;
margin-bottom: 1rem;
}
.chart-controls select,
.chart-controls button {
background: #2a2a2a;
border: 1px solid #333;
color: var(--text);
padding: 0.5rem;
border-radius: 6px;
}
.chart-controls button {
background: var(--accent);
border: none;
cursor: pointer;
}
footer {
text-align: center;
padding: 1rem;
color: var(--muted);
font-size: 0.85rem;
}
@media (max-width: 600px) {
#status-bar { flex-direction: column; gap: 0.25rem; }
.probe-card .temp { font-size: 2rem; }
}