-
Notifications
You must be signed in to change notification settings - Fork 15
/
index.html
141 lines (121 loc) · 4.22 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
<!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" />
<title>2048 Game - Play Online for Free</title>
<meta
name="description"
content="Play 2048, a fun and challenging puzzle game online for free. Join the numbers and reach the 2048 tile!"
/>
<meta
name="keywords"
content="2048 game, online 2048, puzzle game, 2048 tile, play 2048"
/>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="canonical" href="https://alitindrawan24.github.io/2048/" />
<!-- Open Graph Tags -->
<meta property="og:title" content="2048 Game - Play Online for Free" />
<meta
property="og:description"
content="Play 2048, a fun and challenging puzzle game online for free. Join the numbers and reach the 2048 tile!"
/>
<meta property="og:type" content="website" />
<meta
property="og:image"
content="https://alitindrawan24.github.io/2048//assets/2048-og.png"
/>
<!-- Twitter Card Tags -->
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="2048 Game - Play Online for Free" />
<meta
name="twitter:description"
content="Play 2048, a fun and challenging puzzle game online for free. Join the numbers and reach the 2048 tile!"
/>
<meta
name="twitter:image"
content="https://alitindrawan24.github.io/2048//assets/2048-og.png"
/>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link rel="icon" href="assets/favicon.ico" />
<link
href="https://fonts.googleapis.com/css2?family=Fredoka+One&family=Roboto:wght@400&display=swap"
rel="stylesheet"
/>
<link rel="manifest" href="manifest.json" />
<link rel="stylesheet" href="./style.css" />
<script src="./app.js" defer></script>
</head>
<body>
<div class="wrapper">
<!-- Theme Switcher -->
<div class="theme-switcher">
<input type="checkbox" id="theme-toggle" class="theme-toggle">
<label for="theme-toggle" class="slider">
<span class="icon sun">🌞</span>
<span class="icon moon">🌜</span>
</label>
</div>
<header class="score-wrapper">
<button class="btn-how-to" onclick="onClickBtnHowTo()">
<span>?</span>
</button>
<div class="score">
<h2 class="score-title" id="text-score">Score</h2>
<p class="score-result" id="num-score">0</p>
</div>
<button class="btn-translate">
<img src="assets/translate.svg" alt="Translate icon" />
</button>
</header>
<!-- GAME -->
<main class="game-container">
<table aria-hidden="true" aria-label="Game Board">
<tr>
<td id="00"></td>
<td id="01"></td>
<td id="02"></td>
<td id="03"></td>
</tr>
<tr>
<td id="10"></td>
<td id="11"></td>
<td id="12"></td>
<td id="13"></td>
</tr>
<tr>
<td id="20"></td>
<td id="21"></td>
<td id="22"></td>
<td id="23"></td>
</tr>
<tr>
<td id="30"></td>
<td id="31"></td>
<td id="32"></td>
<td id="33"></td>
</tr>
</table>
<div id="gameOver">
<button id="reset" onclick="restart()">Try Again</button>
</div>
<dialog id="dialog-how-to">
<section class="how">
<h3 class="dialog-title">How to Play?</h3>
<button class="btn-close-dialog" onclick="closeHowToDialog()">
X
</button>
<p>
Use your <em><u>arrow keys</u></em> to move the tiles. Tiles with
the same number merge into one when they touch. Add them up to
reach <strong>2048</strong>!
</p>
<img src="assets/arrow.png" />
</section>
</dialog>
</main>
</div>
</body>
</html>