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 hintCheckbox = document.querySelector("#hintCheck");
|
||||||
const timerInput = document.getElementById("timerInput");
|
const timerInput = document.getElementById("timerInput");
|
||||||
|
|
||||||
const isCordova = typeof cordova !== 'undefined';
|
|
||||||
|
|
||||||
const theme = localStorage.getItem('theme');
|
const theme = localStorage.getItem('theme');
|
||||||
|
|
||||||
if (theme == "light") {
|
if (theme == "light") {
|
||||||
|
|
@ -88,11 +86,10 @@ startButton.addEventListener('click', () => {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 3: {
|
case 3: {
|
||||||
if (isCordova && !!navigator.vibrate) {
|
if (!!navigator.vibrate) {
|
||||||
navigator.vibrate(0);
|
navigator.vibrate(0);
|
||||||
}
|
}
|
||||||
|
if (!!StayAwake.enableScreenTimeout) {
|
||||||
if (isCordova && !!StayAwake.enableScreenTimeout) {
|
|
||||||
StayAwake.enableScreenTimeout();
|
StayAwake.enableScreenTimeout();
|
||||||
}
|
}
|
||||||
clearInterval(timer);
|
clearInterval(timer);
|
||||||
|
|
@ -162,8 +159,7 @@ startButton.addEventListener('click', () => {
|
||||||
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
|
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
|
||||||
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
|
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
|
||||||
timerElement.innerText = `${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
|
timerElement.innerText = `${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
|
||||||
|
if (!!StayAwake.disableScreenTimeout) {
|
||||||
if (isCordova && !!StayAwake.disableScreenTimeout) {
|
|
||||||
StayAwake.disableScreenTimeout();
|
StayAwake.disableScreenTimeout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -174,7 +170,7 @@ startButton.addEventListener('click', () => {
|
||||||
navigator.vibrate([1000, 500, 1000, 2000, 1000, 500, 1000, 2000, 1000, 500, 1000, 2000]);
|
navigator.vibrate([1000, 500, 1000, 2000, 1000, 500, 1000, 2000, 1000, 500, 1000, 2000]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isCordova && !!StayAwake.enableScreenTimeout) {
|
if (!!StayAwake.enableScreenTimeout) {
|
||||||
StayAwake.enableScreenTimeout();
|
StayAwake.enableScreenTimeout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -183,7 +179,6 @@ startButton.addEventListener('click', () => {
|
||||||
}, 1000)
|
}, 1000)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function changeTheme(){
|
function changeTheme(){
|
||||||
body.classList.toggle('light-theme');
|
body.classList.toggle('light-theme');
|
||||||
console.log(body.classList.contains('light-theme') ? "light" : "dark")
|
console.log(body.classList.contains('light-theme') ? "light" : "dark")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue