London | 26-ITP-Jan | Angela McLeary | Sprint 3 | Alarm clock app#1134
London | 26-ITP-Jan | Angela McLeary | Sprint 3 | Alarm clock app#1134AngelaMcLeary wants to merge 11 commits intoCodeYourFuture:mainfrom
Conversation
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.
This comment has been minimized.
This comment has been minimized.
| //what ever we input is turned into seconds | ||
| let totalSeconds = parseInt(timeRemaining.value); | ||
|
|
||
| if (isNaN(totalSeconds) || totalSeconds <= 0) return; |
There was a problem hiding this comment.
Nice input validation. How could you inform the users that the input was invalid?
There was a problem hiding this comment.
Hi @Luro91, Thank you for your feedback. I have updated the element by putting in a placeholder with shadowed text. I have also thrown in an error message which let's the user know what they need to do.
| let colorInterval; | ||
|
|
||
| function setAlarm() { | ||
| clearInterval(alarmInterval); |
There was a problem hiding this comment.
Nice that you clear the interval here so that the running countdown is stopped
| }); | ||
| }); | ||
| //not sure that this is helping. The function works without it. | ||
| window.setAlarm = setAlarm; |
There was a problem hiding this comment.
You don't need to attach the function to the window object as the function is already declared in the file and available here in this file
There was a problem hiding this comment.
Hi @Luro91, Thank you for your feedback. I have removed it.
| //set the background color transition | ||
| document.body.style.transition = "background-color 0.7s ease"; | ||
| // call the entire page | ||
| window.addEventListener("load", function () { |
There was a problem hiding this comment.
Nice that you did the extension task with changing colors
Learners, PR Template
Self checklist
Changelist
Creating the alarm clock and styling it.