diff --git a/audio/button-34.mp3 b/audio/button-34.mp3 deleted file mode 100644 index 8b03711..0000000 Binary files a/audio/button-34.mp3 and /dev/null differ diff --git a/audio/button-41.mp3 b/audio/button-41.mp3 deleted file mode 100644 index 0ec3f82..0000000 Binary files a/audio/button-41.mp3 and /dev/null differ diff --git a/audio/button-42.mp3 b/audio/button-42.mp3 deleted file mode 100644 index b2a0516..0000000 Binary files a/audio/button-42.mp3 and /dev/null differ diff --git a/audio/button-43.mp3 b/audio/button-43.mp3 deleted file mode 100644 index c299dc1..0000000 Binary files a/audio/button-43.mp3 and /dev/null differ diff --git a/css/styles.css b/css/styles.css index 5ac196d..cd3ab5a 100644 --- a/css/styles.css +++ b/css/styles.css @@ -173,17 +173,17 @@ a:link, a:hover, a:visited, a:active { to {right: 100%;} } .slideIn { - -moz-animation: slideIn 0.1s ease-in; - -webkit-animation: slideIn 0.1s ease-in; - -o-animation: slideIn 0.1s ease-in; - animation: slideIn 0.1s ease-in; + -moz-animation: slideIn 0.25s ease-in; + -webkit-animation: slideIn 0.25s ease-in; + -o-animation: slideIn 0.25s ease-in; + animation: slideIn 0.25s ease-in; right: 0; } .slideOut { - -moz-animation: slideOut 0.1s ease-out; - -webkit-animation: slideOut 0.1s ease-out; - -o-animation: slideOut 0.1s ease-out; - animation: slideOut 0.1s ease-out; + -moz-animation: slideOut 0.25s ease-out; + -webkit-animation: slideOut 0.25s ease-out; + -o-animation: slideOut 0.25s ease-out; + animation: slideOut 0.25s ease-out; right: 100%; } diff --git a/images/icon.png b/images/icon.png deleted file mode 100644 index 1e2d25e..0000000 Binary files a/images/icon.png and /dev/null differ diff --git a/images/icon.xcf b/images/icon.xcf deleted file mode 100644 index 0469c5d..0000000 Binary files a/images/icon.xcf and /dev/null differ diff --git a/js/app.js b/js/app.js index 4749753..c4d00c8 100644 --- a/js/app.js +++ b/js/app.js @@ -43,12 +43,12 @@ } }; $scope.timer = getSavedTimer(); - console.log($scope.timer); $scope.lowIntensityBeep = new Audio('audio/beep-09.mp3'); $scope.highIntensityBeep = new Audio('audio/button-42(1).mp3'); $scope.coolDownBeep = new Audio('audio/beep-10.mp3'); $scope.warmUp = true; $scope.round = 1; + $scope.cycle = 1; $scope.time = $scope.timer.warmUpTime; $scope.settingsOpen = false; $scope.closeSettings = false; @@ -79,6 +79,24 @@ $scope.highIntensityBeep.play(); $scope.startTimer(); } + $scope.startWarmUp = function() { + if ($scope.time == 0) { + $scope.warmUp = false; + $scope.setHighIntensity(); + }; + $scope.$apply(function() { + $scope.time--; + }); + }; + $scope.startCoolDown = function() { + if ($scope.time == 0) { + $scope.coolDown = false; + $scope.resetTimer(); + }; + $scope.$apply(function() { + $scope.time--; + }); + }; $scope.startLowIntensity = function() { if ($scope.time == 0) { $scope.lowIntensity = false; @@ -89,31 +107,36 @@ }); }; $scope.startHighIntensity = function() { - if ($scope.time == 0) { - $scope.round++; - $scope.highIntensity = false; - if ($scope.round < $scope.timer.cycles) { - $scope.setLowIntensity(); - } else { - $scope.cycle++; - if ($scope.cycle < $scope.timer.repeat) { - $scope.warmUp = true; - } else { - $scope.coolDown = true; - } - } - }; - $scope.$apply(function() { - $scope.time--; - }); + if ($scope.time == 0) { + $scope.round++; + $scope.highIntensity = false; + console.log("This runs"); + if ($scope.round < $scope.timer.cycles) { + $scope.setLowIntensity(); + } else { + $scope.cycle++; + // console.log($scope.cycle); + // console.log($scope.timer.repeat); + if ($scope.cycle < $scope.timer.repeat) { + $scope.warmUp = true; + $scope.setWarmUp(); + } else { + $scope.coolDown = true; + $scope.setCoolDown(); + } + } + }; + $scope.$apply(function() { + $scope.time--; + }); }; $scope.startTimer = function() { $scope.timerActive = true; if ($scope.warmUp) { - $scope.countdown = setInterval($scope.startHighIntensity, 1000); + $scope.countdown = setInterval($scope.startWarmUp, 1000); } if ($scope.coolDown) { - $scope.countdown = setInterval($scope.startHighIntensity, 1000); + $scope.countdown = setInterval($scope.startCoolDown, 1000); } if ($scope.highIntensity) { $scope.countdown = setInterval($scope.startHighIntensity, 1000); @@ -127,6 +150,14 @@ clearInterval($scope.countdown); }; $scope.stepBack = function() { + if ($scope.warmUp) { + if ($scope.cycle != 1) { + $scope.warmUp = false; + $scope.cycle--; + $scope.setHighIntensity(); + return; + }; + }; if ($scope.lowIntensity) { $scope.lowIntensity = false; if ($scope.round == 1) { @@ -161,9 +192,14 @@ }; if ($scope.highIntensity) { $scope.highIntensity = false; - if ($scope.round == $scope.timer.cycles) { + if ($scope.round == $scope.timer.cycles && $scope.cycle == $scope.timer.repeat) { $scope.setCoolDown(); return; + } else if ($scope.round == $scope.timer.cycles && $scope.cycle < $scope.timer.repeat) { + $scope.cycle++; + $scope.round = 1; + $scope.setWarmUp(); + return; } $scope.setLowIntensity(); $scope.round++; @@ -174,6 +210,7 @@ clearInterval($scope.countdown); $scope.timerActive = false; $scope.round = 1; + $scope.cycle = 1; $scope.lowIntensity = false; $scope.highIntensity = false; $scope.coolDown = false;