Skip to content

Commit c8bc5d1

Browse files
authored
Update script.js
1 parent b7e793b commit c8bc5d1

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

script.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,3 +337,15 @@ closePopup.onclick = () => {
337337

338338
// Show popup on load
339339
window.addEventListener("load", showPopup);
340+
341+
// ---- SFX Toggle Button ----
342+
const sfxButton = document.getElementById("toggleSFX");
343+
if (sfxButton) {
344+
sfxButton.onclick = () => {
345+
sfxEnabled = !sfxEnabled;
346+
sfxButton.textContent = `SFX: ${sfxEnabled ? "On" : "Off"}`;
347+
if (sfxEnabled) clickSound.play();
348+
addGlow(sfxButton);
349+
};
350+
}
351+

0 commit comments

Comments
 (0)