London | 26-ITP-May | Bisrat Tesfay | Sprint 3 | Alarmclock - #1330
London | 26-ITP-May | Bisrat Tesfay | Sprint 3 | Alarmclock#1330B3-Bisrat wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
Nice stylings. This makes the page look nicer
| let timer; | ||
| function setAlarm() { | ||
| const input = document.getElementById("alarmSet"); | ||
| let seconds = Number(input.value); |
There was a problem hiding this comment.
What happens when seconds are 0 or negative?
There was a problem hiding this comment.
Thanks for the comment, I fixed that now.
There was a problem hiding this comment.
How can you provide feedback to the user about the invalid input?
| } else { | ||
| clearInterval(timer); | ||
| playAlarm(); | ||
| document.body.style.backgroundColor = "red"; |
There was a problem hiding this comment.
The color stays red when the timer is restarted. How can you change this?
There was a problem hiding this comment.
I fixed the background as well, Thank yoi
|
|
||
| clearInterval(timer); | ||
|
|
||
| function updateDisplay() { |
There was a problem hiding this comment.
Good job putting the code for formatting into an own function. This makes it reusable and easier to change the formatting if needed
Luro91
left a comment
There was a problem hiding this comment.
Well done. The code works well now.
For bonus points you could improve the feedback the user gets about invalid inputs.
Learners, PR Template
Self checklist
Changelist
I have done the alarm clock task.
Questions