-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
74 lines (66 loc) · 2.85 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
<!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="shortcut icon" type="image/x-icon" href="icon.png" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"
integrity="sha512-iBBXm8fW90+nuLcSKlbmrPcLa0OT92xO1BIsZ+ywDWZCvqsWgccV3gFoRBv0z+8dLJgyAHIhR35VZc2oM/gI1w=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="./style.css">
<title>2048</title>
</head>
<body>
<div id="loading">
Loading...
</div>
<div id="app">
<div class="input-control">
<label>
AI Aggressiveness:
<select v-model="aiAggressiveness">
<option value="high">High</option>
<option value="medium">Medium</option>
<option value="low">Low</option>
</select>
</label>
</div>
<div class="input-control">
<button v-on:click="toggleAi">{{ isAiPlaying ? 'Stop AI' : 'Start AI' }}</button>
</div>
<div class="input-control">
<button :disabled="isAiPlaying" v-on:click="startNewGame">Start New Game</button>
</div>
<div v-if="isAiPlaying" id="ai-timing">
Processing time per move: {{ averageAitimings }} ms
</div>
<div id="board">
<div v-for="row in board" class="row">
<div v-for="cell in row" class="cell">
<div>{{ cell || ' ' }}</div>
</div>
</div>
</div>
<div :disabled="isAiPlaying">
<div class="wraper-move">
<a :disabled="isAiPlaying" v-on:click="makeMove(direction.UP)" href="#"><i
class="fas fa-arrow-up"></i></a>
</div>
<div class="wraper-move">
<a :disabled="isAiPlaying" v-on:click="makeMove(direction.LEFT)" href="#"><i
class="fas fa-arrow-left"></i></a>
<a :disabled="isAiPlaying" v-on:click="makeMove(direction.DOWN)" href="#"><i
class="fas fa-arrow-down"></i></a>
<a :disabled="isAiPlaying" v-on:click="makeMove(direction.RIGHT)" href="#"><i
class="fas fa-arrow-right"></i></a>
</div>
</div>
</div>
<div>Icons made by <a href="https://www.flaticon.com/authors/icongeek26" title="Icongeek26">Icongeek26</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a></div>
</body>
<script src="./vendor/vue.js"></script>
<script src="./helper.js"></script>
<script src="./game.js"></script>
<script src="./ai.js"></script>
<script src="./page.js"></script>