miniplayer: add pause when going on music page

This commit is contained in:
Agahnim 2026-03-23 13:26:04 +01:00
parent ec6a14c9c0
commit 5544379890
Signed by: Agahnim
SSH key fingerprint: SHA256:Zj65PJnE0dRYye8Ltk/qDglynyXUxJngQ9qqx/VI+b4
3 changed files with 16 additions and 1 deletions

View file

@ -108,6 +108,17 @@ function initMiniPlayer() {
handlePlayPause();
}
});
audio.addEventListener("pause", () => {
isPlaying = false;
updatePlayState();
});
audio.addEventListener("play", () => {
isPlaying = true;
updatePlayState();
});
}
initMiniPlayer();

View file

@ -37,6 +37,10 @@
if (miniplayer) {
miniplayer.style.display = isMusicPage ? 'none' : '';
}
if (isMusicPage) {
const audio = document.querySelector('mini-player audio');
if (audio) audio.pause();
}
}
function updateNavState() {

View file

@ -52,7 +52,7 @@
<a href="https://www.instagram.com/agahnim_music/" target="_blank"><img src="/static/assets/icons/insta.webp"
width="30px" /></a>
</socials>
<img src="/static/assets/gifs/divider2.gif" />
<img width="200px" src="/static/assets/gifs/divider2.gif" />
</box>
</boxes>
</home-content>