UI update.

This commit is contained in:
Blaz Kristan
2023-04-14 17:15:02 +02:00
parent e964c62907
commit ece6759fa7
7 changed files with 2260 additions and 1955 deletions

View File

@@ -1256,7 +1256,7 @@ TD .checkmark, TD .radiomark {
position: relative;
width: 280px;
transition: background-color 0.5s;
margin: auto auto 20px;
margin: auto auto 10px;
font-size: 19px;
line-height: 24px;
}

View File

@@ -198,6 +198,10 @@
</label>
</div>
</div>
<div style="padding-bottom: 10px;">
<button class="btn btn-xs" type="button" onclick="window.location.href=(loc?'http://'+locip:'')+'/cpal.htm'"><i class="icons btn-icon">&#xe18a;</i></button>
<button class="btn btn-xs" type="button" onclick="palettesData=null;localStorage.removeItem('wledPalx');requestJson({rmcpal:true});setTimeout(loadPalettes,250,loadPalettesData);"><i class="icons btn-icon">&#xe037;</i></button>
</div>
</div>
</div>

View File

@@ -883,8 +883,21 @@ function populatePalettes()
`<div class="lstIprev" style="${genPalPrevCss(pa[0])}"></div>`
);
}
gId('pallist').innerHTML=html;
// append custom palettes (when loading for the 1st time)
if (!isEmpty(lastinfo) && lastinfo.cpalcount) {
for (let j = 0; j<lastinfo.cpalcount; j++) {
let div = d.createElement("div");
gId('pallist').appendChild(div);
div.outerHTML = generateListItemHtml(
'palette',
255-j,
'~ Custom '+j+' ~',
'setPalette',
`<div class="lstIprev" style="${genPalPrevCss(255-j)}"></div>`
);
}
}
}
function redrawPalPrev()
@@ -1587,21 +1600,8 @@ function requestJson(command=null)
if (json.success) return;
if (json.info) {
let i = json.info;
// append custom palettes (when loading for the 1st time)
if (!command && isEmpty(lastinfo) && i.cpalcount) {
for (let j = 0; j<i.cpalcount; j++) {
let div = d.createElement("div");
gId('pallist').appendChild(div);
div.outerHTML = generateListItemHtml(
'palette',
255-j,
'~ Custom '+j+' ~',
'setPalette',
`<div class="lstIprev" style="${genPalPrevCss(255-j)}"></div>`
);
}
}
parseInfo(i);
populatePalettes(i);
if (isInfo) populateInfo(i);
}
var s = json.state ? json.state : json;