diff options
Diffstat (limited to 'index.html')
-rw-r--r-- | index.html | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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> |