-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjoin.html
More file actions
99 lines (99 loc) · 2.87 KB
/
join.html
File metadata and controls
99 lines (99 loc) · 2.87 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<!DOCTYPE HTML>
<html>
<head>
<title>Join a game</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://pbs.twimg.com/profile_images/1345847875066941440/bXtiSNNo.jpg" rel="icon">
<style>
@import url('https://fonts.googleapis.com/css2?family=Comfortaa&display=swap');
html{
background-color:#48049c;
}
*{
text-align:center;
color:white;
}
#error{
position:absolute;
width:75vw;
background-image: linear-gradient(to right, #ad0d0d, #d11e1e, #f32c2c);
color: white;
padding: 17px;
border-radius: 5px;
margin-left:12vw;
font-family: Arial, sans-serif !important;
border: none;
display: block;
bottom:20px;
}
input[type=text], input[type=number]{
background-color:white;
border:3px solid darkgray;
outline:none;
color:black;
width:30vw;
height:65px;
font-size:24px;
margin:5px;
}
form{
padding:1vw;
border:1px solid white;
width:50vw;
margin-left:25vw;
}
input[type=submit]{
outline:none;
width:30.8vw;
height:45px;
border:none;
background-color:#4CAF50;
font-size:18px;
border-radius:5px;
}
/*guess*/
main > h1{
color:#c953bf;
position:absolute;
font-size:60px;
left:50%;
margin-top:20px;
transform: translate(-50%, -50%);
}
main > span{
position:absolute;
left:50%;
margin-top:120px;
transform: translate(-50%, -50%);
font-size:18px;
}
</style>
</head>
<body>
<div id="navbar">
</div>
<span id="error">No error. If there is one. There might be an error on this error message :|</span>
<b><h1>Join a game!</h1></b>
<form action="/play">
<input type="text" name="name" placeholder="Username..." autocomplete="off" required maxlength="25"><br>
<input id="code" type="number" name="code" placeholder="Code..." autocomplete="off" required min="10000" max="99999"><br>
<input type="submit">
</form>
<script>
const urlParams = new URLSearchParams(window.location.search);
const num = urlParams.get("error")
const code = urlParams.get("code")
if (num){
document.getElementById("error").innerText = num;
document.querySelector("title").innerHTML = "Error! Error!"
}else{
document.getElementById("error").style.display="none"
}
if (code){
document.getElementById("code").value = code
document.querySelector("title").innerHTML = "Join game "+code
}
fetch("/navbar").then(data=>data.text()).then(data=>document.getElementById("navbar").innerHTML = data)
</script>
</body>
</html>