From 32af17317cfee72d2775167ebf05a040d8a7a990 Mon Sep 17 00:00:00 2001 From: Woody Date: Fri, 17 Nov 2023 14:28:48 +0100 Subject: [PATCH] minor improvements --- wled00/data/index.css | 14 +++++++++++++- wled00/data/index.js | 16 ++++++++-------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/wled00/data/index.css b/wled00/data/index.css index ab446a21d..e5b61e8c8 100644 --- a/wled00/data/index.css +++ b/wled00/data/index.css @@ -758,10 +758,14 @@ input[type=range]::-moz-range-thumb { margin: 4px 0 0; } -/* Dynamically hide brightness slider label */ +/* Dynamically hide labels */ .hd { display: var(--bhd); } +/* Do not hide labels when in simplified mode */ +.simplified .hd { + display: var(--bhd) !important; +} #briwrap { min-width: 300px; @@ -1325,6 +1329,14 @@ TD .checkmark, TD .radiomark { top: calc(var(--sti) + 42px); } +#pallist.simplified { + height: 300px; + overflow: scroll; + /* Fix shadow */ + margin: 0px -16px; + padding: 0px 16px; +} + #pallist.simplified .lstI.selected { top: 42px; } diff --git a/wled00/data/index.js b/wled00/data/index.js index 377adf180..5c1233a23 100644 --- a/wled00/data/index.js +++ b/wled00/data/index.js @@ -3027,13 +3027,14 @@ function simplifyUI() { // Put effects below palett list gId("Colors").innerHTML += gId("Effects").innerHTML; - gId("modeLabel").classList.remove("hd"); + gId("fx").classList.add("simplified"); // Put segments before palette list if there are multiple segments if (lastinfo.leds.seglc.length > 1) { gId("Colors").insertBefore(gId("segcont"), gId("pall")); } // Put preset quick load before palette list and segemts gId("Colors").insertBefore(gId("pql"), gId("pall")); + gId("pql").classList.add("simplified"); // Create dropdown for palette list let div = document.createElement("div"); @@ -3047,6 +3048,11 @@ function simplifyUI() { btn.innerText = "Change palette"; btn.addEventListener("click", () => { div.classList.toggle("hide"); + if (div.classList.contains("hide")) { + btn.innerText = "Change palette"; + } else { + btn.innerText = "Hide palettes"; + } }); gId("palw").prepend(div); gId("palw").prepend(btn); @@ -3066,13 +3072,7 @@ function simplifyUI() { gId("Segments").style.display = "none"; gId("Presets").style.display = "none"; - // Chage height of palette list - gId("pallist").style.height = "300px"; - gId("pallist").style.overflow = "scroll"; - // Fix shadow - gId("pallist").style.margin = "0px -16px"; - gId("pallist").style.padding = "0px 16px"; - // Set correct position of selected and sticky palette + // Simplify palette list gId("pallist").classList.add("simplified"); // We only want Effect Search to stay on top gId("palw").firstElementChild.classList.remove("staytop");