73 lines
1.9 KiB
HTML
73 lines
1.9 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<title>The cooler buzzer website</title>
|
|
<link rel="stylesheet" href="styleMain.css">
|
|
<script src="browserFunctions.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>
|
|
$(document).ready(function() {
|
|
var socket = io();
|
|
|
|
let buzzerOptions = setupBuzzerOptions();
|
|
let buzzerSound = new Audio(buzzerOptions[0]+".wav");
|
|
|
|
socket.on("userInfoToClient", (userInfo) => {
|
|
userInfoToClient(userInfo);
|
|
});
|
|
|
|
socket.on("gameStateToClient", (currentTeam, currentScore) => {
|
|
gameStateToClient(currentTeam, currentScore);
|
|
});
|
|
|
|
socket.on("clearBuzzers", () => {
|
|
$("#firstBuzz").html("");
|
|
});
|
|
|
|
socket.on("buzzInfoToClient", (buzzInfo) => {
|
|
buzzInfoToClient(buzzInfo, buzzerSound);
|
|
});
|
|
|
|
$("#plus0").click(function() {
|
|
socket.emit("scoresToServer", 0);
|
|
});
|
|
$("#plus1").click(function() {
|
|
socket.emit("scoresToServer", 1);
|
|
});
|
|
$("#plus2").click(function() {
|
|
socket.emit("scoresToServer", 2);
|
|
});
|
|
|
|
$("#buzzerOptions").contents().mousedown(function() {
|
|
buzzerSound = new Audio($(this).attr("id")+".wav");
|
|
buzzerSound.play();
|
|
});
|
|
});
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<p id="message">hi quetz :]</p>
|
|
<div id="interface">
|
|
<p id="currentTeam"></p>
|
|
Progress:
|
|
<p id="currentScore"></p>
|
|
<!-- <br> -->
|
|
<p style="font-size: 15px">(all buttons clear buzzers)</p>
|
|
<button id="plus0" type="button">+0 Points</button>
|
|
<button id="plus1" type="button">+1 Point</button>
|
|
<button id="plus2" type="button">+2 Points</button>
|
|
<br>
|
|
<p id="firstBuzz"></p>
|
|
</div>
|
|
<div id="userListPanel">
|
|
Players:
|
|
<ul id="PlayersList"></ul>
|
|
Chasers:
|
|
<ul id="ChasersList"></ul>
|
|
</div>
|
|
<div id="buzzerOptions">
|
|
</div>
|
|
</body>
|
|
</html>
|