rowt/rot_app/src/routes/+page.svelte

48 lines
973 B
Svelte
Raw Normal View History

2023-06-16 21:35:15 +02:00
<script lang="ts">
import { loggedin } from '../store.js';
import welcome from '$lib/images/svelte-welcome.webp';
2023-06-16 20:11:42 +02:00
import welcome_fallback from '$lib/images/svelte-welcome.png';
2023-06-16 21:35:15 +02:00
import Login from './Login.svelte';
let isLoggedIn: Boolean;
loggedin.subscribe(value => {
isLoggedIn = value;
});
function login() {
loggedin.set(true);
}
function logout() {
loggedin.set(false);
}
2023-06-16 20:11:42 +02:00
</script>
<svelte:head>
2023-06-16 21:35:15 +02:00
<title>Ruderassistent - ASKÖ Ruderverein Donau Linz</title>
2023-06-16 20:11:42 +02:00
</svelte:head>
<section>
<h1>
<span class="welcome">
<picture>
<source srcset={welcome} type="image/webp" />
<img src={welcome_fallback} alt="Welcome" />
</picture>
</span>
</h1>
2023-06-16 21:35:15 +02:00
{#if isLoggedIn}
<p>Here comes the list</p>
<button on:click={logout} class="btn btn-primary">
Jetzt ausloggen
</button>
{:else}
<p>Login</p>
<button on:click={login} class="btn btn-primary">
Jetzt einloggen
</button>
{/if}
2023-06-16 20:11:42 +02:00
</section>