Skip to content

Commit

Permalink
Update script.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Rishav-01 authored Oct 3, 2023
1 parent 7dd31f0 commit 76cd909
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -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();
})
Expand Down Expand Up @@ -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;
Expand All @@ -164,7 +162,6 @@ audioElement.addEventListener('ended', () => {
myProgressbar.value = 0;
})


// timer updates
setInterval(() => {
tt = "0";
Expand All @@ -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()
}

})

0 comments on commit 76cd909

Please sign in to comment.