Skip to content

Commit 900e3a3

Browse files
Made flash animation CSS
and minor other fixes
1 parent 1fdf1bf commit 900e3a3

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

script.js

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ $("#restart-button").click(function(){
2424
runTimer();
2525

2626
}
27-
bgAnimate = false;
27+
$("body").css({"animation-name":"", "animation-duration":"", "animation-iteration-count":""})
2828

2929
})
3030

@@ -38,7 +38,8 @@ function resetTimer(){
3838

3939
timerOn = false;
4040
bgAnimate = false;
41-
$("#stop-timer-button").css("display", "inherit");
41+
$("body").css({"animation-name":"", "animation-duration":"", "animation-iteration-count":""})
42+
$("#stop-timer-button").css("display", "");
4243
$("#stop-timer-div").css("display", "none");
4344
$("body").css("background-color", "black");
4445
// clearInterval(timer);
@@ -91,18 +92,20 @@ function runTimer(){
9192
timerOn = false;
9293
bgAnimate = true;
9394

94-
var flashRed = setInterval(function(){
95-
96-
if (bgAnimate == false){
97-
clearInterval(flashRed);
98-
return;
99-
}
100-
101-
$("body").animate({"background-color": "rgb(235, 0, 0)"}, 400)
102-
.delay(400)
103-
.animate({"background-color": "black"}, 400);
104-
105-
}, 1600);
95+
// var flashRed = setInterval(function(){
96+
//
97+
// if (bgAnimate == false){
98+
// clearInterval(flashRed);
99+
// return;
100+
// }
101+
//
102+
// $("body").animate({"background-color": "rgb(235, 0, 0)"}, 400)
103+
// .delay(400)
104+
// .animate({"background-color": "black"}, 400);
105+
//
106+
// }, 1600);
107+
108+
$("body").css({"animation-name":"doneFlash", "animation-duration":"1.6s", "animation-iteration-count":"infinite"})
106109

107110
}
108111

0 commit comments

Comments
 (0)