feat: Add audio assets, UI escape room polish, requirements, and INSTALL.md

This commit is contained in:
Maxi
2026-10-29 08:51:59 +01:00
parent c07c0e10b9
commit 3d30d0812a
17 changed files with 1367 additions and 180 deletions
+15 -1
View File
@@ -144,9 +144,18 @@ window.soundFX = new SoundFX();
function updateAudioButtonUI() {
const btn = document.getElementById('audioToggleBtn');
const bgm = document.getElementById('bgm');
if (!btn) return;
const isMuted = window.soundFX.isMuted();
btn.innerHTML = isMuted ? '🔇 <span class="audio-lbl">Ton: Aus</span>' : '🔊 <span class="audio-lbl">Ton: An</span>';
btn.innerHTML = isMuted ? '🔇 <span class="audio-lbl">Musik & Ton: Aus</span>' : '🔊 <span class="audio-lbl">Musik & Ton: An</span>';
if (bgm) {
bgm.volume = 0.45;
if (isMuted && !bgm.paused) {
bgm.pause();
} else if (!isMuted && bgm.paused) {
bgm.play().catch(() => {});
}
}
}
function toggleSound() {
@@ -158,5 +167,10 @@ document.addEventListener('DOMContentLoaded', () => {
updateAudioButtonUI();
document.body.addEventListener('click', () => {
window.soundFX.init();
const bgm = document.getElementById('bgm');
if (bgm && !window.soundFX.isMuted() && bgm.paused) {
bgm.volume = 0.45;
bgm.play().catch(() => {});
}
}, { once: true });
});