Add LED web UI with AP, Wi-Fi client, mDNS and patterns
Brings the led_strip example into the cpp app, targeting the ESP32-C3: - Access point led-XXXXXX (open) plus a Wi-Fi client configured from the web Settings tab, with credentials stored in NVS and reconnect backoff - mDNS as led.local with an HTTP service on port 80 - HTTP server with an embedded web UI and a JSON API for patterns and Wi-Fi - Pattern runner for solid, rainbow, chase, breathe, blink, pulse, transition and circle on a 119-LED WS2812 strip (GPIO 10) Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
df43820acd
commit
89f996096c
20 files changed
+1539
-18
No files matched your search
+121
@@ -0,0 +1,121 @@
|
||||
:root {
|
||||
--bg: #f6f6f7;
|
||||
--fg: #1d1d1f;
|
||||
--muted: #6e6e73;
|
||||
--card: #ffffff;
|
||||
--accent: #2563eb;
|
||||
--border: #d2d2d7;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root:not([data-theme="light"]) {
|
||||
--bg: #111114;
|
||||
--fg: #f2f2f5;
|
||||
--muted: #9a9aa3;
|
||||
--card: #1c1c21;
|
||||
--accent: #5b8cff;
|
||||
--border: #34343c;
|
||||
}
|
||||
}
|
||||
|
||||
:root[data-theme="dark"] {
|
||||
--bg: #111114;
|
||||
--fg: #f2f2f5;
|
||||
--muted: #9a9aa3;
|
||||
--card: #1c1c21;
|
||||
--accent: #5b8cff;
|
||||
--border: #34343c;
|
||||
}
|
||||
|
||||
* { box-sizing: border-box; }
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0 16px 32px;
|
||||
background: var(--bg);
|
||||
color: var(--fg);
|
||||
font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
||||
}
|
||||
|
||||
header {
|
||||
max-width: 560px;
|
||||
margin: 0 auto;
|
||||
padding: 16px 0 8px;
|
||||
}
|
||||
|
||||
h1 { margin: 0 0 12px; font-size: 1.5rem; }
|
||||
h2 { font-size: 1.1rem; margin: 20px 0 8px; }
|
||||
|
||||
nav { display: flex; gap: 8px; }
|
||||
|
||||
main {
|
||||
max-width: 560px;
|
||||
margin: 0 auto;
|
||||
background: var(--card);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 12px;
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
section > * + * { margin-top: 12px; }
|
||||
|
||||
label {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
output { font-weight: 400; color: var(--muted); }
|
||||
|
||||
.row { display: flex; gap: 16px; flex-wrap: wrap; }
|
||||
.row > label { flex: 1 1 140px; }
|
||||
|
||||
select, input[type="text"], input:not([type]), input[type="password"] {
|
||||
font: inherit;
|
||||
padding: 8px 10px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 8px;
|
||||
background: var(--bg);
|
||||
color: var(--fg);
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
input[type="color"] {
|
||||
width: 100%;
|
||||
height: 44px;
|
||||
padding: 2px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 8px;
|
||||
background: var(--bg);
|
||||
}
|
||||
|
||||
input[type="range"] { width: 100%; accent-color: var(--accent); }
|
||||
|
||||
button {
|
||||
font: inherit;
|
||||
padding: 8px 14px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 8px;
|
||||
background: var(--bg);
|
||||
color: var(--fg);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
button.tab.active,
|
||||
button[type="submit"] {
|
||||
background: var(--accent);
|
||||
border-color: var(--accent);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.list { list-style: none; padding: 0; margin: 0; }
|
||||
.list li + li { margin-top: 6px; }
|
||||
button.net { width: 100%; text-align: left; }
|
||||
|
||||
.muted { color: var(--muted); font-size: 0.9rem; }
|
||||
|
||||
[hidden] { display: none !important; }
|
||||
|
||||
form { display: flex; flex-direction: column; gap: 12px; }
|
||||
form button { align-self: flex-start; }
|
||||
Reference in new issue
Block a user