-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgamesWithInterpolation.html
More file actions
119 lines (119 loc) · 2.63 KB
/
Copy pathgamesWithInterpolation.html
File metadata and controls
119 lines (119 loc) · 2.63 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<title>Games</title>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<script src='gamesWithInterpolation.js' type="module"></script>
<style>
* {
box-sizing: border-box;
font-family: Consolas, 'Courier New', Courier, monospace;
}
body, the-lobby {
display: flex;
flex-direction: column;
height: calc(100dvh - 3rem);
justify-content: space-between;
background-color: #333;
color: #fff;
}
h1 {
text-align: center;
text-transform: uppercase;
}
#users { margin: 0.5rem 0 }
a-user::before { content: '[' }
a-user::after { content: ']' }
input {
background-color: #555;
color: #fff;
border: none;
padding: 0.5rem;
}
button {
background-color: #007bff;
color: #fff;
border: none;
padding: 0.5rem;
margin: 0.5rem 0;
cursor: pointer;
}
#leave {
background-color: #dc3545;
}
the-listing {
padding: 0.5rem;
overflow-y: auto;
height: 100%;
width: 100%;
}
table {
width: 100%;
border-collapse: collapse;
}
th, td {
border-bottom: 1px solid #555;
padding: 0.5rem;
text-align: left;
}
.hidden { display: none }
the-room {
display: grid;
grid-template-rows: 1fr 5fr 3fr;
gap: 1rem;
height: 100vh;
max-height: 100vh;
padding: 1rem;
}
the-game, #users {
justify-self: center;
align-self: center;
display: flex;
gap: 1rem;
justify-content: center;
align-items: center;
}
canvas {
width: min(calc(100vh - 13rem), calc(100vw - 13rem));
height: min(calc(100vh - 13rem), calc(100vw - 13rem));
background-color: #222;
box-shadow: 0 0 2rem #222;
}
</style>
</head>
<body>
<the-lobby>
<h1>Games</h1>
<form id="room-form">
<input id="name" type="text" required placeholder="Room name">
<button>Create a game</button>
<error-message></error-message>
</form>
<the-listing>
<table id="room-listing">
<thead>
<tr>
<th>Name</th>
<th>Users</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</the-listing>
</the-lobby>
<the-room class="hidden">
<h1 id="room-name"></h1>
<the-game>
<canvas id="game"></canvas>
</the-game>
<div id="users">
Players:
<the-users-list></the-users-list>
<button id="leave">Exit</button>
</div>
</the-room>
</body>
</html>