-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
55 lines (40 loc) · 1.43 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
<!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">
<title>What's Inside The Egg</title>
<link rel="stylesheet" href="style.css">
<link rel="icon" type="image/x-icon" href="Google-Noto-Emoji-Food-Drink-32390-egg.512.png">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap" rel="stylesheet">
</head>
<body>
<div class="game-title">
What's inside the Egg?
</div>
<div class="game-container">
<img class="egg-image" onclick="minus1()" src="Google-Noto-Emoji-Food-Drink-32390-egg.512.png" alt="EGG">
<div class="counter" id="counter">
100000
</div>
</div>
<script>
// Starting value
let count = localStorage.getItem("count") || 100000;
// Subtracting 1 and saving the new value
function minus1() {
count = count - 1
let counter = document.getElementById("counter");
counter.innerText = count
localStorage.setItem("count", count);
}
// Set the initial value of the counter
let counter = document.getElementById("counter");
counter.innerText = count;
</script>
<a class="app-version" href="hidden-page.html" target="_self">v1.0</a>
</body>
</html>