Skip to content
Snippets Groups Projects
Commit 978c5d5e authored by David Huss's avatar David Huss :speech_balloon:
Browse files

Hide uptime when off

parent 6836f5b9
No related branches found
No related tags found
No related merge requests found
......@@ -98,11 +98,14 @@ class System {
let now = new Date();
let t = now - power_up;
console.log(t);
let seconds = Math.round(t/1000, 0);
let minutes = Math.round(t/1000/60, 0);
if (minutes < 240) {
if (minutes < 1) {
uptime_display.innerHTML = `on for ${seconds} s`;
} else if (minutes < 240) {
uptime_display.innerHTML = `on for ${minutes} min`;
} else {
let hours = Math.round(minutes/60, 1);
let hours = Math.round(t/1000/60/60, 1);
uptime_display.innerHTML = `on for ${hours} h`;
}
......
......@@ -30,6 +30,10 @@ main {
padding-top: 0.3em;
}
.hidden {
display: none;
}
header {
width: 100%;
border-bottom: 1px solid white;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment