55 lines
1.4 KiB
Svelte
Raw Normal View History

2023-06-16 11:59:17 +01:00
<script>
2024-04-30 11:17:06 +01:00
import Header from "$lib/navigation/header.svelte";
import Nav from "$lib/navigation/nav.svelte";
import QlSet from "$lib/islands/quick-link-set-island.svelte";
2024-06-30 11:13:32 +01:00
import Island from "$lib/islands/island.svelte";
import { location } from "$lib/stores/location";
import { getCurrentLocation } from "$lib/scripts/getLocation";
2024-07-01 16:07:08 +01:00
import toast from "svelte-french-toast";
2024-04-30 11:17:06 +01:00
const title = "Settings";
2024-06-30 11:13:32 +01:00
$: if ($location) {
2024-07-02 20:16:57 +01:00
getCurrentLocation();
2024-06-30 11:13:32 +01:00
}
2024-07-01 16:07:08 +01:00
function locationToast() {
2024-07-02 20:16:57 +01:00
toast("Settings updated");
2024-07-01 16:07:08 +01:00
}
2023-06-16 11:59:17 +01:00
</script>
2023-07-07 11:27:28 +01:00
<svelte:head>
<meta name="robots" content="noindex">
</svelte:head>
2023-07-07 11:27:28 +01:00
<Header {title} />
<QlSet />
2024-07-02 20:16:57 +01:00
<Island variables={{ title: "Location" }}>
2024-06-30 11:13:32 +01:00
<p>Use your location to quickly check departure boards near you</p>
<div class="checkbox-container">
<label for="location_enable">Enabled</label>
2024-07-02 20:16:57 +01:00
<input id="location_enable" type="checkbox" bind:checked={$location} on:click={locationToast} />
2024-06-30 11:13:32 +01:00
</div>
</Island>
2023-07-07 11:27:28 +01:00
<Nav />
2024-06-30 11:13:32 +01:00
<style>
.checkbox-container {
display: inline-flex;
align-items: center;
margin: auto;
}
.checkbox-container input[type="checkbox"] {
margin: 0;
height: 25px;
width: 25px;
}
.checkbox-container label {
margin-left: 0;
margin-right: 25px;
font-weight: 800;
}
</style>