From 76cd909db2f094e96ac69ac000fd1f1bbe9c39ed Mon Sep 17 00:00:00 2001 From: Rishav-01 <99081530+Rishav-01@users.noreply.github.com> Date: Tue, 3 Oct 2023 13:46:20 +0530 Subject: [PATCH] Update script.js --- script.js | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/script.js b/script.js index f11f723..12af0e8 100644 --- a/script.js +++ b/script.js @@ -6,8 +6,6 @@ let myProgressbar = document.getElementById('progress-bar'); let gif = document.getElementById('gif'); let nextButton = document.getElementById('next'); let backButton = document.getElementById('backward'); -let muteButton=document.querySelector('.volume-toggle'); - // let timer = document.getElementById('current-timer').innerText; let volume_slider = document.querySelector(".volume_slider"); let songs = [ @@ -99,6 +97,7 @@ Array.from(document.getElementsByClassName('song-item-play')).forEach((element) masterPlay.classList.add('fa-circle-pause'); audioElement.src = `assets/songs/${songIndex + 1}.mp3`; audioElement.currentTime = 0; + myProgressbar.value = 0; audioElement.play(); addBackColor(); }) @@ -147,7 +146,6 @@ backButton.addEventListener('click', () => { // set volume volume_slider.value = 10; - audioElement.volume = volume_slider.value / 100; function setVolume() { audioElement.volume = volume_slider.value / 100; @@ -164,7 +162,6 @@ audioElement.addEventListener('ended', () => { myProgressbar.value = 0; }) - // timer updates setInterval(() => { tt = "0"; @@ -182,18 +179,3 @@ setInterval(() => { document.getElementById('current-timer').innerText = "00:00"; } }, 1000); - -muteButton.addEventListener('click',()=>{ - if(muteButton.classList.contains('fa-volume-down')){ - muteButton.classList.remove('fa-volume-down'); - muteButton.classList.add('fa-volume-up'); - audioElement.volume=0; - - } - else{ - muteButton.classList.add('fa-volume-down'); - muteButton.classList.remove('fa-volume-up'); - setVolume() - } - -}) \ No newline at end of file