owlboard-svelte/src/routes/+page.svelte

49 lines
1.6 KiB
Svelte
Raw Normal View History

2024-06-13 21:59:01 +01:00
<script lang="ts">
2024-04-30 11:17:06 +01:00
import Header from "$lib/navigation/header.svelte";
import Nav from "$lib/navigation/nav.svelte";
import { featureDetect } from "$lib/scripts/featureDetect";
2024-06-13 21:59:01 +01:00
import { onMount } from "svelte";
import toast from "svelte-french-toast";
import type { LookupCardConfig } from "$lib/cards/Card.types";
import LookupCard from "$lib/cards/LookupCard.svelte";
import NearToMeCard from "$lib/cards/NearToMeCard.svelte";
import QuickLinkCard from "$lib/cards/QuickLinkCard.svelte";
2024-04-30 11:17:06 +01:00
const title = "OwlBoard";
const lookupCards: LookupCardConfig[] = [
2024-04-30 11:17:06 +01:00
{
title: "Live Arr/Dep Boards",
helpText: "",
formAction: "/ldb",
placeholder: "enter crs/tiploc",
maxLen: 7,
2024-07-12 15:29:55 +01:00
fieldName: "station",
2024-04-30 11:17:06 +01:00
},
{
title: "Timetable & PIS",
helpText: "",
formAction: "/train",
placeholder: "enter headcode",
maxLen: 4,
2024-07-12 15:29:55 +01:00
fieldName: "headcode",
2024-04-30 11:18:21 +01:00
},
2024-04-30 11:17:06 +01:00
];
2024-06-13 21:59:01 +01:00
onMount(async () => {
const featureSupport = featureDetect();
if (!featureSupport.critical) {
toast.error("Your browser is missing critical features, OwlBoard might not work properly. See `Menu > Statistics` for more information.");
} else if (!featureSupport.nice) {
toast.error("Your browser is missing some features, see `Menu > Statistics` for more information.");
}
});
2023-06-12 19:16:39 +01:00
</script>
2023-06-12 21:50:47 +01:00
2023-06-14 11:02:46 +01:00
<Header {title} />
{#each lookupCards as config}
<LookupCard {config} />
2023-06-15 18:19:23 +01:00
{/each}
<NearToMeCard />
<QuickLinkCard />
2023-06-13 13:38:59 +01:00
2023-07-07 11:27:28 +01:00
<Nav />