107 lines
2.9 KiB
HTML
107 lines
2.9 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<title>You can now play as Luigi</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="/socket.io/socket.io.js"></script>
|
|
<script>
|
|
$(document).ready(function() {
|
|
var socket = io(location.origin, {transports:['websocket']});
|
|
|
|
socket.emit("refreshUserInfo");
|
|
|
|
socket.on("userInfoToClient", (userInfo) => {
|
|
userInfoToClient(userInfo);
|
|
});
|
|
|
|
socket.on("gameStateToClient", (currentTeam, currentScore) => {
|
|
gameStateToClient(currentTeam, currentScore);
|
|
});
|
|
|
|
socket.on("clearBuzzers", (currentTeam) => {
|
|
clearBuzzers();
|
|
});
|
|
|
|
socket.on("buzzInfoToClient", (buzzInfo) => {
|
|
buzzInfoToClient(buzzInfo, true);
|
|
});
|
|
|
|
socket.on("idkListToClient", (idkList) => {
|
|
idkListToClient(idkList);
|
|
});
|
|
|
|
socket.on("passToClient", (teamName) => {
|
|
passToClient(teamName, true);
|
|
});
|
|
|
|
$("#plus0").click(function() {
|
|
socket.emit("scoresToServer", 0);
|
|
});
|
|
$("#plus1").click(function() {
|
|
socket.emit("scoresToServer", 1);
|
|
});
|
|
$("#plus2").click(function() {
|
|
socket.emit("scoresToServer", 2);
|
|
});
|
|
|
|
$("#unregisterUsers").click(function() {
|
|
socket.emit("unregisterUsers");
|
|
location.reload();
|
|
});
|
|
|
|
socket.on("objectionToClient", (userName) => {
|
|
objectionToClient(userName);
|
|
$("#objection").append("<button id='clearObjection' type='button' style='height: 30px;'>Clear Objections</button>");
|
|
$("#clearObjection").click(function() {
|
|
socket.emit("clearObjectionToServer");
|
|
});
|
|
});
|
|
|
|
socket.on("clearObjectionToClient", () => {
|
|
clearObjectionToClient();
|
|
});
|
|
|
|
socket.on("resetApp", () => {
|
|
location.href = "/";
|
|
});
|
|
});
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<p id="message">hi quetz :]</p>
|
|
<div id="interface">
|
|
<p id="currentTeam"></p>
|
|
Progress:
|
|
<p id="currentScore"></p>
|
|
<button id="plus0" type="button" style="width: 230px; height: 50px; margin: 5px;">+0 Points</button>
|
|
<br>
|
|
<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>
|
|
<p style="font-size: 11px; margin: 5px;">(all points buttons clear buzzers)</p>
|
|
<p id="firstBuzz"></p>
|
|
<p id="objection">
|
|
</p>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<button id="unregisterUsers" type="button" style="height: 30px;">Remove/Reconnect all players</button>
|
|
</div>
|
|
<div id="userListPanel">
|
|
<div id="PlayersList">
|
|
Players:
|
|
<ul></ul>
|
|
</div>
|
|
<div id="ChasersList">
|
|
Chasers:
|
|
<ul></ul>
|
|
</div>
|
|
</div>
|
|
<form action="/reset" method="POST">
|
|
<button type="submit">Reset the whole app (disconnects everyone)</button>
|
|
</form>
|
|
</body>
|
|
</html>
|