diff options
| author | Karan Jayachandra <karan.jayachandra@nxp.com> | 2025-07-25 15:52:42 +0200 |
|---|---|---|
| committer | Karan Jayachandra <karan.jayachandra@nxp.com> | 2025-07-25 15:52:42 +0200 |
| commit | c041e74af8c69e8fb0680558e23dd7be542afcf6 (patch) | |
| tree | 4962e7c446a27aa23e6f20a3ffbb01774ac383f8 /app/static | |
| parent | 08e4a27c0db7fc2867cce3eb6f80799148c03ba6 (diff) | |
Working version
Diffstat (limited to 'app/static')
| -rw-r--r-- | app/static/custom.css | 3 | ||||
| -rw-r--r-- | app/static/custom.js | 52 |
2 files changed, 26 insertions, 29 deletions
diff --git a/app/static/custom.css b/app/static/custom.css index 9992ee5..8aa5b57 100644 --- a/app/static/custom.css +++ b/app/static/custom.css @@ -9,6 +9,9 @@ td { margin-top: 20px; margin-bottom: 20px; } +footer { + text-align: center; +} .parent { display: grid; grid-column-gap: 20px; diff --git a/app/static/custom.js b/app/static/custom.js index 2c47448..3daeb17 100644 --- a/app/static/custom.js +++ b/app/static/custom.js @@ -3,7 +3,7 @@ let timerRunningFlag = Number(sessionStorage.getItem("timerRunningFlag")) || 0; let deadline = Number(sessionStorage.getItem("deadline")) || new Date().getTime();
let clock = 0;
-window.onload += function setTimer(m, s) {
+function setTimer(m, s) {
let timer = document.getElementById("timer-display");
m = m < 10 ? ("0" + m) : m;
s = s < 10 ? ("0" + s) : s;
@@ -61,37 +61,31 @@ function startTimer(fresh) { clock = setInterval(refreshTimer, 1000);
}
-if (timerRunningFlag) startTimer(0); else resetTimer();
+window.onload = function () {
+ if (timerRunningFlag)
+ startTimer(0);
+ else resetTimer();
-document.getElementById("timer-start").addEventListener('click', ()=> {
- if (timerRunningFlag != 0) return;
- startTimer(1);
-});
-
-document.getElementById("timer-stop").addEventListener('click', ()=>{
- resetTimer();
-});
+ document.getElementById("timer-start").addEventListener('click', ()=> {
+ if (timerRunningFlag != 0) return;
+ startTimer(1);
+ });
-document.getElementById("timer-inc").addEventListener('click', ()=> {
- if (timerRunningFlag == 0) {
- minsPerRound += 1;
+ document.getElementById("timer-stop").addEventListener('click', ()=>{
resetTimer();
- }
-});
+ });
-document.getElementById("timer-dec").addEventListener('click', ()=> {
- if (timerRunningFlag == 0 && minsPerRound != 0) {
- minsPerRound -= 1;
- resetTimer();
- }
-});
+ document.getElementById("timer-inc").addEventListener('click', ()=> {
+ if (timerRunningFlag == 0) {
+ minsPerRound += 1;
+ resetTimer();
+ }
+ });
-const fileInput = document.querySelector("#file-js input[type=file]");
- if (fileInput !== null) {
- fileInput.onchange = () => {
- if (fileInput.files.length > 0) {
- const fileName = document.querySelector("#file-js .file-name");
- fileName.textContent = fileInput.files[0].name;
+ document.getElementById("timer-dec").addEventListener('click', ()=> {
+ if (timerRunningFlag == 0 && minsPerRound != 0) {
+ minsPerRound -= 1;
+ resetTimer();
}
- }
-};
\ No newline at end of file + });
+}
\ No newline at end of file |
