-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
71 lines (69 loc) · 2.09 KB
/
index.html
File metadata and controls
71 lines (69 loc) · 2.09 KB
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
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/1.11.8/semantic.min.css"/>
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/1.11.8/semantic.min.js"></script>
<script>
$(document).ready(function(){
$("#lock").click(function(){
$.post("https://api.particle.io/v1/devices//door",
{
access_token: "",
args: "lock"
},
function(data, status){
// alert("Data: <pre>" + JSON.stringify(data) + "</pre>\nStatus: " + status);
$("#log").after("<p>LOCKED!</p><p>"+JSON.stringify(data)+"</p>");
});
});
$("#unlock").click(function(){
$.post("https://api.particle.io/v1/devices//door",
{
access_token: "",
args: "unlock"
},
function(data, status){
// console.log(JSON.stringify(data));
$("#log").after("<p>UNLOCKED!</p><p>"+JSON.stringify(data)+"</p>");
// alert("Data: " + JSON.stringify(data) + "\nStatus: " + status);
});
});
});
</script>
<style type="text/css">
body {
background-color: #DADADA;
margin-top: 100px;
}
body > .grid {
height: 100%;
}
.image {
margin-top: -100px;
}
.column {
max-width: 450px;
}
</style>
</head>
<body>
<div class="ui middle aligned center aligned grid">
<div class="column">
<h2 class="ui teal image header">
<span class="glyphicons glyphicons-door"></span>
<div class="content">
Door Controller
</div>
</h2>
<div class="ui stacked segment">
<div class="ui red button" id="lock">Lock</div>
<div class="ui green button" id="unlock">Unlock</div>
<div class="ui header">Log:</div>
<div id="log"></div>
</div>
</div>
</div>
</body>
</html>