Skip to content

Sheffield | ITP-Jan-26 | Mahammad Osman | Sprint 3 | Alarm Clock#1162

Open
Darkidd77 wants to merge 2 commits intoCodeYourFuture:mainfrom
Darkidd77:Alarm-Clock
Open

Sheffield | ITP-Jan-26 | Mahammad Osman | Sprint 3 | Alarm Clock#1162
Darkidd77 wants to merge 2 commits intoCodeYourFuture:mainfrom
Darkidd77:Alarm-Clock

Conversation

@Darkidd77
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

  • Connected the HTML inputs to the setAlarm function.
  • Implemented the countdown engine using setInterval (1000ms delay).
  • Added logic to mathematically split raw seconds into minutes and seconds, formatted to MM:SS using .padStart(2, '0').
  • Added safety checks to clearInterval both when the timer hits zero, and if the user clicks "Set Alarm" while a timer is already running.

@Darkidd77 Darkidd77 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 2, 2026
@Luro91 Luro91 added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Apr 4, 2026
const headingElement = document.getElementById("timeRemaining");

if (!inputElement.value) {
return;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It's important to validate user input.

What happens if a user enters a negative value?
How could you give feedback to the user about the input not being valid?

}, 1000);
}

function flashScreen() {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice bonus implementation of the flashing screen

@Luro91 Luro91 added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Apr 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants