-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
63 lines (60 loc) · 2.18 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
<!DOCTYPE html>
<html lang="En">
<head>
<meta charset="UTF-8"/>
<link href="assets/fav.ico" rel="icon">
<title>MooBeam</title>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Press+Start+2P">
<style>
body {
font-family: 'Roboto', sans-serif;
}
.canvas-widget {
position: relative;
}
#end-game, #crash-game {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
width: 75%;
height: 75%;
display: none;
font-size: 50px;
text-align: center;
}
.top-corner {
position: absolute;
top: 10px;
padding: 10px;
background-color: #333;
color: #fff;
border-radius: 5px;
}
.left {left: 10px;}
.right {right: 10px;}
</style>
</head>
<body style="background: #ACBFA4">
<div class="canvas-widget" id="main-canvas">
<div id="end-game" style="display: none; font-size: 30px; text-align: center; color: white; font-family: 'Press Start 2P', cursive;">
<p id="end_score"></p>
</div>
<div id="crash-game" style="display: none; font-size: 30px; text-align: center; color: red; font-family: 'Press Start 2P', cursive;">
<p id="crash_score"></p>
</div>
<div class="top-corner left" style="background-color: rgba(51, 51, 51, 0.5);">Score | <span id="score">0</span></div>
<div class="top-corner right" style="background-color: rgba(51, 51, 51, 0.5);">Time | <span id="timer">1:30</span></div>
</div>
<script type=module>
// ********************* THE ENTRY POINT OF YOUR WHOLE PROGRAM STARTS HERE *********************
const element_to_replace = document.querySelector("#main-canvas");
import {Main_Scene, Additional_Scenes, Canvas_Widget} from './main-scene.js';
const scenes = [Main_Scene, ...Additional_Scenes].map(scene => new scene());
new Canvas_Widget(element_to_replace, scenes);
</script>
</body>
</html>