-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
82 lines (78 loc) · 2.97 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
75
76
77
78
79
80
81
82
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Snake Game</title>
<link rel="stylesheet" href="themes/css/style.css">
<script src="themes/js/script.js" defer></script>
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="Snake Game">
<meta name="theme-color" content="#3498db">
<link rel="manifest" href="manifest.json">
<link rel="icon" href="snake.png">
<link rel="apple-touch-icon" href="snake.png">
<script>
//Service Worker
if ("serviceWorker" in navigator) {
navigator.serviceWorker
.register("ServiceWorker.js")
.then(function (registration) {
console.log("success load");
})
.catch(function (err) {
console.log(err);
});
}
</script>
</head>
<body>
<canvas id="canvas" width="300" height="300"></canvas>
<div class="pop-up">
</div>
<div class="controls">
<div class="controls-buttons">
<button class="controls-button" id="up">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M8.25 6.75 12 3m0 0 3.75 3.75M12 3v18" />
</svg>
</button>
</div>
<div class="controls-buttons">
<button class="controls-button" id="left">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M6.75 15.75 3 12m0 0 3.75-3.75M3 12h18" />
</svg>
</button>
<button class="controls-button" id="down">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 17.25 12 21m0 0-3.75-3.75M12 21V3" />
</svg>
</button>
<button class="controls-button" id="right">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M17.25 8.25 21 12m0 0-3.75 3.75M21 12H3" />
</svg>
</button>
</div>
</div>
<!-- <button id="myBtn">Open Modal</button> -->
<div id="myModal" class="modal">
<div class="modal-content">
<div class="modal-header">
<span class="close">×</span>
<h2>Snake Game</h2>
</div>
<div class="modal-body">
<p>Total Points: <span id="total-english"></span></p>
<p>مجموع امتیازات: <span id="total-persian" style="direction: rtl;"></span></p>
</div>
<div class="modal-footer">
<h3>رکورد شما: <span id="record" style="direction: rtl;"></span></h3>
</div>
</div>
</div>
</body>
</html>