Skip to content

Conversation

@ahmadehsas
Copy link

@ahmadehsas ahmadehsas commented Nov 19, 2025

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

I have completed all the required tasks.

Questions

…yped, start a countdown from that number, update the display every second and play an alarm when the time reaches zero.
…clearing the interval stops the countdown immediately if user press Stop alarm.
…set the background color when Stop Alarm is pressed.
@github-actions
Copy link

Your PR's title isn't in the expected format.

Please check the expected title format, and update yours to match.

Reason: Sprint part (Data groups) doesn't match expected format (example: 'Sprint 2', without quotes)

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

4 similar comments
@github-actions
Copy link

Your PR's title isn't in the expected format.

Please check the expected title format, and update yours to match.

Reason: Sprint part (Data groups) doesn't match expected format (example: 'Sprint 2', without quotes)

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@github-actions
Copy link

Your PR's title isn't in the expected format.

Please check the expected title format, and update yours to match.

Reason: Sprint part (Data groups) doesn't match expected format (example: 'Sprint 2', without quotes)

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@github-actions
Copy link

Your PR's title isn't in the expected format.

Please check the expected title format, and update yours to match.

Reason: Sprint part (Data groups) doesn't match expected format (example: 'Sprint 2', without quotes)

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@github-actions
Copy link

Your PR's title isn't in the expected format.

Please check the expected title format, and update yours to match.

Reason: Sprint part (Data groups) doesn't match expected format (example: 'Sprint 2', without quotes)

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@ahmadehsas ahmadehsas changed the title Birmingham | ITP-Sep-Ahmad Ehsas | sprint 3 | Data groups | Feature/alarmclock Birmingham | ITP-Sep-2025 |Ahmad Ehsas | sprint 3 | Feature/alarmclock Nov 19, 2025
@github-actions
Copy link

Your PR description contained template fields which weren't filled in.

Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed.

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@ahmadehsas ahmadehsas changed the title Birmingham | ITP-Sep-2025 |Ahmad Ehsas | sprint 3 | Feature/alarmclock Birmingham | ITP-Sep-2025 |Ahmad Ehsas | sprint 3 | Alarm Clock Nov 19, 2025
@github-actions
Copy link

Your PR description contained template fields which weren't filled in.

Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed.

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

1 similar comment
@github-actions
Copy link

Your PR description contained template fields which weren't filled in.

Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed.

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@ahmadehsas ahmadehsas added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Nov 19, 2025
@github-actions
Copy link

Your PR description contained template fields which weren't filled in.

Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed.

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@github-actions github-actions bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Nov 19, 2025
@github-actions
Copy link

Your PR description contained template fields which weren't filled in.

Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed.

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@ahmadehsas ahmadehsas changed the title Birmingham | ITP-Sep-2025 |Ahmad Ehsas | sprint 3 | Alarm Clock Birmingham | ITP-Sep-2025 |Ahmad Ehsas | Data groups | Alarm Clock Nov 19, 2025
@github-actions
Copy link

Your PR's title isn't in the expected format.

Please check the expected title format, and update yours to match.

Reason: Sprint part (Data groups) doesn't match expected format (example: 'Sprint 2', without quotes)

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@ahmadehsas ahmadehsas added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Nov 19, 2025
@github-actions
Copy link

Your PR's title isn't in the expected format.

Please check the expected title format, and update yours to match.

Reason: Sprint part (Data groups) doesn't match expected format (example: 'Sprint 2', without quotes)

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@github-actions github-actions bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Nov 19, 2025
@ahmadehsas ahmadehsas changed the title Birmingham | ITP-Sep-2025 |Ahmad Ehsas | Data groups | Alarm Clock Birmingham | ITP-Sep-2025 |Ahmad Ehsas | Sprint 3 | Alarm Clock Nov 19, 2025
@github-actions
Copy link

Your PR description contained template fields which weren't filled in.

Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed.

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

2 similar comments
@github-actions
Copy link

Your PR description contained template fields which weren't filled in.

Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed.

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@github-actions
Copy link

Your PR description contained template fields which weren't filled in.

Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed.

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@ahmadehsas ahmadehsas added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Nov 19, 2025
// validate the input value
if (!Number.isFinite(timeLeft) || timeLeft <= 0) { // The Number.isFinite() method is a way to test whether a value
// is a finite number value. and also prevents the error if the user types nothing or a negative number.
return "input is invalid"; // input is invalid

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice Work @ahmadehsas
The value returned here input is invalid
is it been used anywhere in the code?

if it is not been been used we can just use return without input is invalid



}
let countdown = null;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ahmadehsas I think it would be more readable to move let countdown = null above setAlarm()

audio.currentTime = 0; // reset to start, make sure next time play alarm starts from the beginning.

// reset the background color to original
document.body.style.backgroundColor = "";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good!
I noticed we are only resetting the background color when we pause the alarm but we do not reset the background when setting new alarm in setAlarm

playAlarm(); // play the alarm sound

// change background color when the alarm clock finishes
document.body.style.backgroundColor = "red";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens when the user lets the alarm finish (without clicking stop), the background stays red forever.
I think you should reset he background color before starting a new alarm, inside setAlarm()

@jaymes15 jaymes15 removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Nov 22, 2025
@jaymes15 jaymes15 added 📅 Sprint 3 Assigned during Sprint 3 of this module Reviewed Volunteer to add when completing a review with trainee action still to take. labels Nov 22, 2025
@ahmadehsas ahmadehsas added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Nov 23, 2025
Copy link

@jaymes15 jaymes15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good Job!! @ahmadehsas

@jaymes15 jaymes15 self-requested a review November 23, 2025 05:28
@jaymes15 jaymes15 added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Nov 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed. 📅 Sprint 3 Assigned during Sprint 3 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants