js/index.js
// this is begging to be refactored...
this is begging to be refactored
this is begging to be refactored
function minutesdown() {
  if (minutes > 0) {
    if (seconds === 0) {
      minutes--;
      seconds = 59;
      $("#minutes").text(minutes);
      $("#seconds").text(seconds);
    } else if (seconds > 0) {
      seconds--;
      if (seconds < 10) {
        $("#minutes").text(minutes);
        $("#seconds").text("0" + seconds);
      } else {
        $("#minutes").text(minutes);
        $("#seconds").text(seconds);
      }
    }
  } else if (minutes === 0 && seconds !== 0) {
    seconds--;
    if (seconds < 10) {
      $("#minutes").text(minutes);
      $("#seconds").text("0" + seconds);
    } else {
      $("#minutes").text(minutes);
      $("#seconds").text(seconds);
    }
  } else {
    minutes = originalMinutes;
    seconds = 0;
    $("#minutes").text(minutes);
    $("#seconds").text("0" + seconds);
    clearInterval(timer);
    snd.play();
    startBreak();
  }
}
function minutesdown ( ) { if ( minutes > 0 ) { if ( seconds === 0 ) { minutes -- ; seconds = 59 ; $ ( "#minutes" ) . text ( minutes ) ; $ ( "#seconds" ) . text ( seconds ) ; } else if ( seconds > 0 ) { seconds -- ; if ( seconds < 10 ) { $ ( "#minutes" ) . text ( minutes ) ; $ ( "#seconds" ) . text ( "0" + seconds ) ; } else { $ ( "#minutes" ) . text ( minutes ) ; $ ( "#seconds" ) . text ( seconds ) ; } } } else if ( minutes === 0 && seconds !== 0 ) { seconds -- ; if ( seconds < 10 ) { $ ( "#minutes" ) . text ( minutes ) ; $ ( "#seconds" ) . text ( "0" + seconds ) ; } else { $ ( "#minutes" ) . text ( minutes ) ; $ ( "#seconds" ) . text ( seconds ) ; } } else { minutes = originalMinutes ; seconds = 0 ; $ ( "#minutes" ) . text ( minutes ) ; $ ( "#seconds" ) . text ( "0" + seconds ) ; clearInterval ( timer ) ; snd . play ( ) ; startBreak ( ) ; } }
this is begging to be refactored...
this is begging to be refactored ...