From: Chris Fulljames Date: Fri, 27 Jun 2025 10:50:48 +0000 (-0400) Subject: Fix player button colors bug on iOS X-Git-Url: https://littlesong.place/gitweb/?a=commitdiff_plain;h=6c06b566b05b7207d5f3938bf4b80edc09355df9;p=littlesongplace.git Fix player button colors bug on iOS (#22) This forces a gif color refresh after any player updates. Probably adds a performance hit, but seems to be the only workaround. --- diff --git a/src/littlesongplace/static/player.js b/src/littlesongplace/static/player.js index 93fe811..9cc80cc 100644 --- a/src/littlesongplace/static/player.js +++ b/src/littlesongplace/static/player.js @@ -106,6 +106,7 @@ function playCurrentSong() { function showBigPlayer() { document.getElementById("mini-player").hidden = true; document.getElementById("player").hidden = false; + updateImageColors(); } function showMiniPlayer(event) { @@ -115,6 +116,7 @@ function showMiniPlayer(event) { bigPlayer.hidden = true; document.getElementById("mini-player").hidden = false; } + updateImageColors(); } // Play or pause the current song in the player @@ -205,6 +207,7 @@ document.addEventListener("DOMContentLoaded", (event) => { button.src = customImage(document.getElementById("lsp_btn_pause02"), button); miniButton.className = "lsp_btn_pause02"; miniButton.src = customImage(document.getElementById("lsp_btn_pause02"), button); + updateImageColors(); }) // Show play button when audio is paused @@ -213,6 +216,7 @@ document.addEventListener("DOMContentLoaded", (event) => { button.src = customImage(document.getElementById("lsp_btn_play02"), button); miniButton.className = "lsp_btn_play02"; miniButton.src = customImage(document.getElementById("lsp_btn_play02"), button); + updateImageColors(); }) // Audio position scrubbing