aboutsummaryrefslogtreecommitdiff
path: root/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'index.html')
-rw-r--r--index.html15
1 files changed, 15 insertions, 0 deletions
diff --git a/index.html b/index.html
index 352f6b1..5417dcc 100644
--- a/index.html
+++ b/index.html
@@ -28,6 +28,21 @@
}
});
+ const sound = new Audio('alarm.wav');
+ sound.addEventListener('ended', function() {
+ this.currentTime = 0;
+ this.play();
+ }, false);
+
+ timer.ports.ringingTimers.subscribe(function(isRinging) {
+ if(isRinging) {
+ sound.play();
+ } else {
+ sound.pause();
+ sound.currentTime = 0;
+ }
+ });
+
</script>
</html>