-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
67 lines (58 loc) · 1.47 KB
/
index.html
File metadata and controls
67 lines (58 loc) · 1.47 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
<!DOCTYPE html>
<html>
<head>
<style>
body {
padding: 0 0 0 10px;
height: 260px;
}
#square {
padding: 10px;
height: 120px;
width: 120px;
border-radius: 10px;
background: #b5edc2;
transition: 1.2s;
}
</style>
</head>
<body>
<h1>Basic Ass Fire Controller</h1>
<div>
<button id="poofer0" onmousedown="openPoofer('0')" onmouseup="closePoofer(0)">
Poofer 0
</button>
<button id="poofer1" onmousedown="openPoofer('1')" onmouseup="closePoofer(1)">
Poofer 1
</button>
<button id="poofer2" onmousedown="openPoofer('2')" onmouseup="closePoofer(2)">
Poofer 2
</button>
<button id="poofer3" onmousedown="openPoofer('3')" onmouseup="closePoofer(3)">
Poofer 3
</button>
<button id="poofer4" onmousedown="openPoofer('4')" onmouseup="closePoofer(4)">
Poofer 4
</button>
</div>
<div>
<button id="pooferall" onmousedown="openPoofer('all')" onmouseup="closePoofer('all')">
All
</button>
</div>
<script>
function openPoofer(id) {
console.log(httpGet("http://192.168.1.200/" + id + "/on/"));
}
function closePoofer(id) {
console.log(httpGet("http://192.168.1.200/" + id + "/off/"));
}
function httpGet(theUrl) {
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", theUrl, false); // false for synchronous request
xmlHttp.send(null);
return xmlHttp.responseText;
}
</script>
</body>
</html>