Skip to content

Commit

Permalink
BUG show timer not working
Browse files Browse the repository at this point in the history
  • Loading branch information
Closer2U committed Feb 21, 2024
1 parent 36b84cd commit 3cea5ad
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 10 deletions.
49 changes: 41 additions & 8 deletions js/timer.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,55 @@ function startTimer(duration, display) {
seconds = seconds < 10 ? "0" + seconds : seconds;

display.textContent = minutes + ":" + seconds;

fadeTimer();

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


// Put all CSS back to First Iteration
clearInterval(interval);

document.getElementById("Pulse").style.animation = "";
document.getElementById("Start").style.display = "";
}
}, 1000);

}

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


};
};


var display = document.getElementById('Timer');

function fadeTimer() {
console.log("Display: ")
var fadeEffect = setInterval(function () {
if (!display.style.opacity) {
display.style.opacity = 1;
}
if (display.style.opacity > 0) {
display.style.opacity -= 0.05;
} else {
clearInterval(fadeEffect);
}
}, 100);
}

display.onclick = function showTimer () {
console.log("Display2: ")
//TODO fix damit man den Timer wieder einblenden kann
var showEffect = setInterval(function () {
if (!display.style.opacity) {
display.style.opacity = 1;
}
if (display.style.opacity < 1) {
display.style.opacity += 0.5;
} else {
clearInterval(showEffect);
}
}, 100);
}
5 changes: 3 additions & 2 deletions todo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ pulse.css

- [ ] Einstellungen für todo highlight aus thinkpad übernehmen

- [ ] create timer
- [x] create timer
- [ ] timer stops --> restart
- [ ] "START" reappears
- [ ] timer hide after 2s , reappear on touch
- [x] timer hide after 2s ,
- [ ] reappear on touch

- [ ] service worker fixen

Expand Down

0 comments on commit 3cea5ad

Please sign in to comment.