aboutsummaryrefslogtreecommitdiff
path: root/public/index.html
diff options
context:
space:
mode:
authorJoris2016-09-04 21:21:11 +0200
committerJoris2016-09-04 21:21:31 +0200
commit973a039b54327df74396605410ea9abe19c8a4e7 (patch)
treec702564d17e0a490d56845027238eb4f231be785 /public/index.html
parent62fee9133f36f655c1ed83e0c2e85394f9948bf5 (diff)
Upgrade to elm 0.17.1
Diffstat (limited to 'public/index.html')
-rw-r--r--public/index.html40
1 files changed, 40 insertions, 0 deletions
diff --git a/public/index.html b/public/index.html
new file mode 100644
index 0000000..44749fc
--- /dev/null
+++ b/public/index.html
@@ -0,0 +1,40 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>Timer</title>
+ <meta charset="utf-8">
+ <link rel="stylesheet" href="style/reset.css">
+ <link rel="stylesheet" href="style/main.css">
+ <link rel="stylesheet" href="style/font-awesome/css/font-awesome.min.css">
+ <link rel="icon" type="image/png" href="images/icon.png">
+ <script src="client.js"></script>
+ </head>
+
+ <body>
+ </body>
+
+ <script>
+ const timer = Elm.Main.fullscreen(new Date().getTime())
+
+ document.onkeypress = function(event) {
+ timer.ports.keyPress.send(event.which)
+ };
+
+ const sound = new Audio('alarm.wav');
+ sound.addEventListener('ended', function() {
+ this.currentTime = 0;
+ this.play();
+ }, false);
+
+ timer.ports.ring.subscribe(function(ring) {
+ if(ring) {
+ document.title = "~\\ Timer /~"
+ sound.play()
+ } else {
+ document.title = "Timer"
+ sound.pause()
+ sound.currentTime = 0
+ }
+ });
+ </script>
+</html>