Add dynamic iframe for background music across multiple pages

This commit is contained in:
miles committed 2025-04-15 13:37:20 +00:00
1 parent 44c62f1882
commit f42a879bf1
4 files changed
+47 -7

No files matched your search

+9
View File
@@ -275,6 +275,15 @@
}
}
// Add the iframe dynamically if it doesn't already exist
if (!document.getElementById('musicIframe')) {
const iframe = document.createElement('iframe');
iframe.src = 'music.html';
iframe.id = 'musicIframe';
iframe.style.display = 'none';
document.body.appendChild(iframe);
}
// Set the initial state of the button
window.onload = () => {
const musicEnabled = localStorage.getItem('backgroundMusicEnabled') === 'true';