@grok just fix this dude

This commit is contained in:
Samidy 2026-01-08 15:20:49 +03:00
parent 999bff497c
commit 89b8e7e24b
2 changed files with 26 additions and 11 deletions

View file

@ -857,7 +857,7 @@
<div id="volume-bar" class="volume-bar"> <div id="volume-bar" class="volume-bar">
<div id="volume-fill" class="volume-fill"></div> <div id="volume-fill" class="volume-fill"></div>
</div> </div>
<button id="sleep-timer-btn" title="Sleep Timer"> <button id="sleep-timer-btn-desktop" title="Sleep Timer">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="12" cy="12" r="10"/> <circle cx="12" cy="12" r="10"/>
<polyline points="12,6 12,12 16,14"/> <polyline points="12,6 12,12 16,14"/>

View file

@ -13,7 +13,8 @@ export function initializePlayerEvents(player, audioPlayer, scrobbler, ui) {
const prevBtn = document.getElementById('prev-btn'); const prevBtn = document.getElementById('prev-btn');
const shuffleBtn = document.getElementById('shuffle-btn'); const shuffleBtn = document.getElementById('shuffle-btn');
const repeatBtn = document.getElementById('repeat-btn'); const repeatBtn = document.getElementById('repeat-btn');
const sleepTimerBtn = document.getElementById('sleep-timer-btn'); const sleepTimerBtnDesktop = document.getElementById('sleep-timer-btn-desktop');
const sleepTimerBtnMobile = document.getElementById('sleep-timer-btn');
// History tracking // History tracking
let historyLoggedTrackId = null; let historyLoggedTrackId = null;
@ -114,15 +115,29 @@ export function initializePlayerEvents(player, audioPlayer, scrobbler, ui) {
: (mode === REPEAT_MODE.ALL ? 'Repeat Queue' : 'Repeat One'); : (mode === REPEAT_MODE.ALL ? 'Repeat Queue' : 'Repeat One');
}); });
// Sleep Timer // Sleep Timer for desktop
sleepTimerBtn.addEventListener('click', () => { if (sleepTimerBtnDesktop) {
if (player.isSleepTimerActive()) { sleepTimerBtnDesktop.addEventListener('click', () => {
player.clearSleepTimer(); if (player.isSleepTimerActive()) {
showNotification('Sleep timer cancelled'); player.clearSleepTimer();
} else { showNotification('Sleep timer cancelled');
showSleepTimerModal(player); } else {
} showSleepTimerModal(player);
}); }
});
}
// Sleep Timer for mobile
if (sleepTimerBtnMobile) {
sleepTimerBtnMobile.addEventListener('click', () => {
if (player.isSleepTimerActive()) {
player.clearSleepTimer();
showNotification('Sleep timer cancelled');
} else {
showSleepTimerModal(player);
}
});
}
// Volume controls // Volume controls
const volumeBar = document.getElementById('volume-bar'); const volumeBar = document.getElementById('volume-bar');