Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
wish13yt authored Oct 20, 2024
1 parent f2b3acc commit 7cb7f23
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions js/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const popup = document.getElementById('sound-popup');
const thanksButton = document.getElementById('thanks-button');
const thanksSound = document.getElementById('thanks-sound');
const backgroundMusic = document.getElementById('background-music');
const muteButton = document.getElementById('mute-button');
const githubButton = document.getElementById('github-button');
const discordButton = document.getElementById('discord-button');
Expand All @@ -21,22 +20,9 @@ thanksButton.addEventListener('click', () => {
muteButton.style.display = 'block';
pikidiaryButton.style.display = 'block';
freakyblog.style.display = 'block';
backgroundMusic.play();
}, 2000);
});

function toggleMusic() {
if (backgroundMusic.paused) {
backgroundMusic.play();
muteButton.textContent = 'Mute Music';
} else {
backgroundMusic.pause();
muteButton.textContent = 'Unmute Music';
}
}

muteButton.addEventListener('click', toggleMusic);

window.addEventListener('load', () => {
setTimeout(() => popup.style.display = 'flex', 500);
});
Expand Down Expand Up @@ -293,16 +279,3 @@ if (translations.hasOwnProperty(lang)) {

updateLanguage('en');
});
document.addEventListener("DOMContentLoaded", function() {
var myAudio = document.getElementById('background-music');

if (myAudio.duration > 0 && !myAudio.paused) {

element = document.getElementById('sound-popup')
element.delete();

} else {

//Not playing...maybe paused, stopped or never played.

}})

0 comments on commit 7cb7f23

Please sign in to comment.