-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
54 lines (47 loc) · 2.09 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="author" content="https://github.com/thuongtruong1009">
<title>Space Snake</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU" crossorigin="anonymous" />
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-/bQdsTh/da6pkI1MST/rWKFNjaCP5gBSY4sEBT38Q/9RBh9AH40zEOg7Hlq2THRZ" crossorigin="anonymous"></script>
<style>
body {
margin: 0;
overflow: hidden;
}
p {
position: absolute;
top: 20px;
left: 20px;
font-size: 20px;
margin: 0;
}
</style>
</head>
<body>
<canvas></canvas>
<p style="color: white">Score: <span id="score">0</span></p>
<button id="launch-modal-button" type="button" class="d-none" data-bs-toggle="modal" data-bs-target="#exampleModal"></button>
<div class="modal fade" id="exampleModal" tabindex="-1" data-bs-backdrop="static" data-bs-keyboard="false" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Game Over</h5>
</div>
<div class="modal-body">
<h4>Score: <span id="score-result"></span></h4>
<h4>Max Score: <span id="max-score"></span></h4>
</div>
<div class="modal-footer">
<button onclick="window.location.reload()" type="button" class="btn btn-primary">Restart</button>
</div>
</div>
</div>
</div>
<script src="./index.js"></script>
</body>
</html>