-
Notifications
You must be signed in to change notification settings - Fork 0
/
join.html
40 lines (38 loc) · 1.26 KB
/
join.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" href="/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="/src/icon.png">
<title>Hauntington Manor</title>
</head>
<body style="background:black;text-align:center;">
<h1>Join a Multiplayer Game</h1>
<input style="background: black;border: 2px solid white;" id="goip" placeholder="Game ID">
<br>
<input style="background: black;border: 2px solid white;" id="goip2" placeholder="Username">
<p id="errtext" style="color:red"></p>
<button class="popupCB" style="animation:none" onclick="join()">Join</button>
<script>
if (localStorage.getItem("mpname")) {
goip2.value = localStorage.getItem("mpname")
}
var jid = new URLSearchParams(window.location.search).get("id");
if (jid) {
goip.value = jid;
goip.hidden = "true"
}
function join() {
if (goip.value) {
if (goip2.value) {
localStorage.setItem("mpname",goip2.value)
}
sessionStorage.setItem("multiplayer",goip.value)
location.replace("play.html")
} else {
errtext.innerHTML = "Enter a PIN"
}
}
</script>
</body>
</html>