Skip to content

London | 26-ITP-May | Dipa Sarker | Sprint 3 | Alarm Clock App - #1294

Open
Dipa-Sarker wants to merge 1 commit into
CodeYourFuture:mainfrom
Dipa-Sarker:Sprint-3/alarm-clock
Open

London | 26-ITP-May | Dipa Sarker | Sprint 3 | Alarm Clock App#1294
Dipa-Sarker wants to merge 1 commit into
CodeYourFuture:mainfrom
Dipa-Sarker:Sprint-3/alarm-clock

Conversation

@Dipa-Sarker

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

Implemented the alarm clock functionality with countdown and alarm controls.

** Changes made**

  • Added functionality for the Set Alarm button to start the countdown from the entered time.
  • Updated the timer display to show the remaining time in "mm:ss" format.
  • Added a countdown that decreases every second.
  • Triggered the alarm sound when the timer reaches "00:00".
  • Added Stop Alarm button functionality to stop the alarm sound and stop countdown after certain time.

I also tested the functions to works the app properly.

@Dipa-Sarker Dipa-Sarker added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 26, 2026
@LonMcGregor LonMcGregor added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Jul 27, 2026

@LonMcGregor LonMcGregor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good start on this task, there is still some work to do however

bodyElement.style.backgroundColor = "yellow";
alarmSoundElement.play();
}
function setAlarm() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Have you properly handled the input validation here?

.padStart(2, "0");
const showTimeSeconds = (remainingTime % 60).toString().padStart(2, "0");
timeRemainingElement.innerText = showTimeMinutes + ":" + showTimeSeconds;
if (remainingTime === 0) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Do you properly finish the timer countdown after it hits zero?


let remainingTime;
let intervalID;
function triggerAlarm() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

A bit more spacing between functions / improved formatting would help readability.

window.onload = setup;

const timeRemainingElement = document.querySelector("#timeRemaining");
const alarmSetElement = document.querySelector("#alarmSet");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

If you know you are using IDs, can you think of something better tha n querySelector?

@LonMcGregor LonMcGregor 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. Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Jul 27, 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