Birmingham | 26-ITP-Jan | Tasleem Adedokun | Sprint 3 | Alarm clock#1093
Birmingham | 26-ITP-Jan | Tasleem Adedokun | Sprint 3 | Alarm clock#1093tasleemadedokun wants to merge 8 commits intoCodeYourFuture:mainfrom
Conversation
magarpratik
left a comment
There was a problem hiding this comment.
Really good effort! 👍
I've added a few comments. Could you please review them?
Sprint-3/alarmclock/readme.md
Outdated
Sprint-3/alarmclock/alarmclock.js
Outdated
| if (window.JEST_WORKER_ID){ | ||
| flashInterval = setInterval(() => { | ||
| document.body.style.backgroundColor = | ||
| document.body.style.backgroundColor === "green" ? "white" : "green"; | ||
| }, 500); |
There was a problem hiding this comment.
I tested the work locally and the background colour is not changing when the timer reaches 00:00. Could you look into it?
There was a problem hiding this comment.
I tested the work locally and the background colour is not changing when the timer reaches 00:00. Could you look into it?
worked on it already thanks.
There was a problem hiding this comment.
Nice, the background is flashing now! Great job on completing the stretch task! 🎉
| function updateDisplay() { | ||
| const minutes = Math.floor(timeRemaining / 60); | ||
| const seconds = timeRemaining % 60; | ||
|
|
||
| const mm = String(minutes).padStart(2, "0"); | ||
| const ss = String(seconds).padStart(2, "0"); | ||
|
|
||
| display.textContent = `Time Remaining: ${mm}:${ss}`; | ||
| } |
There was a problem hiding this comment.
This logic looks good. 👍
Thank you very much.
Sprint-3/alarmclock/alarmclock.js
Outdated
| // Decrement only if above 0 | ||
| timeRemaining--; | ||
| updateDisplay(); |
There was a problem hiding this comment.
When testing, the timer reaches stops at -1:-1 rather than 00:00. Could you look into it?
There was a problem hiding this comment.
When testing, the timer reaches stops at -1:-1 rather than 00:00. Could you look into it?
I think it should be fine now.
There was a problem hiding this comment.
Thank you very much for your time.
magarpratik
left a comment
There was a problem hiding this comment.
Great work, app works as expected! 👍
Well done on completing the stretch task! 👏
| interval = setInterval(() => { | ||
| if (timeRemaining <= 0) { | ||
| clearInterval(interval); | ||
| timeRemaining = 0; |
Learners, PR Template
Self checklist
Changelist
Brief:
I have done the alarm coursework, and I have also done regular commits to this coursework.