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 InputIsland from "$lib/islands/input-island-form.svelte";
|
|
|
|
import QuickLinkIsland from "$lib/islands/quick-link-island.svelte";
|
|
|
|
import Welcome from "$lib/overlays/welcome.svelte";
|
|
|
|
import { welcome } from "$lib/stores/welcome";
|
|
|
|
import { version, showWelcome } from "$lib/stores/version";
|
2024-06-23 11:21:45 +01:00
|
|
|
import { featureDetect } from "$lib/scripts/featureDetect";
|
2024-06-13 21:59:01 +01:00
|
|
|
import { onMount } from "svelte";
|
|
|
|
import toast from "svelte-french-toast";
|
2023-06-15 18:19:23 +01:00
|
|
|
|
2024-04-30 11:17:06 +01:00
|
|
|
const title = "OwlBoard";
|
|
|
|
const inputIslands = [
|
|
|
|
{
|
|
|
|
title: "Live Departure Boards",
|
|
|
|
action: "/ldb",
|
|
|
|
placeholder: "Enter CRS/TIPLOC",
|
2024-04-30 11:18:21 +01:00
|
|
|
queryName: "station",
|
2024-04-30 11:17:06 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: "Train Details & PIS",
|
|
|
|
action: "/train",
|
|
|
|
placeholder: "Enter Headcode",
|
2024-04-30 11:18:21 +01:00
|
|
|
queryName: "headcode",
|
|
|
|
},
|
2024-04-30 11:17:06 +01:00
|
|
|
];
|
2024-06-13 21:59:01 +01:00
|
|
|
|
2024-06-23 11:21:45 +01:00
|
|
|
onMount(async () => {
|
|
|
|
const featureSupport = featureDetect();
|
|
|
|
console.log(featureSupport);
|
2024-06-13 21:59:01 +01:00
|
|
|
|
2024-06-23 11:21:45 +01:00
|
|
|
if (!featureSupport.critical) {
|
|
|
|
toast.error("Your browser is missing critical features, OwlBoard might not work properly. Consider updating your browser.");
|
|
|
|
} else if (!featureSupport.nice) {
|
|
|
|
toast.error("Your browser is missing some features, OwlBoard may run slower or be missing some features.");
|
|
|
|
}
|
|
|
|
});
|
2023-06-12 19:16:39 +01:00
|
|
|
</script>
|
2023-06-12 21:50:47 +01:00
|
|
|
|
2024-04-30 11:17:06 +01:00
|
|
|
{#if showWelcome && ($welcome === "null" || !$welcome || parseInt($welcome.replace(/\./g, "")) < parseInt(version.replace(/\./g, "")))}
|
|
|
|
<Welcome />
|
2023-06-29 22:01:55 +01:00
|
|
|
{/if}
|
2023-06-14 11:02:46 +01:00
|
|
|
<Header {title} />
|
2023-06-15 18:19:23 +01:00
|
|
|
|
|
|
|
{#each inputIslands as variables}
|
2024-04-30 11:17:06 +01:00
|
|
|
<InputIsland {variables} />
|
2023-06-15 18:19:23 +01:00
|
|
|
{/each}
|
|
|
|
|
2023-06-15 21:32:14 +01:00
|
|
|
<QuickLinkIsland />
|
2023-06-13 13:38:59 +01:00
|
|
|
|
2023-07-07 11:27:28 +01:00
|
|
|
<Nav />
|