From 2bd1c332e2aaac3a9c329c3d8d93f4484299e011 Mon Sep 17 00:00:00 2001 From: Indrajith K L Date: Tue, 1 Jul 2025 01:49:10 +0530 Subject: New Features * Adds Glitch Entrance of Intro Modal (Into the Spiderverse Multidimensional jump) --- player.js | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'player.js') diff --git a/player.js b/player.js index 1d147ad..37fb33f 100644 --- a/player.js +++ b/player.js @@ -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; -- cgit v1.2.3