-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
36 lines (36 loc) · 1.2 KB
/
index.html
File metadata and controls
36 lines (36 loc) · 1.2 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Stoplight control</title>
<script src="main.js"></script>
<link href="style.css" rel="stylesheet">
</head>
<body>
<h1>Stoplight</h1>
<div class="center">
<div class="frame">
<div class="circle" id="stop">Stop</div>
<div class="circle" id="yellow">Yellow</div>
<div class="circle" id="go">Go</div>
</div>
</div>
<h2>Controls</h2>
<div class="controls center">
<div class="button btn-large" id="off">Off</div>
</div>
<div class="controls center">
<label for="token">Device Token</label>
<input id="token" type="text" name="token"/>
<button id="setToken">Set</button>
</div>
<script>
// bind handlers
document.getElementById("go").onclick = function(){ setLight('green'); };
document.getElementById("stop").onclick = function(){ setLight('red') };
document.getElementById("yellow").onclick = function(){ setLight('yellow') };
document.getElementById("off").onclick = function(){ setLight('off') };
document.getElementById("setToken").onclick = function(){ setToken() };
</script>
</body>
</html>