-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
150 lines (147 loc) Β· 5.12 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta
name="apple-mobile-web-app-status-bar-style"
content="black-translucent"
/>
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
/>
<script>
document.addEventListener('touchstart', preventZoom, { passive: false });
function preventZoom(e) {
if (e.touches.length > 1) {
e.preventDefault();
}
}
// Prevent pinch zoom on mobile
document.addEventListener(
'touchmove',
function (event) {
if (event.scale !== 1) {
event.preventDefault();
}
},
{ passive: false }
);
// Prevent Ctrl+wheel zoom on desktop
document.addEventListener(
'wheel',
function (event) {
if (event.ctrlKey) {
event.preventDefault();
}
},
{ passive: false }
);
</script>
<title>Memory puzzle</title>
<script src="js/index.js" type="module" defer></script>
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<main>
<div class="overlay visible" id="start-game">
<div>πββοΈ Shinkei-<br />suijaku πββοΈ</div>
<div>Click to Play</div>
</div>
<div class="overlay" id="game-over">
<div>Time's up!<br />Game Over</div>
<div>π§ β€΅οΈ π³οΈ</div>
<div class="reveal-5s">Click to Restart</div>
</div>
<div class="overlay" id="success">
<div>You win!</div>
<div>Nice work, brainiac.</div>
<div>ποΈββοΈ π§ ποΈββοΈ</div>
<div>Click to Restart</div>
</div>
<div id="board"></div>
<div id="status">
<div id="meta">
<button type="button" id="sound">
<span id="sound__on" class=""
><svg
xmlns="http://www.w3.org/2000/svg"
class="h-6 w-6"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
stroke-width="2"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M15.536 8.464a5 5 0 010 7.072m2.828-9.9a9 9 0 010 12.728M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z"
/></svg
></span>
<span id="sound__off" class="display-none"
><svg
xmlns="http://www.w3.org/2000/svg"
class="h-6 w-6"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
stroke-width="2"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z"
clip-rule="evenodd"
/>
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M17 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2"
/></svg
></span>
</button>
<button type="button" id="music">
<span id="music__on" class="display-none"
><svg
xmlns="http://www.w3.org/2000/svg"
class="h-6 w-6"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
stroke-width="2"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M5.636 18.364a9 9 0 010-12.728m12.728 0a9 9 0 010 12.728m-9.9-2.829a5 5 0 010-7.07m7.072 0a5 5 0 010 7.07M13 12a1 1 0 11-2 0 1 1 0 012 0z"
/></svg
></span>
<span id="music__off" class=""
><svg
xmlns="http://www.w3.org/2000/svg"
class="h-6 w-6"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
stroke-width="2"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M18.364 5.636a9 9 0 010 12.728m0 0l-2.829-2.829m2.829 2.829L21 21M15.536 8.464a5 5 0 010 7.072m0 0l-2.829-2.829m-4.243 2.829a4.978 4.978 0 01-1.414-2.83m-1.414 5.658a9 9 0 01-2.167-9.238m7.824 2.167a1 1 0 111.414 1.414m-1.414-1.414L3 3m8.293 8.293l1.414 1.414"
/></svg
></span>
</button>
</div>
<div id="time">Time: <span id="time-remaining"></span></div>
<div id="score">
<span id="clicks">0</span> tries
<span id="matched">0</span>/<span id="matchedTotal"></span>
matches
</div>
</div>
</main>
</body>
</html>