I have one more problem. I cannot stop ticking previous instances of timer when another button is clicked. For example if user click pomodoro button and then short break button it just breaks and shows both pomodoro timer ticker and short break ticker. I created a function:
function pomodoro(x){
s = setInterval(function(){
timeIt(x);
}, 1000);
}
to have it run from button onClick event. Then i think i cannot access it. I tried with some booleans if executed but this doesn’t seems to work because i don’t really know where to put it.
Codepen
So after few hours (actually about 2!) I’ve done it. I added custom pomodoro loop including pomodoro timer + ring when pomodoro ends + break timer. Unfortunatelly I’m too lazy to include ring to codepen but belive me it works.
Also With submit button u can assign your break and work time. It’s assigned for both break button’s so I will think about additional “Custom break” button. Thank you for your advices and I’m waiting for more