Compare commits
No commits in common. "main" and "v1.1" have entirely different histories.
1 changed files with 7 additions and 12 deletions
|
|
@ -6,8 +6,6 @@ const body = document.querySelector("body");
|
|||
const hintCheckbox = document.querySelector("#hintCheck");
|
||||
const timerInput = document.getElementById("timerInput");
|
||||
|
||||
const isCordova = typeof cordova !== 'undefined';
|
||||
|
||||
const theme = localStorage.getItem('theme');
|
||||
|
||||
if (theme == "light") {
|
||||
|
|
@ -88,11 +86,10 @@ startButton.addEventListener('click', () => {
|
|||
break;
|
||||
}
|
||||
case 3: {
|
||||
if (isCordova && !!navigator.vibrate) {
|
||||
if (!!navigator.vibrate) {
|
||||
navigator.vibrate(0);
|
||||
}
|
||||
|
||||
if (isCordova && !!StayAwake.enableScreenTimeout) {
|
||||
if (!!StayAwake.enableScreenTimeout) {
|
||||
StayAwake.enableScreenTimeout();
|
||||
}
|
||||
clearInterval(timer);
|
||||
|
|
@ -162,28 +159,26 @@ startButton.addEventListener('click', () => {
|
|||
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
|
||||
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
|
||||
timerElement.innerText = `${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
|
||||
|
||||
if (isCordova && !!StayAwake.disableScreenTimeout) {
|
||||
if (!!StayAwake.disableScreenTimeout) {
|
||||
StayAwake.disableScreenTimeout();
|
||||
}
|
||||
|
||||
if (distance < 0) {
|
||||
clearInterval(timer);
|
||||
|
||||
|
||||
if (!!navigator.vibrate) {
|
||||
navigator.vibrate([1000, 500, 1000, 2000, 1000, 500, 1000, 2000, 1000, 500, 1000, 2000]);
|
||||
}
|
||||
|
||||
if (isCordova && !!StayAwake.enableScreenTimeout) {
|
||||
|
||||
if (!!StayAwake.enableScreenTimeout) {
|
||||
StayAwake.enableScreenTimeout();
|
||||
}
|
||||
|
||||
|
||||
timerElement.innerText = "Acabou!";
|
||||
}
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
|
||||
function changeTheme(){
|
||||
body.classList.toggle('light-theme');
|
||||
console.log(body.classList.contains('light-theme') ? "light" : "dark")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue