feat: zmiana ikony play/pause w dashboardzie zależnie od stanu odtwarzania
This commit is contained in:
1 file changed
+8
-6
+8
-6
@@ -358,12 +358,14 @@ function updateUI(status) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 3. Play/Pause Button State
|
// 3. Play/Pause Button State
|
||||||
if (status.playing) {
|
const targetIcon = status.playing ? 'pause' : 'play';
|
||||||
playPauseIcon.setAttribute('data-lucide', 'pause');
|
if (btnPlayPause.dataset.state !== targetIcon) {
|
||||||
btnPlayPause.title = "Wstrzymaj";
|
btnPlayPause.dataset.state = targetIcon;
|
||||||
} else {
|
btnPlayPause.innerHTML = `<i data-lucide="${targetIcon}"></i>`;
|
||||||
playPauseIcon.setAttribute('data-lucide', 'play');
|
btnPlayPause.title = status.playing ? "Wstrzymaj" : "Odtwarzaj";
|
||||||
btnPlayPause.title = "Odtwarzaj";
|
if (window.lucide) {
|
||||||
|
lucide.createIcons();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 4. Volume State
|
// 4. Volume State
|
||||||
|
|||||||
Reference in new issue
Block a user