Skip to content

Commit

Permalink
Add a little text saying when the data last was updated
Browse files Browse the repository at this point in the history
  • Loading branch information
foodelevator committed Dec 31, 2024
1 parent a7acb02 commit 0d83919
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 6 deletions.
11 changes: 9 additions & 2 deletions public/css/common.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
@import url('https://fonts.googleapis.com/css?family=Poppins');

* {
font-family: 'Poppins';
margin: 0;
padding: 0;
border: none;
}

body {
font-family: 'Poppins';
background: #222;
}

Expand All @@ -29,4 +29,11 @@ p#trafiklab a {
right: 0;
font-size: 3vh;
padding: 0.8vh 0.8vw;
}
}

.updated-at {
color: white;
position: absolute;
top: 10px;
right: 10px;
}
3 changes: 2 additions & 1 deletion public/css/metro.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ div#grouptwo {
}

div.skylttext {
padding-top: 20px;
height: 15vh;
}

Expand Down Expand Up @@ -80,4 +81,4 @@ div.marquee>div {
@keyframes marquee {
0% { left: 100%; }
100% { left: -400%; }
}
}
6 changes: 5 additions & 1 deletion views/bus.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
});
document.getElementById("bus4").innerHTML = fourhtml;
document.getElementById("busother").innerHTML = otherhtml;
document.querySelector("#last-update").innerText = new Date().toLocaleString("sv-SE", { timeZone: "Europe/Stockholm", day: "numeric", month: "short", hour: "2-digit", minute: "2-digit" });
});
</script>
</head>
Expand All @@ -30,5 +31,8 @@ <h3> 4:an </h3>
<h3> Other </h3>
</div>
</div>
<div class="updated-at">
Datan hämtades senast <span id="last-update"></span>
</div>
</body>
</html>
</html>
6 changes: 5 additions & 1 deletion views/metro.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
}
document.getElementById("g1bcontent").innerHTML = northbottom;
document.getElementById("g2bcontent").innerHTML = southbottom;
document.querySelector("#last-update").innerText = new Date().toLocaleString("sv-SE", { timeZone: "Europe/Stockholm", day: "numeric", month: "short", hour: "2-digit", minute: "2-digit" });
});
</script>
</head>
Expand Down Expand Up @@ -62,5 +63,8 @@
</div>
</div>
</div>
<div class="updated-at">
Datan hämtades senast <span id="last-update"></span>
</div>
</body>
</html>
</html>
6 changes: 5 additions & 1 deletion views/tram.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
tramhtml += `<div><span class='linenr'>${tram.id}</span><span class='dest'>${tram.destination}</span> <span class='time'>${tram.display}</span></div>`;
});
document.getElementById("tram").innerHTML = tramhtml;
document.querySelector("#last-update").innerText = new Date().toLocaleString("sv-SE", { timeZone: "Europe/Stockholm", day: "numeric", month: "short", hour: "2-digit", minute: "2-digit" });
});
</script>
</head>
Expand All @@ -28,5 +29,8 @@ <h3> Roslagsbanan </h3>
<div><span class='linenr'>42</span><span class='dest'> Täby Någonstans </span> <span class='time'> 42min </span></div>
<div><span class='linenr'>42</span><span class='dest'> Täby Någonstans </span> <span class='time'> 42min </span></div>
</div>
<div class="updated-at">
Datan hämtades senast <span id="last-update"></span>
</div>
</body>
</html>
</html>

0 comments on commit 0d83919

Please sign in to comment.