did a little cleanup

This commit is contained in:
Samuel Kent
2023-01-10 18:50:56 +11:00
parent c8db4aef17
commit 42307049d9
6 changed files with 1 additions and 27 deletions
-12
View File
@@ -1,4 +1,3 @@
const http = require('http'); const http = require('http');
const express = require('express'); const express = require('express');
const app = express(); const app = express();
@@ -55,12 +54,6 @@ io.on("connection", (socket) => {
buzzOrder: buzzInfo.length+1 buzzOrder: buzzInfo.length+1
}); });
io.emit("buzzInfoToClient", buzzInfo); io.emit("buzzInfoToClient", buzzInfo);
// function buzzInfoToclient() {
// io.emit("buzzInfoToClient", buzzInfo);
// console.log(buzzInfo);
// }
// setTimeout(buzzInfoToclient, 1000);
// console.log(buzzInfo);
}); });
socket.on("scoresToServer", score => { socket.on("scoresToServer", score => {
@@ -68,8 +61,6 @@ io.on("connection", (socket) => {
if (teamsScore[currentTeamNumber] >= 2) { if (teamsScore[currentTeamNumber] >= 2) {
teamsScore[currentTeamNumber] = 0; teamsScore[currentTeamNumber] = 0;
currentTeamNumber = (currentTeamNumber+1)%2; currentTeamNumber = (currentTeamNumber+1)%2;
// io.emit("switchCurrentteam");
// io.emit("dataToClient", buzzList, teamsList[currentTeamNumber], teamsScore[currentTeamNumber]);
} }
buzzInfo = []; buzzInfo = [];
io.emit("gameStateToClient", teamsList[currentTeamNumber], teamsScore[currentTeamNumber]); io.emit("gameStateToClient", teamsList[currentTeamNumber], teamsScore[currentTeamNumber]);
@@ -77,8 +68,6 @@ io.on("connection", (socket) => {
io.emit("userInfoToClient", userInfo);//resets the buzzer info io.emit("userInfoToClient", userInfo);//resets the buzzer info
}); });
socket.on("updateUserInfo", (userName, teamName, buzzerId) => { socket.on("updateUserInfo", (userName, teamName, buzzerId) => {
userInfo[userName] = { userInfo[userName] = {
teamName: teamName, teamName: teamName,
@@ -88,7 +77,6 @@ io.on("connection", (socket) => {
}); });
socket.on("unregisterUsers", () => { socket.on("unregisterUsers", () => {
// console.log("whaat?");
userInfo = new Object(); userInfo = new Object();
io.emit("userInfoToClient", userInfo); io.emit("userInfoToClient", userInfo);
}); });
-2
View File
@@ -21,8 +21,6 @@ function buzzInfoToClient(buzzInfo) {
if ($("#firstBuzz").html() == "") { if ($("#firstBuzz").html() == "") {
$("#firstBuzz").html(buzzInfo[0].userName); $("#firstBuzz").html(buzzInfo[0].userName);
const userId = buzzInfo[0].userName.replaceAll(" ","_"); const userId = buzzInfo[0].userName.replaceAll(" ","_");
// $("#userListPanel").find("#"+userId).css("font-weight", 900);
// $("#userListPanel").find("#"+userId).find("var").html(" (BUZZ)");
let buzzerId = $("#userListPanel").find("#"+userId).find("img").attr("data-buzzerId") let buzzerId = $("#userListPanel").find("#"+userId).find("img").attr("data-buzzerId")
let buzzerSound = new Audio(buzzerId+".wav"); let buzzerSound = new Audio(buzzerId+".wav");
buzzerSound.play(); buzzerSound.play();
-2
View File
@@ -3,9 +3,7 @@
<head> <head>
<title>The cooler buzzer website</title> <title>The cooler buzzer website</title>
<link rel="stylesheet" href="styleMain.css"> <link rel="stylesheet" href="styleMain.css">
<!-- <link rel="preload" href="Twoson.woff2" as="font" type="font/woff2" crossorigin> -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<!-- <script src="https:/socket.io/socket.io.js"></script> -->
<script> <script>
$(document).ready(function() { $(document).ready(function() {
const okSsuka = new Audio('OkSsuka.wav'); const okSsuka = new Audio('OkSsuka.wav');
-4
View File
@@ -3,7 +3,6 @@
<head> <head>
<title>The cooler buzzer website</title> <title>The cooler buzzer website</title>
<link rel="stylesheet" href="styleMain.css"> <link rel="stylesheet" href="styleMain.css">
<!-- <link rel="preload" href="Twoson.woff2" as="font" type="font/woff2" crossorigin> -->
<script src="browserFunctions.js"></script> <script src="browserFunctions.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="http:/socket.io/socket.io.js"></script> <script src="http:/socket.io/socket.io.js"></script>
@@ -66,7 +65,6 @@
<button id="plus1" type="button" style="width: 110px; height: 50px;">+1 Point</button> <button id="plus1" type="button" style="width: 110px; height: 50px;">+1 Point</button>
<button id="plus2" type="button" style="width: 110px; height: 50px;">+2 Points</button> <button id="plus2" type="button" style="width: 110px; height: 50px;">+2 Points</button>
<p style="font-size: 11px; margin: 5px;">(all points buttons clear buzzers)</p> <p style="font-size: 11px; margin: 5px;">(all points buttons clear buzzers)</p>
<!-- <br> -->
<p id="firstBuzz"></p> <p id="firstBuzz"></p>
<p id="objection"> <p id="objection">
</p> </p>
@@ -75,8 +73,6 @@
<br> <br>
<br> <br>
<button id="unregisterUsers" type="button" style="height: 30px;">Remove all players</button> <button id="unregisterUsers" type="button" style="height: 30px;">Remove all players</button>
<!-- <input type="text" id="bufferInput" placeholder="Buffer"> -->
</div> </div>
<div id="userListPanel"> <div id="userListPanel">
<div id="PlayersList"> <div id="PlayersList">
-2
View File
@@ -3,7 +3,6 @@
<head> <head>
<title>The cooler buzzer website</title> <title>The cooler buzzer website</title>
<link rel="stylesheet" href="styleMain.css"> <link rel="stylesheet" href="styleMain.css">
<!-- <link rel="preload" href="Twoson.woff2" as="font" type="font/woff2" crossorigin> -->
<script src="browserFunctions.js"></script> <script src="browserFunctions.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="http:/socket.io/socket.io.js"></script> <script src="http:/socket.io/socket.io.js"></script>
@@ -142,6 +141,5 @@
(please use sparingly) (please use sparingly)
</p> </p>
<div> <div>
</body> </body>
</html> </html>
+1 -5
View File
@@ -1,5 +1,3 @@
body { body {
font-family: 'Twoson'; font-family: 'Twoson';
color: rgb(255, 255, 255); color: rgb(255, 255, 255);
@@ -32,7 +30,6 @@ a, a:visited {
min-height: 310px; min-height: 310px;
width: 500px; width: 500px;
position: relative; position: relative;
/* bottom: 150px; */
} }
#objection img{ #objection img{
@@ -47,6 +44,7 @@ a, a:visited {
text-align: center; text-align: center;
width: 200px; width: 200px;
} }
#contestAnswer img { #contestAnswer img {
width: 100px; width: 100px;
} }
@@ -71,7 +69,6 @@ a, a:visited {
} }
#PlayersList { #PlayersList {
/* font-family: "Lucida Console"; */
position: absolute; position: absolute;
left: 60px; left: 60px;
border: dashed; border: dashed;
@@ -145,7 +142,6 @@ ul {
#objection img{ #objection img{
width: 150px; width: 150px;
/* text-align: left; */
} }
#userListPanel { #userListPanel {
top: 80px; top: 80px;