|
254 | 254 | width: calc(var(--n)*100%); |
255 | 255 | height: calc(100% - var(--tp) - var(--bh)); |
256 | 256 | margin-top: var(--tp); |
257 | | - transform: translate(calc(var(--tx, 0px) + var(--i, 0)/var(--n)*-100%)); |
| 257 | + transform: translate(calc(var(--i, 0)/var(--n)*-100%)); |
258 | 258 | overscroll-behavior: none; |
259 | 259 | } |
260 | 260 |
|
|
511 | 511 | #picker { |
512 | 512 | margin: 10px auto; |
513 | 513 | width: 260px; |
514 | | - filter: drop-shadow(0px 0px 1px #000); |
| 514 | + /*filter: drop-shadow(0px 0px 1px #000);*/ |
515 | 515 | } |
516 | 516 |
|
517 | 517 | #rgbwrap { |
|
527 | 527 | color: var(--c-f); |
528 | 528 | border: 0px solid white; |
529 | 529 | border-radius: 25px; |
530 | | - filter: drop-shadow(0px 0px 1px #000); |
| 530 | + /*filter: drop-shadow(0px 0px 1px #000);*/ |
531 | 531 | transition-duration: 0.5s; |
532 | 532 | -webkit-backface-visibility: hidden; |
533 | 533 | -webkit-transform:translate3d(0,0,0); |
|
603 | 603 | padding: 8px; |
604 | 604 | margin: 6px 6px 6px 0; |
605 | 605 | font-size: 19px; |
606 | | - transition: background 0.2s; |
| 606 | + transition: background-color 0.2s; |
607 | 607 | outline: none; |
608 | 608 | width: 50px; |
609 | 609 | -webkit-appearance: textfield; |
|
838 | 838 | color: var(--c-f); |
839 | 839 | border: 0px solid white; |
840 | 840 | border-radius: 20px; |
841 | | - filter: drop-shadow(0px 0px 1px #000); |
| 841 | + /*filter: drop-shadow(0px 0px 1px #000);*/ |
842 | 842 | text-align: left; |
843 | | - transition: background 0.5s; |
| 843 | + transition: background-color 0.5s; |
844 | 844 | } |
845 | 845 |
|
846 | 846 | .pres { |
|
1122 | 1122 | const ranges = RangeTouch.setup('input[type="range"]', {}); |
1123 | 1123 | var pJson = {}; |
1124 | 1124 | var pO = null, pN = "", pI = 0; |
1125 | | -var pmt = 1, pmtLS = 0; |
| 1125 | +var pmt = 1, pmtLS = 0, pmtLast = 0; |
1126 | 1126 | var lastinfo = {}; |
1127 | 1127 | var cfg = { |
1128 | 1128 | theme:{base:"dark", bg:{url:""}, alpha:{bg:0.6,tab:0.8}, color:{bg:""}}, |
|
1147 | 1147 | { |
1148 | 1148 | component: iro.ui.Slider, |
1149 | 1149 | options: { |
1150 | | - sliderType: 'kelvin' |
| 1150 | + sliderType: 'kelvin', |
| 1151 | + minTemperature: 2100, |
| 1152 | + maxTemperature: 10000 |
1151 | 1153 | } |
1152 | 1154 | } |
1153 | 1155 | ] |
|
1762 | 1764 | type = command ? 'post':'get'; |
1763 | 1765 | if (command) |
1764 | 1766 | { |
1765 | | - command.v = verbose; |
| 1767 | + command.v = verbose; |
| 1768 | + command.time = Math.floor(Date.now() / 1000); |
1766 | 1769 | req = JSON.stringify(command); |
1767 | 1770 | //console.log(req); |
1768 | 1771 | } |
|
1791 | 1794 | if (!command || rinfo) { |
1792 | 1795 | if (!rinfo) { |
1793 | 1796 | pmt = json.info.fs.pmt; |
1794 | | - if (pmt != pmtLS || pmt == 0) setTimeout(loadPresets,99); |
| 1797 | + if (pmt != pmtLS || pmt == 0) { |
| 1798 | + setTimeout(loadPresets,99); |
| 1799 | + pmtLast = pmt; |
| 1800 | + } |
1795 | 1801 | else populatePresets(true); |
1796 | 1802 | var x='',y='<option value="0">Default</option>'; |
1797 | 1803 | json.effects.shift(); //remove solid |
|
1820 | 1826 | isRgbw = info.leds.wv; |
1821 | 1827 | ledCount = info.leds.count; |
1822 | 1828 | syncTglRecv = info.str; |
1823 | | - maxSeg = info.leds.maxseg; |
| 1829 | + maxSeg = info.leds.maxseg; |
| 1830 | + pmt = info.fs.pmt; |
| 1831 | + if (pmt != pmtLast) setTimeout(loadPresets,99); |
| 1832 | + pmtLast = pmt; |
1824 | 1833 | lastinfo = info; |
1825 | 1834 | if (isInfo) populateInfo(info); |
1826 | 1835 | s = json.state; |
|
1884 | 1893 | }) |
1885 | 1894 | .catch(function (error) { |
1886 | 1895 | showToast(error, true); |
1887 | | - console.log(error); |
| 1896 | + console.log(error); |
1888 | 1897 | }) |
1889 | 1898 | } |
1890 | 1899 |
|
|
2358 | 2367 | //sliding UI |
2359 | 2368 | const _C = document.querySelector('.container'), N = 4; |
2360 | 2369 |
|
2361 | | -let iSlide = 0, x0 = null, y0 = null, scrollS = 0, locked = false, w; |
| 2370 | +let iSlide = 0, x0 = null, scrollS = 0, locked = false, w; |
2362 | 2371 |
|
2363 | 2372 | function unify(e) { return e.changedTouches ? e.changedTouches[0] : e } |
2364 | 2373 |
|
|
2367 | 2376 | var l = e.target.classList; |
2368 | 2377 | if (l.contains('noslide') || l.contains('iro__wheel__saturation') || l.contains('iro__slider__value') || l.contains('iro__slider')) return; |
2369 | 2378 | x0 = unify(e).clientX; |
2370 | | - y0 = unify(e).clientY; |
2371 | 2379 | scrollS = d.getElementsByClassName("tabcontent")[iSlide].scrollTop; |
2372 | 2380 |
|
2373 | 2381 | _C.classList.toggle('smooth', !(locked = true)) |
2374 | 2382 | } |
2375 | 2383 |
|
2376 | | -function drag(e) { |
2377 | | - if (!locked || pcMode) return; |
2378 | | - if (d.getElementsByClassName("tabcontent")[iSlide].scrollTop != scrollS) { |
2379 | | - move(e); return; |
2380 | | - } |
2381 | | - |
2382 | | - _C.style.setProperty('--tx', `${Math.round(unify(e).clientX - x0)}px`) |
2383 | | -} |
2384 | | - |
2385 | 2384 | function move(e) { |
2386 | 2385 | if(!locked || pcMode) return; |
2387 | 2386 | var dx = unify(e).clientX - x0, s = Math.sign(dx), |
2388 | 2387 | f = +(s*dx/w).toFixed(2); |
2389 | 2388 |
|
2390 | | - if((iSlide > 0 || s < 0) && (iSlide < N - 1 || s > 0) && f > .12) { |
| 2389 | + if((iSlide > 0 || s < 0) && (iSlide < N - 1 || s > 0) |
| 2390 | + && f > .12 |
| 2391 | + && d.getElementsByClassName("tabcontent")[iSlide].scrollTop == scrollS) { |
2391 | 2392 | _C.style.setProperty('--i', iSlide -= s); |
2392 | 2393 | f = 1 - f; |
2393 | 2394 | updateTablinks(iSlide); |
2394 | 2395 | } |
2395 | | - |
2396 | | - _C.style.setProperty('--tx', '0px'); |
2397 | 2396 | _C.style.setProperty('--f', f); |
2398 | 2397 | _C.classList.toggle('smooth', !(locked = false)); |
2399 | 2398 | x0 = null |
|
2425 | 2424 | d.getElementById('buttonPcm').className = (pcMode) ? "active":""; |
2426 | 2425 | d.getElementById('bot').style.height = (pcMode && !cfg.comp.pcmbot) ? "0":"auto"; |
2427 | 2426 | sCol('--bh', d.getElementById('bot').clientHeight + "px"); |
2428 | | - if (pcMode) |
2429 | | - { |
2430 | | - _C.style.width = '100%'; |
2431 | | - } else { |
2432 | | - _C.style.width = '400%'; |
2433 | | - } |
| 2427 | + _C.style.width = (pcMode)?'100%':'400%'; |
2434 | 2428 | lastw = w; |
2435 | 2429 | } |
2436 | 2430 |
|
|
2463 | 2457 | _C.addEventListener('mousedown', lock, false); |
2464 | 2458 | _C.addEventListener('touchstart', lock, false); |
2465 | 2459 |
|
2466 | | -_C.addEventListener('mousemove', drag, false); |
2467 | | -_C.addEventListener('touchmove', drag, false); |
2468 | | - |
2469 | 2460 | _C.addEventListener('mouseout', move, false); |
2470 | 2461 | _C.addEventListener('mouseup', move, false); |
2471 | 2462 | _C.addEventListener('touchend', move, false); |
|
0 commit comments