-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathindex.html
98 lines (78 loc) · 3.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
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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>2048 Game</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<div class="container" id="mainVue" v-cloak>
<div class="heading">
<h1 class="title">2048</h1>
<div class="scores-container">
<div class="score-container">{{conf.score}}</div>
<div class="best-container">{{conf.bestScore}}</div>
</div>
</div>
<div class="above-game">
<p class="game-intro">Join the numbers and get to the <strong>2048 tile!</strong></p>
<a class="restart-button" v-on="click: init">New Game</a>
<label class='left' for="noTiles">Select the number of tiles</label>
<select v-on="change: changesTilesSize" v-selected="conf.size">
<option value="4">4 tiles</option>
<option value="5">5 tiles</option>
<option value="6">6 tiles</option>
</select>
</div>
<div class="game-container" v-style="width:findDimension + 'px', height: findDimension + 'px'">
<div class="game-message">
<p></p>
<div class="lower">
<a class="keep-playing-button" v-on="click: clearMessage">Keep going</a>
<a class="retry-button" v-on="click: init">Try again</a>
</div>
</div>
<div class="grid-container">
<!-- Grid Here -->
<div v-repeat="grid" class="grid-row">
<div v-repeat="grid" class="grid-cell"></div>
<!-- <div v-repeat="grid" class="grid-cell" v-style="width: cellW + 'px',height: cellW + 'px'"></div> -->
</div>
</div>
<div class="tile-container" id="tile-container">
<!-- Component way with template inside component obj -->
<!-- <div v-repeat="tiles" v-component="tile"></div> -->
<!-- Component way with computed function -->
<div v-repeat="tiles" v-component="tile" v-style="$transform: 'translate(' + calcStyleX + 'px,' + calcStyleY + 'px)'" class="tile tile-{{value}} tile-new{{merged ? ' tile-merged' : ''}}">
<div class="tile-inner">{{value}}</div>
</div>
<!-- Use of the directive v-style -->
<!-- <div v-repeat="tiles" v-style="$transform: 'scale(' + x + ')'" class="tile tile-{{value}} tile-new">
<div class="tile-inner">{{value}}</div>
</div> -->
</div>
</div>
<p class="game-explanation">
<strong class="important">How to play:</strong> Use your <strong>arrow keys</strong> to move the tiles. When two tiles with the same number touch, they <strong>merge into one!</strong>
</p>
<hr>
<p>
<strong class="important">NOTE:</strong> This game was written using Vue.js
</p>
<hr>
<p>
Created by <a href="https://github.com/axilleasiv">Achilleas Kiritsakas</a> based on 2048 by <a href="http://gabrielecirulli.com" target="_blank">Gabriele Cirulli.</a> Based on <a href="https://itunes.apple.com/us/app/1024!/id823499224" target="_blank">1024 by Veewo Studio</a> and conceptually similar to <a href="http://asherv.com/threes/" target="_blank">Threes by Asher Vollmer.</a>
</p>
</div>
<!--<script type="text/x-template" id="grid-template">
<div v-repeat="grid" class="grid-row">
<div v-repeat="grid" class="grid-cell"></div>
</div>
</script> -->
<script src="js/libs/vue.js"></script>
<script src="js/keys.js"></script>
<script src="js/store.js"></script>
<script src="js/main.js"></script>
<script src="//localhost:35729/livereload.js"></script>
</body>
</html>