diff --git a/src/lib/components/ui/Button.svelte b/src/lib/components/ui/Button.svelte index ae708f1..4240fb8 100644 --- a/src/lib/components/ui/Button.svelte +++ b/src/lib/components/ui/Button.svelte @@ -39,7 +39,7 @@ align-items: center; justify-content: center; min-height: 48px; - min-width: 48px; + min-width: 98px; appearance: none; background: transparent; border: none; diff --git a/src/lib/components/ui/NoResults.svelte b/src/lib/components/ui/NoResults.svelte new file mode 100644 index 0000000..29621d3 --- /dev/null +++ b/src/lib/components/ui/NoResults.svelte @@ -0,0 +1,55 @@ + + +
+ +

{title}

+

{message}

+
+ +
+
+ + \ No newline at end of file diff --git a/src/lib/components/ui/TocStyle.svelte b/src/lib/components/ui/TocStyle.svelte index 1b4c7df..f6eaf66 100644 --- a/src/lib/components/ui/TocStyle.svelte +++ b/src/lib/components/ui/TocStyle.svelte @@ -8,6 +8,8 @@ let code = $derived(toc.toUpperCase()); + +
{code}
diff --git a/src/lib/components/ui/TrainService.svelte b/src/lib/components/ui/TrainService.svelte new file mode 100644 index 0000000..cd7a44e --- /dev/null +++ b/src/lib/components/ui/TrainService.svelte @@ -0,0 +1,90 @@ + + +
+ +
+ + \ No newline at end of file diff --git a/src/lib/components/ui/cards/HeadcodeSearchCard.svelte b/src/lib/components/ui/cards/HeadcodeSearchCard.svelte index e6b20f1..657f27e 100644 --- a/src/lib/components/ui/cards/HeadcodeSearchCard.svelte +++ b/src/lib/components/ui/cards/HeadcodeSearchCard.svelte @@ -37,7 +37,7 @@ text-align: center; width: 90%; margin: auto; - padding: 10px 0 10px 0; + padding: 10px 0 0 0; display: flex; flex-direction: column; gap: 0.75rem; diff --git a/src/lib/components/ui/cards/NearbyStationsCard.svelte b/src/lib/components/ui/cards/NearbyStationsCard.svelte index 7aa14f0..40796e6 100644 --- a/src/lib/components/ui/cards/NearbyStationsCard.svelte +++ b/src/lib/components/ui/cards/NearbyStationsCard.svelte @@ -44,7 +44,7 @@ width: 90%; min-height: 98px; margin: auto; - padding: 10px 0 10px 0; + padding: 10px 0 0 0; } .stations-flex { diff --git a/src/lib/utils/time.ts b/src/lib/utils/time.ts new file mode 100644 index 0000000..becb137 --- /dev/null +++ b/src/lib/utils/time.ts @@ -0,0 +1,17 @@ +/** + * Converts ISO/JSON time to UK-formatted HH:MM string. + * Ensures Europe/London timezone irrespective of browser timezone. + */ +export function formatUkTime(dateStr: string | Date | undefined): string { + if (!dateStr) return '--:--'; + const date = typeof dateStr === 'string' ? new Date(dateStr): dateStr; + + if (isNaN(date.getTime())) return '--:--'; + + return date.toLocaleTimeString('en-GB', { + hour: '2-digit', + minute: '2-digit', + hour12: false, + timeZone: 'Europe/London', + }); +} \ No newline at end of file diff --git a/src/routes/pis/+page.svelte b/src/routes/pis/+page.svelte index e42d463..de1d3c3 100644 --- a/src/routes/pis/+page.svelte +++ b/src/routes/pis/+page.svelte @@ -1,4 +1,5 @@ -
{JSON.stringify(data.results, null, 1)}
+ +{#if data.results.length === 0} + +{:else} +
+ {#each data.results as service (service.r)} + + {/each} +
+{/if} +