-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
63 lines (62 loc) · 1.82 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">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="./style/stratStyle.css">
<title>Clicker Game</title>
</head>
<body>
<div class="container">
<div class="menu">
<h1 class="menu__gameName">
Clicker Game
</h1>
<div class="menu__btn continue">
<a class = "button" href="./game.html">Continues</a>
</div>
<div class="menu__btn start">
<a class = "button" onclick="newGame()" href="./game.html">New game</a>
</div>
</div>
<details class="infoBar">
<summary>README</summary>
<ul>
<li>
Try to prove that you have the fastest fingers in the world and try not to die right at the beginning. Make your girlfriend happy.
</li>
<br>
<ul>
<li>
For attack enemy use left click of mouse or press Space.
</li>
<li>
For mute sound press button M on the keyboard or use button.
</li>
<li>
For healing use button H on the keyboard or use bottle.
</li>
</ul>
</ul>
</details>
</div>
<script>
const btncontinue = document.querySelector('.continue');
const triger = localStorage.getItem('is_new_game');
if (triger === 'true' || triger === null) {
btncontinue.setAttribute('style', 'pointer-events: none;');
btncontinue.children[0].setAttribute('href', '');
btncontinue.children[0].classList.add('disable');
}
function newGame(){
const mute = localStorage.getItem('mute') === null ? true : localStorage.getItem('mute');
const best_try = localStorage.getItem('best_try') || 0;
localStorage.clear();
localStorage.setItem('is_new_game', 'true');
localStorage.setItem('best_try', best_try);
localStorage.setItem('mute', mute);
}
</script>
</body>
</html>