Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions wled00/data/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ var pN = "", pI = 0, pNum = 0;
var pmt = 1, pmtLS = 0;
var lastinfo = {};
var isM = false, mw = 0, mh=0;
var bsOpts = null; // blending style options snapshot, used for dynamic filtering based on matrix mode (iOS compatibility)
var ws, wsRpt=0;
var cfg = {
theme:{base:"dark", bg:{url:"", rnd: false, rndGrayscale: false, rndBlur: false}, alpha:{bg:0.6,tab:0.8}, color:{bg:""}},
Expand Down Expand Up @@ -660,12 +661,14 @@ function parseInfo(i) {
mw = i.leds.matrix ? i.leds.matrix.w : 0;
mh = i.leds.matrix ? i.leds.matrix.h : 0;
isM = mw>0 && mh>0;
if (!bsOpts) bsOpts = Array.from(gId('bs').options).map(o => o.cloneNode(true)); // snapshot all options on first call
const bsSel = gId('bs');
// note: style.display='none' for option elements is not supported on all browsers (notably iOS)
bsSel.replaceChildren(...bsOpts.filter(o => isM || o.dataset.type !== "2D").map(o => o.cloneNode(true))); // allow all in matrix mode, filter 2D blends otherwise
if (!isM) {
gId("filter2D").classList.add('hide');
gId('bs').querySelectorAll('option[data-type="2D"]').forEach((o,i)=>{o.style.display='none';});
gId("filter2D").classList.add('hide'); // hide 2D effects in non-matrix mode
} else {
gId("filter2D").classList.remove('hide');
gId('bs').querySelectorAll('option[data-type="2D"]').forEach((o,i)=>{o.style.display='';});
gId("filter2D").classList.remove('hide');
}
gId("updBt").style.display = (i.opt & 1) ? '':'none';
// if (i.noaudio) {
Expand Down Expand Up @@ -1457,7 +1460,9 @@ function readState(s,command=false)

tr = s.transition;
gId('tt').value = tr/10;
gId('bs').value = s.bs || 0;
const bsSel = gId('bs');
bsSel.value = s.bs || 0; // assign blending style
if (!bsSel.value) bsSel.value = 0; // fall back to Fade if option does not exist
if (tr===0) gId('bsp').classList.add('hide')
else gId('bsp').classList.remove('hide')

Expand Down
Loading