Sheffield | 26-ITP-Jan | Mona-Eltantawy | Sprint 3| Alarm clock#1158
Sheffield | 26-ITP-Jan | Mona-Eltantawy | Sprint 3| Alarm clock#1158Mona-Eltantawy wants to merge 8 commits into
Conversation
… instead of number - in the js file i implemented functions to set the alarm to count the remaining time and play the alarm sound when it counts to 0 .
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
The html title should say "Alarm clock app"
There was a problem hiding this comment.
yeah, I got your point and changed it
| function setAlarm() {} | ||
| var audio = new Audio("alarmsound.mp3"); | ||
|
|
||
| // DO NOT EDIT BELOW HERE |
There was a problem hiding this comment.
I think your code should be above this line
There was a problem hiding this comment.
I changed the whole page multiple times so I don't have the line now
| if (isNaN(timeRemaining) || timeRemaining <= 0) { | ||
| alert("Please enter a valid number greater than 0"); |
There was a problem hiding this comment.
Nice error handling. It's important to validate user input
There was a problem hiding this comment.
I've changed the alert to console.error.
not sure if it's right or not.
There was a problem hiding this comment.
I did not intent to request a change here. It was already good. The advantage of the alert is that it is more visible to the user. For the first exercises I think alerts and console.error logs are both fine.
|
|
||
| function pauseAlarm() { | ||
| audio.pause(); | ||
| audio.currentTime = 0; |
|
Closing PR because the January ITP run has finished. Feel free to re-open if you're still working on it. |

Self checklist