Skip to content
Extraits de code Groupes Projets
Vérifiée Valider 4c64ca54 rédigé par salixor's avatar salixor
Parcourir les fichiers

Use a class for nowPlaying + fix "Uncaught ReferenceError: currentSongs is not defined"

parent 7e087f36
Aucune étiquette associée trouvée
1 requête de fusion!15Playlist system creation
...@@ -122,7 +122,7 @@ window.onload = () => { ...@@ -122,7 +122,7 @@ window.onload = () => {
ipcRenderer.send('reload-db-request', { ipcRenderer.send('reload-db-request', {
search: `${$('#filterInput').val()}`, search: `${$('#filterInput').val()}`,
}); });
}) });
document.addEventListener( document.addEventListener(
'keydown', 'keydown',
...@@ -346,21 +346,21 @@ ipcRenderer.on('send-song-time-data', (event, timeData) => { ...@@ -346,21 +346,21 @@ ipcRenderer.on('send-song-time-data', (event, timeData) => {
if (timeData.state == 'play' || timeData.state == 'pause') { if (timeData.state == 'play' || timeData.state == 'pause') {
if (currentSong != timeData.song) { if (currentSong != timeData.song) {
if (currentSongElement) { if (currentSongElement) {
currentSongElement.style.background = '#4e5d6c'; currentSongElement.classList.remove('nowPlaying');
} }
tmp = document.getElementById(`pos-${currentSongPos.toString()}`); tmp = document.getElementById(`pos-${currentSongPos}`);
if (tmp) tmp.parentElement.style.background = '#4e5d6c'; if (tmp) tmp.parentElement.classList.remove('nowPlaying');
currentSongPos = parseInt(timeData.song) + 1; currentSongPos = parseInt(timeData.song) + 1;
currentSongElement = document.getElementById(`pos-${currentSongPos.toString()}`).parentElement; currentSongElement = document.getElementById(`pos-${currentSongPos}`).parentElement;
currentSong = timeData.song; currentSong = timeData.song;
currentSongElement.style.background = '#6b7d8e'; currentSongElement.classList.add('nowPlaying');
currentSongElement.scrollIntoView(true); currentSongElement.scrollIntoView(true);
} }
document.getElementById(`pos-${currentSongPos.toString()}`).parentElement.style.background = '#6b7d8e'; document.getElementById(`pos-${currentSongPos}`).parentElement.classList.add('nowPlaying');
} else { } else {
if (currentSongElement) currentSongElement.style.background = '#4e5d6c'; if (currentSongElement) currentSongElement.classList.remove('nowPlaying');
currentSong = document.getElementById(`pos-${currentSongPos.toString()}`); currentSong = document.getElementById(`pos-${currentSongPos}`);
if (currentSong) currentSongs.parentElement.style.background = '#4e5d6c'; if (currentSong) currentSong.parentElement.classList.remove('nowPlaying');
} }
}); });
......
...@@ -125,6 +125,10 @@ input[type="color"]:focus, ...@@ -125,6 +125,10 @@ input[type="color"]:focus,
margin: 0px !important; margin: 0px !important;
} }
.karaCard.nowPlaying {
background-color: #6b7d8e;
}
.karaElement { .karaElement {
height: fit-content; height: fit-content;
margin: auto; margin: auto;
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter