-
Notifications
You must be signed in to change notification settings - Fork 8
/
index.html
74 lines (71 loc) · 1.68 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
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>3D Pong</title>
<style>
@import url("https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap");
html,
body {
overflow: hidden;
position: relative;
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
.container {
position: absolute;
width: 100%;
height: 100%;
margin: 0;
padding: 0;
display: flex;
flex-direction: row;
}
#render-canvas-1 {
width: 50%;
height: 100%;
touch-action: none;
}
#render-canvas-2 {
width: 50%;
height: 100%;
touch-action: none;
}
.overlay {
position: absolute;
width: 100%;
height: 100%;
}
.score {
position: absolute;
color: white;
top: 50%;
font-size: 50px;
font-family: "Press Start 2P", cursive;
}
#player1Score {
left: 50%;
top: 0;
transform: translateX(-200%) translateY(1em);
}
#player2Score {
right: 50%;
top: 0;
transform: translateX(+200%) translateY(1em);
}
</style>
</head>
<body>
<div class="container">
<canvas id="render-canvas-1"></canvas>
<canvas id="render-canvas-2"></canvas>
</div>
<div class="overlay">
<h1 class="score" id="player1Score">0</h1>
<h1 class="score" id="player2Score">0</h1>
</div>
<script defer type="module" src="./src/index.js"></script>
</body>
</html>