Front End Development Libraries Projects - Build a 25 5 Clock

Tell us what’s happening:
Timer won’t stay at 00:00

Your code so far

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64; rv:106.0) Gecko/20100101 Firefox/106.0

Challenge: Front End Development Libraries Projects - Build a 25 + 5 Clock

Link to the challenge:

Timer works fine, but it seems like my timer skips 00:00 and goes straight to “break”, or “session”, and then plays the audio tag. Not sure how to work around this.

UPDATE: I got the timer to pause on 00:00 for a few seconds, still same tests failed. No longer sure what’s going wrong.

Another UPDATE: Fixed audio test failing; removed a timeout function (can’t remember why it was there)

Bumping. Still can’t figure out why tests 12, 13, and 15 are failing.

  • When the break timer reaches 00:00, the audio element has to be triggered
  • And also timer cycle has to be repetitive, the timer don’t have to stop itself, and when break timer is completed it has to start the cycle from the session again automatically
  • When timer is passed somewhere in middle, for example 24:57 and we increment the session, the timer has to set the same value that the session has. For example if timer time is 24:57 and session time is 25, when we increment this it has to go to 26:00 not 26:57. You have to reset the seconds to 00 whenever you are incrementing/ decrementing the time.

When the break timer reaches 00:00, the audio element has to be triggered

Does it not already do that?

And also timer cycle has to be repetitive, the timer don’t have to stop itself, and when break timer is completed it has to start the cycle from the session again automatically

Yeah I’m pretty sure I already have that.

When timer is passed somewhere in middle, for example 24:57 and we increment the session, the timer has to set the same value that the session has. For example if timer time is 24:57 and session time is 25, when we increment this it has to go to 26:00 not 26:57. You have to reset the seconds to 00 whenever you are incrementing/ decrementing the time.

Fixed this. Tests still fail.

I recorded a short video showing what happens when the Session timer reaches 00:00. As soon as it shows 00:00, Session should change to Break, but instead there is a 2-3 second pause before Break shows and the next timer starts at the set break time. This behavior is causing at least one test (maybe more) to fail.

Peek 2022-11-09 15-51

So I did that on purpose. I tried emulating the behavior of the timer that’s listed as an example on the assignment page, and it had this behavior. Also when I remove the timeout I get an audio error(#1) :confused:

And also timer cycle has to be repetitive, the timer don’t have to stop itself, and when break timer is completed it has to start the cycle from the session again automatically

EDIT: I thought I had that working. Guess not.

Getting some strange differences in how the page renders on codepen vs local.
Dunno how to append a gif (tried and wouldn’t let me upload), so here’s an imgur link of the codepen behavior and another of my code running locally.

Did a bit more testing, running the test bundle locally results in me passing 26/29 tests, while on codepen it only passes 24/29. Still, even on my local machine tests 12, 13, and 15 won’t pass.