-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
79 lines (77 loc) · 2.83 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
<!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>SpaceAvoid</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.3.1/css/bulma.min.css" integrity="sha256-6ZFIKt0ohcBorQWIruhlYBoADBIFrJuXtEJsjFxb2Wk=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/outdated-browser/1.1.3/outdatedbrowser.min.css" />
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/outdated-browser/1.1.3/outdatedbrowser.min.js"></script>
<section class="section">
<div class="container has-text-centered">
<div class="heading">
<h1 class="title">SpaceAvoid</h1>
<h2 class="subtitle">
A simple GAME on the <strong>I2C LCD1602</strong>.
</h2>
</div>
<div class="content">
<p>
<span class="button is-primary" id="btn_up">Up</span>
<span class="button is-primary" id="btn_down">Down</span>
</p>
</div>
</div>
</section>
<div class="container has-text-centered">
<span class="button is-danger" id="btn_reset">Reset</span>
</div>
<!-- jQuery -->
<script src="//code.jquery.com/jquery-3.1.1.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script>
$(document).ready(function() {
console.log('init');
$('#btn_up').click(function() {
$.ajax({
url: "/up",
type: "GET",
dataType: "json"
})
.done(function( json ) {
if (json.success === true) {
console.log('up');
}
});
});
$('#btn_down').click(function() {
$.ajax({
url: "/down",
type: "GET",
dataType: "json"
})
.done(function( json ) {
if (json.success === true) {
console.log('down');
}
});
});
$('#btn_reset').click(function() {
$.ajax({
url: "/reset",
type: "GET",
dataType: "json"
})
.done(function( json ) {
if (json.success === true) {
console.log('reset');
}
});
});
});
</script>
</body>
</html>