Skip to content

Commit

Permalink
timer stoppt nach n Sekunden
Browse files Browse the repository at this point in the history
  • Loading branch information
Closer2U committed Feb 21, 2024
1 parent e274156 commit 36b84cd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions js/timer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function startTimer(duration, display) {
var timer = duration, minutes, seconds;
setInterval(function () {
var interval = setInterval(function () {
minutes = parseInt(timer / 60, 10)
seconds = parseInt(timer % 60, 10);

Expand All @@ -11,12 +11,19 @@ function startTimer(duration, display) {

if (--timer < 0) {
timer = duration;


clearInterval(interval);

}
}, 1000);

}

window.onload = function () {
window.onclick = function () {
var oneMinute = 60,
display = document.getElementById('Timer');
startTimer(oneMinute, display);


};
2 changes: 1 addition & 1 deletion todo.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pulse.css
- [ ] hight/width via js berechnen!
- [x] centern vertikal
- [ ] Schrift horizontal zentrieren
- [x] Schrift horizontal zentrieren
- [x] 6s --> 5 ein - 1 pause - 5 aus - 1 pause
- [ ] auf mobil nicht scrollbar machen

Expand Down

0 comments on commit 36b84cd

Please sign in to comment.