-
-
Notifications
You must be signed in to change notification settings - Fork 193
London | 25-ITP-Sep | Sophia Mohamed| Sprint 3 | Alarm Clock #877
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| // Update the text at the top: "Time Remaining: mm:ss" | ||
| function updateTimeDisplay() { | ||
| const titleElement = document.getElementById("timeRemaining"); | ||
| if (!titleElement) return; // safety check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good defensive programming
Sprint-3/alarmclock/alarmclock.js
Outdated
| if (!input) return; | ||
|
|
||
| const seconds = Number(input.value); | ||
| document.body.style.backgroundColor = "red"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove or move the red background line.
It probably belongs inside the block that runs when the countdown reaches zero.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion!
I’ve moved the red background line into the block that runs when the countdown reaches zero, so it only turns red when the timer finishes instead of immediately.
Learners, PR Template
Self checklist
Changelist
Wrote the countdown logic.
Updated the timer display.
Made the alarm play at 00:00.
Added pause/resume button.
Added flashing background.
Questions
No questions