-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
91 lines (80 loc) · 2.68 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1">
<meta name="msapplication-tap-highlight" content="no" />
<title>Document</title>
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/hammer.js/1.0.6/hammer.min.js"></script> -->
<link href="https://fonts.googleapis.com/css?family=Lato:100,100i,300,300i,400,400i,700,700i,900,900i" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/hammer.js/2.0.8/hammer.min.js"></script>
<link rel="stylesheet" href="2048.css">
</head>
<body>
<p>Say: Left, Right, Up, Down move item game.</p>
<div class="score-high">Hight Score: <span class="high-score">0</span></div>
<div class="score-main">Score: <span class="score">0</span></div>
<div class="wrapper" id="wrapper">
<div class="grid">
<div class="cell"></div>
<div class="cell"></div>
<div class="cell"></div>
<div class="cell"></div>
<div class="cell"></div>
<div class="cell"></div>
<div class="cell"></div>
<div class="cell"></div>
<div class="cell"></div>
<div class="cell"></div>
<div class="cell"></div>
<div class="cell"></div>
<div class="cell"></div>
<div class="cell"></div>
<div class="cell"></div>
<div class="cell"></div>
</div>
</div>
<div class="guide">
Say: hello
</div>
<div class="guide">
Say: bye
</div>
<div class="abc" style="height: 1500px;">a</div>
<script>
var fixed = document.getElementById('wrapper');
fixed.addEventListener('touchmove', function(e) {
e.preventDefault();
}, false);
// key bàn phím
window.addEventListener("keydown", function(e) {
// space and arrow keys
if([32, 37, 38, 39, 40].indexOf(e.keyCode) > -1) {
e.preventDefault();
}
}, false);
let highScore = localStorage.getItem('gameHighScore') || 0
let highScoreEl = document.querySelector('.high-score')
highScoreEl.innerHTML = highScore
</script>
<div class="alan-btn"></div>
<script type="text/javascript" src="https://studio.alan.app/web/lib/alan_lib.js"></script>
<script src="2048.js" type="module"></script>
<script>
// var alanBtnInstance = alanBtn({
// key: "90307e8608d5558e8868eff283c9f0fb2e956eca572e1d8b807a3e2338fdd0dc/stage",
// onCommand: function (commandData) {
// if (commandData.command === "go:back") {
// //call client code that will react on the received command
// }
// },
// onCommand: function(commondData) {
// if (commondData.command === 'go-left') {
// goLeft();
// }
// },
// rootEl: document.getElementById("alan-btn"),
// });
</script>
</body>
</html>