From 26e40c5bf66604394ec633d468b3e9153dd326d7 Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Thu, 30 Apr 2026 01:26:29 +0100 Subject: [PATCH] Add loading state (initial) Add rollover actions on train service Add some additional toc styles --- src/lib/components/ui/Loading.svelte | 59 +++++++++++++++++++++++ src/lib/components/ui/TocStyle.svelte | 20 ++++++++ src/lib/components/ui/TrainService.svelte | 7 +++ src/routes/+layout.svelte | 10 +++- src/routes/trains/+page.svelte | 3 ++ 5 files changed, 97 insertions(+), 2 deletions(-) create mode 100644 src/lib/components/ui/Loading.svelte diff --git a/src/lib/components/ui/Loading.svelte b/src/lib/components/ui/Loading.svelte new file mode 100644 index 0000000..a16cb73 --- /dev/null +++ b/src/lib/components/ui/Loading.svelte @@ -0,0 +1,59 @@ + + +
+
+
+
+

{message}

+
+ + \ No newline at end of file diff --git a/src/lib/components/ui/TocStyle.svelte b/src/lib/components/ui/TocStyle.svelte index f6eaf66..c390afc 100644 --- a/src/lib/components/ui/TocStyle.svelte +++ b/src/lib/components/ui/TocStyle.svelte @@ -22,8 +22,22 @@ justify-content: center; padding: 2px 8px; font-weight: 800; + font-size: 1.1rem; background-color: #333; color: #fff; + font-family:'Courier New', Courier, monospace; + } + + .AW { + /* Transport for Wales */ + background: red; + color: white; + } + + .LM { + /* West Midlands Trains */ + background: rgb(176, 115, 1); + color: white; } .GW { @@ -44,6 +58,12 @@ color: #ffffff; } + .GN { + /* Great Northern */ + background-color: fuchsia; + color: rgb(229, 229, 229); + } + .SW { /* South Western Railway */ background-color: #2a3389; diff --git a/src/lib/components/ui/TrainService.svelte b/src/lib/components/ui/TrainService.svelte index cd7a44e..de2fb8e 100644 --- a/src/lib/components/ui/TrainService.svelte +++ b/src/lib/components/ui/TrainService.svelte @@ -30,6 +30,7 @@ import { formatUkTime } from '$lib/utils/time';
{service.dt}
+ @@ -42,6 +43,12 @@ import { formatUkTime } from '$lib/utils/time'; box-shadow: var(--shadow-std); overflow: hidden; font-family: 'URW Gothic', sans-serif; + transition: 0.2s all; + filter: brightness(1.1); + } + + .train-service:hover { + filter:brightness(1.5); } .summary { diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 6be2492..ced6422 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -2,10 +2,11 @@ import { page } from '$app/state'; import { slide, fade } from 'svelte/transition'; import { onMount } from 'svelte'; - + import { navigating } from '$app/state'; import { LOCATIONS } from '$lib/locations-object.svelte'; import { nearestStationsState } from '$lib/geohash.svelte'; + import Loading from '$lib/components/ui/Loading.svelte'; import TimezoneWarning from '$lib/components/ui/TimezoneWarning.svelte'; import '$lib/global.css'; @@ -81,7 +82,12 @@
- {@render children()} + + {#if navigating && navigating.to} + + {:else} + {@render children()} + {/if}