-
Notifications
You must be signed in to change notification settings - Fork 0
/
join.html
39 lines (35 loc) · 1.51 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
<!DOCTYPE HTML>
<html class=" bmkdoe idc0_350" style="background-image: url(https://img.freepik.com/free-photo/granite-texture_1160-692.jpg);background-fill:cover"><head>
<link rel="stylesheet" href="/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Better Call the Exterminator!</title>
</head>
<body style="background-image:url(https://img.freepik.com/free-photo/granite-texture_1160-692.jpg);text-align:center;">
<h1 style="text-shadow: 1px 1px 2px black;">Join a Game</h1>
<input id="goip" placeholder="Game ID" style="background: black;border: 2px solid white;box-shadow: 1px 1px 2px black;">
<br>
<input style="background: black;border: 2px solid white;box-shadow: 1px 1px 2px black;" id="goip2" placeholder="Username">
<p id="errtext" style="color:red"></p>
<button onclick="join()" style="box-shadow: 1px 1px 2px black;">Join</button>
<script>
if (localStorage.getItem("username")) {
goip2.value = localStorage.getItem("username")
}
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("username",goip2.value)
}
sessionStorage.setItem("gameid",goip.value)
location.replace("play")
} else {
errtext.innerHTML = "Enter a PIN"
}
}
</script>
</body></html>