Having trouble with the pomodoro clock project

Having trouble with the pomodoro clock project
0

#1

I have been working on the pomodoro project for a while, but I wasn’t able to fully finish it, one is because that the audio file would keep on repeating, and the other is that every time the clock goes to zero, I would have to click “start” again for it to start the timer for the break/session. Is it possible for it to automatically start the timer again? And how do I stop the repetition of the audio? Here is the link to my project: http://codepen.io/ElisaL/full/JEQGzO/ (PS I set the time to 1 minute and made it 10 times as fast for testing purposes, and was too lazy to do the css part of it :stuck_out_tongue: ) Please help! Thank you!


#2

a few hints for starters…

do you ever stop the session timer?
when and where do you start the break timer?

try changing

    if(s_seconds > 0){
      s_seconds--;

to

    s_seconds--;
    if(s_seconds > 0){

you should see what’s going on and why the sound doesn’t stop.


#3

The example code showed that the break timer should automatically start after the session timer reaches zero, and the session timer should automatically start after the break timer reaches zero. The only problem I have now is that I would have to click the “start” button again for the next timer to start, but once I clicked it, the audio just automatically stops. But thank you for your suggestion!:blush: