Skip to content

Cape Town | 26-ITP-May | Shafiek Walker | Sprint 3 | Alarm Clock App - #1348

Open
shafiekwalker7861 wants to merge 3 commits into
CodeYourFuture:mainfrom
shafiekwalker7861:sprint-3-alarm-clock
Open

Cape Town | 26-ITP-May | Shafiek Walker | Sprint 3 | Alarm Clock App#1348
shafiekwalker7861 wants to merge 3 commits into
CodeYourFuture:mainfrom
shafiekwalker7861:sprint-3-alarm-clock

Conversation

@shafiekwalker7861

Copy link
Copy Markdown

Learners, PR Template

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

  • Updated the page title to "Alarm clock app"
  • Implemented the alarm countdown
  • Displayed the remaining time in minutes and seconds
  • Played the alarm when the countdown reached zero
  • Confirmed all 5 Alarm Clock tests pass

@shafiekwalker7861 shafiekwalker7861 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 31, 2026
Comment on lines +21 to +22
window.clearInterval(countdownId);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A user may not click the "Stop" button first before starting a new count down. Are there any other application states that should also be reset?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thank you. I updated setAlarm() to pause and rewind any existing alarm audio before starting a new countdown.

Comment thread Sprint-3/alarmclock/alarmclock.js Outdated
Comment on lines +14 to +18
function updateTimeRemaining() {
const heading = document.getElementById("timeRemaining");

heading.textContent = `Time Remaining: ${formatTime(secondsRemaining)}`;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why not design this function to take secondsRemaining through a parameter?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thank you. I updated updateTimeRemaining() to receive the remaining seconds as a parameter, reducing its dependency on global state.

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Aug 5, 2026
@shafiekwalker7861 shafiekwalker7861 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 8, 2026

@cjyuan cjyuan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes look good.

I think the app could also stop the countdown when the user click the "Stop Alarm" button.

@cjyuan cjyuan 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. Reviewed Volunteer to add when completing a review with trainee action still to take. labels Aug 8, 2026
@shafiekwalker7861

shafiekwalker7861 commented Aug 8, 2026 via email

Copy link
Copy Markdown
Author

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants