-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
54 lines (54 loc) · 1.49 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
<!DOCTYPE html>
<html lang="en">
<head>
<script src="https://www.gstatic.com/firebasejs/8.2.10/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.2.10/firebase-firestore.js"></script>
<script src="https://unpkg.com/vue@next"></script>
<script type="text/javascript" src="index.js"></script>
<link rel="stylesheet" href="styles.css" />
<title>2048</title>
<meta charset="UTF-8" />
</head>
<body>
<div id="app">
<h1>2048</h1>
<p>{{ message }}</p>
<div>
<h3>High Score: {{ highScore == undefined ? 0 : highScore }}</h3>
<h3>Score: {{ score }}</h3>
</div>
<div class="grid">
<div v-for="row_num in dimension" class="tile-row">
<div
v-for="tile_num in dimension"
:class="getTileClass(row_num - 1, tile_num - 1)"
>
{{ tileValues[row_num - 1][tile_num - 1] }}
</div>
</div>
</div>
<div>
<input
ref="name"
type="text"
placeholder="Enter name"
v-model="name"
@keyup.enter="initGame"
/>
<button
ref="startButton"
:disabled="name.length == 0 || isGameEnabled()"
@click.event="initGame"
>
Start Game
</button>
<button
:disabled="name.length == 0 || gameOver"
@click.exact="autoPlay"
>
Auto Play
</button>
</div>
</div>
</body>
</html>