-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
72 lines (61 loc) · 1.62 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="pragma" content="no-cache" />
<script src="https://hammerjs.github.io/dist/hammer.min.js" type="text/javascript"></script>
<title>Swipe a Snake</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:[email protected]&display=swap');
body {
margin: 0;
background-color: #fff;
}
canvas {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 100%;
height: 100%;
z-index: 1;
}
canvas:hover {
cursor: none;
}
p {
font-family: 'Inter', sans-serif;
font-size: 18px;
text-align: center;
padding: 12px;
color: azure;
background-color: rgba(25, 0, 61, 0.667);
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 2;
}
p:hover {
cursor: auto;
}
</style>
</head>
<body>
<canvas id="game"></canvas>
<p id="instructions" hidden>
<b>SWIPE A SNAKE: THE INSTRUCTIONS</b>
<br /><br />
Use WASD/arrow keys or swipe your screen to control your character, a snake. Your goal in each level is to eat all apples/cookies.
<br /><br />
Have fun figuring out everything else by yourself!!
<br /><br />
Junyi@2024
</p>
</body>
<script type="module" src="./game.js"></script>
</html>