-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
169 lines (169 loc) · 5.47 KB
/
index.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
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<!doctype html>
<html>
<head>
<title>The Pong Variations</title>
<style>
body {
background-color: #444;
color: #ddd;
font: 18px sans-serif;
}
a,
a:visited {
color: #888;
text-decoration: underline;
}
a:active,
a:hover {
color: white;
}
header,
footer {
text-align: center;
}
h1 {
font: bold 250% sans-serif;
text-transform: uppercase;
}
h2 {
font: bold 130% sans-serif;
}
main {
display: flex;
justify-content: center;
}
main .help {
margin: 0 1em;
line-height: 2;
}
main .help .key {
font-size: 120%;
background-color: #eee;
border: 3px outset #444;
border-radius: 5px;
padding: 2px 5px;
color: #111;
}
#canvas {
margin: 0 1em;
border: 3px inset #666;
background-color: black;
}
.hidden_panel {
display: none;
}
</style>
</head>
<body>
<header>
<h1>The Pong Variations</h1>
<div>
<label>
<input type="checkbox" id="grabbing_mode" />
Enable Grabbing
</label>
<label>
<input type="checkbox" id="magnetic_mode" />
Enable Magnetic Paddles
</label>
</div>
</header>
<main>
<div class="sidebar">
<div class="help">
<h2>Left Paddle:</h2>
<table>
<tr>
<th><span class="key">W</span></th>
<td>move up</td>
</tr>
<!--
<tr>
<th><span class="key">A</span></th>
<td>move left</td>
</tr>
-->
<tr>
<th><span class="key">S</span></th>
<td>move down</td>
</tr>
<!--
<tr>
<th><span class="key">D</span></th>
<td>move right</td>
</tr>
-->
<tr>
<th><span class="key">L Shift</span></th>
<td>grab</td>
</tr>
</table>
<button class="mode_switch" data-to="ai" data-side="left">
Switch to computer player
</button>
</div>
<div class="ai_panel hidden_panel">
<button
class="mode_switch"
data-to="human"
data-side="left"
>
Switch to human player
</button>
</div>
</div>
<canvas id="canvas" width="400" height="600"></canvas>
<div class="sidebar">
<div class="help hidden_panel">
<h2>Right Paddle:</h2>
<table>
<tr>
<th><span class="key">↑</span></th>
<td>move up</td>
</tr>
<!--
<tr>
<th><span class="key">←</span></th>
<td>move left</td>
</tr>
-->
<tr>
<th><span class="key">↓</span></th>
<td>move down</td>
</tr>
<!--
<tr>
<th><span class="key">→</span></th>
<td>move right</td>
</tr>
-->
<tr>
<th><span class="key">R Shift</span></th>
<td>grab</td>
</tr>
</table>
<button class="mode_switch" data-to="ai" data-side="right">
Switch to computer player
</button>
</div>
<div class="ai_panel">
<button
class="mode_switch"
data-to="human"
data-side="right"
>
Switch to human player
</button>
</div>
</div>
</main>
<footer>
<p>
<a href="https://github.com/linusrachlis/the-pong-variations/"
>Source Code</a
>
</p>
</footer>
<script type="module" src="/src/main.ts"></script>
</body>
</html>