aboutsummaryrefslogtreecommitdiff
path: root/public/index.html
diff options
context:
space:
mode:
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>