diff --git a/app.js b/app.js index 533b1eb..bf2458b 100644 --- a/app.js +++ b/app.js @@ -47,7 +47,8 @@ io.on("connection", (socket) => { buzzInfo.push({ userName: newUserName, timeStamp: newTimeStamp, - lateTime: newTimeStamp-firstBuzzTimeStamp + lateTime: newTimeStamp-firstBuzzTimeStamp, + buzzOrder: buzzInfo.length+1 }); io.emit("buzzInfoToClient", buzzInfo); // function buzzInfoToclient() { diff --git a/browserFunctions.js b/browserFunctions.js index 2693b25..98e7536 100644 --- a/browserFunctions.js +++ b/browserFunctions.js @@ -1,12 +1,3 @@ - -// function setupBuzzerOptions() { - -// buzzerOptions.forEach((buzzerName) => { -// $("#buzzerOptions").append(""); -// }); -// return buzzerOptions; -// } - function userInfoToClient(userInfo) { $("#PlayersList").find("ul").html(""); $("#ChasersList").find("ul").html(""); @@ -31,15 +22,16 @@ function buzzInfoToClient(buzzInfo) { $("#firstBuzz").html(buzzInfo[0].userName); const userId = buzzInfo[0].userName.replaceAll(" ","_"); // $("#userListPanel").find("#"+userId).css("font-weight", 900); - $("#userListPanel").find("#"+userId).find("var").html(" (BUZZ)"); + // $("#userListPanel").find("#"+userId).find("var").html(" (BUZZ)"); let buzzerId = $("#userListPanel").find("#"+userId).find("img").attr("data-buzzerId") let buzzerSound = new Audio(buzzerId+".wav"); buzzerSound.play(); } - for (let i=1; i < buzzInfo.length; i++) { + for (let i=0; i < buzzInfo.length; i++) { const userId = buzzInfo[i].userName.replaceAll(" ","_"); - $("#userListPanel").find("#"+userId).find("var").html(" ("+buzzInfo[i].lateTime/1000+")"); + // $("#userListPanel").find("#"+userId).find("var").html(" ("+buzzInfo[i].lateTime/1000+")"); + $("#userListPanel").find("#"+userId).find("var").html(" ["+buzzInfo[i].buzzOrder+"]"); } } diff --git a/images/buzzers/Puff.png b/images/buzzers/Puff.png deleted file mode 100644 index 3d85856..0000000 Binary files a/images/buzzers/Puff.png and /dev/null differ diff --git a/images/buzzers/PuffBuzzed.png b/images/buzzers/PuffRest.png similarity index 100% rename from images/buzzers/PuffBuzzed.png rename to images/buzzers/PuffRest.png diff --git a/pages/play.html b/pages/play.html index 6d76683..1651ea9 100644 --- a/pages/play.html +++ b/pages/play.html @@ -21,7 +21,6 @@ buzzerOptions.forEach((buzzerId) => { $("#buzzerOptions").append(""); }); - // let buzzerSound = new Audio(buzzerOptions[0]+".wav"); $("#buzzer").attr("src", buzzerOptions[0]+".png" ); $("#buzzer").css("opacity", "0.2"); let buzzable = false; @@ -83,7 +82,7 @@ buzzerId = buzzerOptions[Math.floor(Math.random()*(buzzerOptions.length-1))]; } socket.emit("updateUserInfo", userName, teamName, buzzerId); - buzzerSound = new Audio(buzzerId+".wav"); + let buzzerSound = new Audio(buzzerId+".wav"); $("#buzzer").attr("src", buzzerId+".png" ); buzzerSound.play(); });