Skip to content

London | 26-ITP-May | Bisrat Tesfay | Sprint 3 | Alarmclock - #1330

Open
B3-Bisrat wants to merge 4 commits into
CodeYourFuture:mainfrom
B3-Bisrat:alarmclock/sprint-3
Open

London | 26-ITP-May | Bisrat Tesfay | Sprint 3 | Alarmclock#1330
B3-Bisrat wants to merge 4 commits into
CodeYourFuture:mainfrom
B3-Bisrat:alarmclock/sprint-3

Conversation

@B3-Bisrat

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

I have done the alarm clock task.

Questions

@B3-Bisrat B3-Bisrat added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 28, 2026
@Luro91 Luro91 added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Jul 30, 2026

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 stylings. This makes the page look nicer

let timer;
function setAlarm() {
const input = document.getElementById("alarmSet");
let seconds = Number(input.value);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What happens when seconds are 0 or negative?

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.

Thanks for the comment, I fixed that now.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

How can you provide feedback to the user about the invalid input?

} else {
clearInterval(timer);
playAlarm();
document.body.style.backgroundColor = "red";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The color stays red when the timer is restarted. How can you change this?

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.

I fixed the background as well, Thank yoi


clearInterval(timer);

function updateDisplay() {

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 job putting the code for formatting into an own function. This makes it reusable and easier to change the formatting if needed

@Luro91 Luro91 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 30, 2026
@B3-Bisrat B3-Bisrat 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 Aug 4, 2026

@Luro91 Luro91 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.

Well done. The code works well now.

For bonus points you could improve the feedback the user gets about invalid inputs.

@Luro91 Luro91 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 Aug 5, 2026
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