-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
53 lines (51 loc) · 1.54 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
<head>
<script src="debtris.js"></script>
<script>
window.addEventListener("load", (event) => {
const canvas = document.getElementById("tetris-canvas");
const tetris = new Debtris(canvas);
document.getElementById("start-stop-btn").addEventListener("click", (event) => {
// const startLevel = document.getElementById("level-input").value;
const startLevel = 0;
tetris.setStartLevel(startLevel);
tetris.togglePlayPause();
});
document.getElementById("quit-btn").addEventListener("click", (event) => {
tetris.quit();
});
});
</script>
<style>
body {
margin: 0;
background-color: black;
color: white; /* Set text color to white for visibility */
font-family: ubuntu, sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.container {
user-select: none;
text-align: center;
padding: 20px;
background-color: black;
}
.canvas-container {
display: inline-block;
padding: 0 30px 15px 30px;
}
</style>
</head>
<body>
<div class="container">
<canvas id="tetris-canvas" class="canvas" width="520" height="600"></canvas>
<div class="canvas-container">
<!--<label for="level-input">Start level:</label>-->
<!--<input id="level-input" name="level-input" type="number" min="0" max="19" value="5"></input>-->
<button id="start-stop-btn">Play/Pause</button>
<button id="quit-btn">Quit</button>
</div>
</div>
</body>