diff options
Diffstat (limited to 'player.js')
-rw-r--r-- | player.js | 31 |
1 files changed, 31 insertions, 0 deletions
@@ -39,6 +39,19 @@ openDialog(); listenUploadFileChange(); + function showPlayerInterface() { + const musicPlayer = document.querySelector(".music-player"); + const progressBarContainer = document.getElementById("progress-bar-container"); + + if (musicPlayer) { + musicPlayer.classList.add("show"); + } + + if (progressBarContainer) { + progressBarContainer.classList.add("show"); + } + } + function initDynamicTooltips() { document.querySelectorAll("[title]").forEach((element) => { const title = element.getAttribute("title"); @@ -116,6 +129,12 @@ document.getElementById("initButton")?.addEventListener("click", async () => { var hydra = new Hydra({ detectAudio: false }); modalEl.classList.remove("open"); + + // Show the music player and progress bar with a slight delay for better effect + setTimeout(() => { + showPlayerInterface(); + }, 300); // Small delay to let the modal close animation start + getMusic().then(() => { playMusic(); }); @@ -128,6 +147,18 @@ downloadHistory(); }); + // Handle modal exit clicks (background and close button) + document.addEventListener("click", (event) => { + if (event.target.classList.contains("modal-exit") || event.target.id === "initButton") { + // Only trigger if modal is actually open + if (modalEl.classList.contains("open")) { + setTimeout(() => { + showPlayerInterface(); + }, 300); + } + } + }); + document.addEventListener("keyup", (event) => { if (!terminalOverlay.classList.contains("hidden")) { return; |