diff --git a/index.html b/index.html index 0890c0e..b62a086 100644 --- a/index.html +++ b/index.html @@ -9,14 +9,14 @@
-
@@ -66,5 +66,8 @@ +
+ Created by miti99 with ♥ +
diff --git a/script.js b/script.js index ced01b2..ca891fc 100644 --- a/script.js +++ b/script.js @@ -59,25 +59,8 @@ const playNewMusic = async (music) => { }; const initializeAudio = async () => { - try { - backgroundMusic.volume = 0; - await backgroundMusic.play(); - isMusicPlaying = true; - toggleButton.textContent = '🎵 Tạm dừng'; - - const fadeInInterval = setInterval(() => { - if (backgroundMusic.volume < 0.9) { - backgroundMusic.volume += 0.1; - } else { - clearInterval(fadeInInterval); - backgroundMusic.volume = 1.0; - } - }, 100); - } catch (error) { - console.log('Autoplay prevented:', error); - isMusicPlaying = false; - toggleButton.textContent = '🎵 Phát nhạc'; - } + isMusicPlaying = false; + toggleButton.textContent = '🎵 Phát nhạc'; }; window.addEventListener('DOMContentLoaded', initializeAudio); @@ -94,7 +77,7 @@ document.addEventListener('visibilitychange', () => { } }); -toggleButton.addEventListener('click', () => { +toggleButton.addEventListener('click', async () => { if (isMusicPlaying) { if (isSuccessScreen) { successMusic.pause(); @@ -104,9 +87,9 @@ toggleButton.addEventListener('click', () => { toggleButton.textContent = '🎵 Phát nhạc'; } else { if (isSuccessScreen) { - successMusic.play(); + await successMusic.play(); } else { - backgroundMusic.play(); + await backgroundMusic.play(); } toggleButton.textContent = '🎵 Tạm dừng'; } diff --git a/styles.css b/styles.css index b55908e..cfee714 100644 --- a/styles.css +++ b/styles.css @@ -88,6 +88,15 @@ display: none; } +.watermark { + position: fixed; + bottom: 10px; + width: 100%; + text-align: center; + font-size: 0.75rem; + color: #888; +} + @media (max-width: 640px) { .music-controls { bottom: 10px;