diff --git a/app.js b/app.js index 05c9b6f..2dbe7fb 100644 --- a/app.js +++ b/app.js @@ -139,6 +139,4 @@ assetFolders.forEach((folderName) => { response.sendFile(folderName+"/"+fileName, {root: __dirname }); }); }); -}); - - +}); \ No newline at end of file diff --git a/browserFunctions.js b/browserFunctions.js index 4c3411c..02c3234 100644 --- a/browserFunctions.js +++ b/browserFunctions.js @@ -27,14 +27,16 @@ function clearBuzzers() { $("#userListPanel").find("var").html(""); } -function buzzInfoToClient(buzzInfo) { +function buzzInfoToClient(buzzInfo, soundOn) { //play sound for first buzz in if ($("#firstBuzz").html() == "") { $("#firstBuzz").html(buzzInfo[0].userName); const userId = buzzInfo[0].userName.replaceAll(" ","_"); let buzzerId = $("#userListPanel").find("#"+userId).find("img").attr("data-buzzerId"); let buzzerSound = new Audio(buzzerId+".wav"); - buzzerSound.play(); + if (soundOn == true) { + buzzerSound.play(); + } } for (let i=0; i < buzzInfo.length; i++) { @@ -51,9 +53,11 @@ function idkListToClient(idkList) { }); } -function passToClient(teamName) { +function passToClient(teamName, soundOn) { let passSound = new Audio("PikminDeath.wav"); - passSound.play(); + if (soundOn == true) { + passSound.play(); + } $("#firstBuzz").html(teamName+" have Passed!"); } diff --git a/pages/home.html b/pages/home.html index fc95ad2..f948602 100644 --- a/pages/home.html +++ b/pages/home.html @@ -1,7 +1,7 @@ - Thanks for pledging Star of Providence! :) + Submit Kuru Kuru Kururin to the chase ty @@ -23,7 +23,7 @@ }); socket.on("buzzInfoToClient", (buzzInfo) => { - buzzInfoToClient(buzzInfo); + buzzInfoToClient(buzzInfo, true); }); socket.on("idkListToClient", (idkList) => { @@ -31,7 +31,7 @@ }); socket.on("passToClient", (teamName) => { - passToClient(teamName); + passToClient(teamName, true); }); $("#plus0").click(function() { diff --git a/pages/play.html b/pages/play.html index eac995e..acb6ae4 100644 --- a/pages/play.html +++ b/pages/play.html @@ -1,7 +1,7 @@ - Thanks for pledging Star of Providence! :) + Submit Kuru Kuru Kururin to the chase ty @@ -16,6 +16,7 @@ $("#message").html("hi "+userName+" :]") let teamName = queryString.searchParams.get("team"); let clientBuzzer = "Kirbeep";//this is mostly just used as a reference for if they have a special buzzer + let buzzerSoundsOn = false; let buzzerOptions = [ ["Kirbeep","KirbyMic2","KirbySquishy","KirbyBugzzy","KirbyKracko"], ["MarioBoing","MarioPenguin","MarioCoin","MPYosh","MPDogF","MPCatF","MarioPlum","WLHelloThere","WLAlright","WLHurryUp","WLOhBoy"], @@ -153,7 +154,7 @@ }); socket.on("buzzInfoToClient", (buzzInfo) => { - buzzInfoToClient(buzzInfo); + buzzInfoToClient(buzzInfo, buzzerSoundsOn); }); socket.on("pingClient", (timeStamp) => { @@ -166,7 +167,7 @@ }); socket.on("passToClient", (teamName) => { - passToClient(teamName); + passToClient(teamName, buzzerSoundsOn); }); $(document).keydown(function(e) { @@ -244,6 +245,10 @@ clientBuzzer = buzzerId; socket.emit("updateUserInfo", userName, teamName, buzzerId); } + window.mute = function() { + buzzerSoundsOn = !buzzerSoundsOn; + console.log("buzzerSoundsOn: "+buzzerSoundsOn); + } });