Skip to content

Conversation

@shreefAhmedM
Copy link

@shreefAhmedM shreefAhmedM commented Oct 15, 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

Here is a basic implementation of an alarm clock app using HTML and JavaScript

@shreefAhmedM shreefAhmedM added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 15, 2025
@shreefAhmedM shreefAhmedM changed the title Glasgow | 25-ITP-SEP | Shreef Ibrahim | Sprint 2| Coursework alarm clock app Glasgow | 25-ITP-SEP | Shreef Ibrahim | Sprint 2| Alarm clock app Oct 15, 2025
@shreefAhmedM shreefAhmedM changed the title Glasgow | 25-ITP-SEP | Shreef Ibrahim | Sprint 2| Alarm clock app Glasgow | 25-ITP-SEP | Shreef Ibrahim | Sprint 3| Alarm clock app Oct 15, 2025
@jennethydyrova jennethydyrova 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 Oct 26, 2025
Copy link

@jennethydyrova jennethydyrova left a comment

Choose a reason for hiding this comment

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

Really great start but there are couple of issues to address.

function setAlarm() {
const timeRemaining = document.getElementById("timeRemaining");
const alarmSet = document.getElementById("alarmSet").value;
alarmTime = parseInt(alarmSet);

Choose a reason for hiding this comment

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

You might want to add some value validation to ensure that you get integer and this line doesn't throw an error.

} else {
clearInterval(countDown);
playAlarm();
document.body.style.background = "#e14343";

Choose a reason for hiding this comment

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

Background color is not set to red when alarmTime reaches 0. You might want to double check this logic

"0"
)}:${String(seconds).padStart(2, "0")}`;
}
// DO NOT EDIT BELOW HERE

Choose a reason for hiding this comment

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

You are missing stopAlarm function implementation. Please double check the acceptance criteria for this PR.

@jennethydyrova jennethydyrova 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 Oct 26, 2025
@shreefAhmedM shreefAhmedM added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 28, 2025
Copy link

@jennethydyrova jennethydyrova left a comment

Choose a reason for hiding this comment

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

hi @shreefAhmedM! Really great work! I have just two small comments and it's good to go.

Optionally, when you have time, I would like you to think how you could rewrite this cleaner without having many variables in a global scope. You can pass parameters to event listener functions or perhaps restructure your functions in a way that allows passing variables as parameters.

});
// set up alarm
function setAlarm() {
const val = parseInt(inputField.value);

Choose a reason for hiding this comment

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

What if inputField.value is empty? Can you try starting the alarm without entering anything into input field?

Copy link
Author

Choose a reason for hiding this comment

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

When inputField.value is empty, the parseInt("") returns NaN,
So I have validated the condition if the value is NaN, Undefined , null or less than 0 , i used return it will stop any further execution so no nothing will happen. I can throw an error message instead.

Copy link

@jennethydyrova jennethydyrova Oct 29, 2025

Choose a reason for hiding this comment

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

You mean you already have it in your code or you are going to push? I don't see validation against NaN, etc.

Copy link
Author

Choose a reason for hiding this comment

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

i have already used it thing i did not push properly

Choose a reason for hiding this comment

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

Ah okay, that happens 🙂


// stop or start flashing
let flashingInterval;
const flashingColors = ["#FF4136", "#2ECC40", "#0074D9", "#FFDC00"];

Choose a reason for hiding this comment

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

It's better to keep variable local if it's not used elsewhere. Makes your code cleaner and reduces possibility of bugs due to accidental change to your variable.

@jennethydyrova jennethydyrova removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 29, 2025
@shreefAhmedM shreefAhmedM added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 29, 2025
@jennethydyrova
Copy link

Looks good to me, good job!

@jennethydyrova jennethydyrova 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 Oct 29, 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants