From 7f1dc1ac3f17005296993bd245fdb365fa1f483f Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Fri, 12 Jul 2024 12:20:36 +0100 Subject: [PATCH] Update and implement TimeBar, needs testing with NRCC messages present. --- src/lib/DevBanner.svelte | 4 ++-- src/lib/cards/Card.svelte | 4 ++-- src/lib/ldb/staff/staff-ldb.svelte | 11 +++++++---- src/lib/navigation/TimeBar.svelte | 14 ++++++++++---- src/lib/navigation/nav-ldb.svelte | 24 ------------------------ src/routes/test/+page.svelte | 2 +- src/routes/train/+page.svelte | 6 ++---- 7 files changed, 24 insertions(+), 41 deletions(-) diff --git a/src/lib/DevBanner.svelte b/src/lib/DevBanner.svelte index 96a5ac7..549ae60 100644 --- a/src/lib/DevBanner.svelte +++ b/src/lib/DevBanner.svelte @@ -3,8 +3,8 @@ \ No newline at end of file diff --git a/src/lib/navigation/nav-ldb.svelte b/src/lib/navigation/nav-ldb.svelte index dc05cee..629d352 100644 --- a/src/lib/navigation/nav-ldb.svelte +++ b/src/lib/navigation/nav-ldb.svelte @@ -8,22 +8,7 @@ ]; import { page } from "$app/stores"; import { IconHome } from "@tabler/icons-svelte"; - import { onMount } from "svelte"; - let currentTime: string = "00:00:00" - function updateTime() { - const now = new Date(); - const hours = now.getHours().toString().padStart(2, '0'); - const mins = now.getMinutes().toString().padStart(2, '0'); - const secs = now.getSeconds().toString().padStart(2, '0'); - currentTime = `${hours}:${mins}:${secs}` - } - - onMount(() => { - updateTime(); - const interval = setInterval(updateTime, 1000); - return () => clearInterval(interval); - }) @@ -107,12 +91,4 @@ margin-bottom: 3px; padding: 0; } - - .clock { - color: black; - font-size: 10px; - position: absolute; - bottom: 2px; - right: 10px; - } diff --git a/src/routes/test/+page.svelte b/src/routes/test/+page.svelte index d8dddb8..f5c9106 100644 --- a/src/routes/test/+page.svelte +++ b/src/routes/test/+page.svelte @@ -30,7 +30,7 @@ }
- + diff --git a/src/routes/train/+page.svelte b/src/routes/train/+page.svelte index 3d36738..a83991a 100644 --- a/src/routes/train/+page.svelte +++ b/src/routes/train/+page.svelte @@ -9,6 +9,7 @@ import TrainDetail from "$lib/train/train-detail.svelte"; import { getApiUrl } from "$lib/scripts/upstream"; import toast from "svelte-french-toast"; + import TimeBar from "$lib/navigation/TimeBar.svelte"; let title = "Timetable Results"; let id = ""; @@ -79,7 +80,7 @@
-
+ {#if error} @@ -100,9 +101,6 @@