Created
July 15, 2016 21:31
-
-
Save sfoster/da29b7f9242d955ca116586f6a5599f3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html>\n | |
<html> | |
<head> | |
<title>Example status client</title> | |
<style> | |
.led { | |
width: 40px; | |
height: 40px; | |
display: inline-block; | |
} | |
</style> | |
</head> | |
<body> | |
<script> | |
function pollStatus() { | |
// make a request to /status.json every 10s | |
// call updateStatus in the callback | |
} | |
function updateStatus() { | |
// store updated value, did the value change? | |
// call render if value or last-modified changed | |
} | |
function renderStatus(idx, value) { | |
var ctx = | |
// could mock some LED sequences here? | |
// and/or just print the status value and last-modified date for now | |
} | |
</script> | |
<canvas id="led0" class="led"></canvas> | |
<canvas id="led1" class="led"></canvas> | |
<canvas id="led2" class="led"></canvas> | |
<canvas id="led3" class="led"></canvas> | |
<canvas id="led4" class="led"></canvas> | |
</body></html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment