Browse Source

webui: color hierarchy for custom toggle

pull/2611/head
Maxim Prokhorov 1 week ago
parent
commit
ddcbd0e885
22 changed files with 13516 additions and 13475 deletions
  1. BIN
      code/espurna/data/index.all.html.gz
  2. BIN
      code/espurna/data/index.curtain.html.gz
  3. BIN
      code/espurna/data/index.garland.html.gz
  4. BIN
      code/espurna/data/index.light.html.gz
  5. BIN
      code/espurna/data/index.lightfox.html.gz
  6. BIN
      code/espurna/data/index.rfbridge.html.gz
  7. BIN
      code/espurna/data/index.rfm69.html.gz
  8. BIN
      code/espurna/data/index.sensor.html.gz
  9. BIN
      code/espurna/data/index.small.html.gz
  10. BIN
      code/espurna/data/index.thermostat.html.gz
  11. +2343
    -2341
      code/espurna/static/index.all.html.gz.h
  12. +1416
    -1414
      code/espurna/static/index.curtain.html.gz.h
  13. +1023
    -1020
      code/espurna/static/index.garland.html.gz.h
  14. +1996
    -1993
      code/espurna/static/index.light.html.gz.h
  15. +1024
    -1021
      code/espurna/static/index.lightfox.html.gz.h
  16. +1421
    -1419
      code/espurna/static/index.rfbridge.html.gz.h
  17. +1059
    -1056
      code/espurna/static/index.rfm69.html.gz.h
  18. +1154
    -1152
      code/espurna/static/index.sensor.html.gz.h
  19. +1009
    -1006
      code/espurna/static/index.small.html.gz.h
  20. +1044
    -1041
      code/espurna/static/index.thermostat.html.gz.h
  21. +6
    -2
      code/gulpfile.js
  22. +21
    -10
      code/html/src/index.css

BIN
code/espurna/data/index.all.html.gz View File


BIN
code/espurna/data/index.curtain.html.gz View File


BIN
code/espurna/data/index.garland.html.gz View File


BIN
code/espurna/data/index.light.html.gz View File


BIN
code/espurna/data/index.lightfox.html.gz View File


BIN
code/espurna/data/index.rfbridge.html.gz View File


BIN
code/espurna/data/index.rfm69.html.gz View File


BIN
code/espurna/data/index.sensor.html.gz View File


BIN
code/espurna/data/index.small.html.gz View File


BIN
code/espurna/data/index.thermostat.html.gz View File


+ 2343
- 2341
code/espurna/static/index.all.html.gz.h
File diff suppressed because it is too large
View File


+ 1416
- 1414
code/espurna/static/index.curtain.html.gz.h
File diff suppressed because it is too large
View File


+ 1023
- 1020
code/espurna/static/index.garland.html.gz.h
File diff suppressed because it is too large
View File


+ 1996
- 1993
code/espurna/static/index.light.html.gz.h
File diff suppressed because it is too large
View File


+ 1024
- 1021
code/espurna/static/index.lightfox.html.gz.h
File diff suppressed because it is too large
View File


+ 1421
- 1419
code/espurna/static/index.rfbridge.html.gz.h
File diff suppressed because it is too large
View File


+ 1059
- 1056
code/espurna/static/index.rfm69.html.gz.h
File diff suppressed because it is too large
View File


+ 1154
- 1152
code/espurna/static/index.sensor.html.gz.h
File diff suppressed because it is too large
View File


+ 1009
- 1006
code/espurna/static/index.small.html.gz.h
File diff suppressed because it is too large
View File


+ 1044
- 1041
code/espurna/static/index.thermostat.html.gz.h
File diff suppressed because it is too large
View File


+ 6
- 2
code/gulpfile.js View File

@ -419,7 +419,7 @@ function buildWebUI(name, modules, compress = true) {
function serveWebUI(name, modules) {
const server = http.createServer();
server.on('request', function(request, response) {
server.on('request', (request, response) => {
buildHtml(name, modules, false).pipe(
through.obj(function(source, _, callback) {
const url = new URL(`http://localhost${request.url}`);
@ -463,7 +463,11 @@ function serveWebUI(name, modules) {
}));
});
server.listen(8080);
server.on('listening', () => {
console.log(`Serving ${SRC_DIR} index and *.mjs at`, server.address());
});
server.listen(8080, 'localhost');
}
// -----------------------------------------------------------------------------


+ 21
- 10
code/html/src/index.css View File

@ -304,13 +304,15 @@ span.slider {
-------------------------------------------------------------------------- */
input.checkbox-toggle {
--toggle-text-color: #fff;
--toggle-text-color: white;
--toggle-border-radius: 100px;
--toggle-handle-size: .6em;
--toggle-elem-size: 2em;
--toggle-bg-size: 3em;
--toggle-handle-gap: .2em;
--toggle-fg: #c00000;
--toggle-color-off: #c00000; /* redish */
--toggle-color-on: #00c000; /* greenish */
--toggle-fg: var(--toggle-color-off);
--toggle-bg: color-mix(in srgb, var(--toggle-fg) 20%, transparent);
appearance: none;
@ -333,7 +335,7 @@ input.checkbox-toggle {
/* only ::before is used for content, adjust padding to move the toggle to a specific position */
input.checkbox-toggle:checked {
padding-inline: var(--toggle-bg-size) 0;
--toggle-fg: #00c000; /* greenish */
--toggle-fg: var(--toggle-color-on);
}
input.checkbox-toggle::before {
@ -342,10 +344,6 @@ input.checkbox-toggle::before {
width: var(--toggle-elem-size);
}
input.checkbox-toggle:checked::before {
--toggle-fg: #00c000; /* greenish */
}
/* checkboxes are usually allow DISABLING and ENABLING settings */
input.checkbox-toggle::before {
content: "NO";
@ -363,6 +361,16 @@ input.checkbox-toggle::before {
transition: inherit;
}
/* module-light */
input[name=light-state-value].checkbox-toggle {
--toggle-color-off: black;
--toggle-color-on: #fdfd3e;
}
input[name=light-state-value].checkbox-toggle:checked::before {
--toggle-text-color: black;
}
/* module-relay */
input[name=relay].checkbox-toggle::before,
input[name=light-state-value].checkbox-toggle::before {
@ -380,14 +388,17 @@ input[name=thermostatMode].checkbox-toggle::before {
--toggle-bg-size: 3em;
}
input[name=thermostatMode].checkbox-toggle {
--toggle-color-off: hsl(0, 100%, 50%);
--toggle-color-on: hsl(180, 100%, 50%);
}
input[name=thermostatMode].checkbox-toggle::before {
--toggle-fg: hsl(0, 100%, 50%);
content: "HEATER";
}
input[name=thermostatMode].checkbox-toggle:checked::before {
--toggle-fg: hsl(180, 100%, 50%);
color: black;
--toggle-text-color: black;
content: "COOLER";
}


Loading…
Cancel
Save