change frontpage image and toast animation
This commit is contained in:
@ -8,6 +8,8 @@
|
||||
import Icon from '../ui/Icon.svelte';
|
||||
import Link from '../ui/Link.svelte';
|
||||
|
||||
import vaultDoorSvg from '../assets/vault_door.svg?raw';
|
||||
|
||||
|
||||
onMount(async () => {
|
||||
// will block until a request comes in
|
||||
@ -18,24 +20,31 @@
|
||||
</script>
|
||||
|
||||
|
||||
<Nav />
|
||||
<Nav position="fixed">
|
||||
<h2 slot="title" class="text-3xl font-bold">Creddy</h2>
|
||||
</Nav>
|
||||
|
||||
<div class="flex flex-col h-screen items-center justify-center p-4 space-y-4">
|
||||
{#await invoke('get_session_status') then status}
|
||||
{#if status === 'locked'}
|
||||
<img src="/static/padlock-closed.svg" alt="A locked padlock" class="w-32" />
|
||||
<!-- <img src={closedPadlockUrl} alt="A locked padlock" class="w-32" /> -->
|
||||
|
||||
{@html vaultDoorSvg}
|
||||
|
||||
<h2 class="text-2xl font-bold">Creddy is locked</h2>
|
||||
<Link target="Unlock">
|
||||
<button class="btn btn-primary">Unlock</button>
|
||||
<Link target="Unlock" class="w-64">
|
||||
<button class="btn btn-primary w-full">Unlock</button>
|
||||
</Link>
|
||||
|
||||
{:else if status === 'unlocked'}
|
||||
<img src="/static/padlock-open.svg" alt="An unlocked padlock" class="w-24" />
|
||||
{@html vaultDoorSvg}
|
||||
<h2 class="text-2xl font-bold">Waiting for requests</h2>
|
||||
|
||||
{:else if status === 'empty'}
|
||||
<Link target="EnterCredentials">
|
||||
<button class="btn btn-primary">Enter Credentials</button>
|
||||
{@html vaultDoorSvg}
|
||||
<h2 class="text-2xl font-bold">No credentials found</h2>
|
||||
<Link target="EnterCredentials" class="w-64">
|
||||
<button class="btn btn-primary w-full">Enter Credentials</button>
|
||||
</Link>
|
||||
{/if}
|
||||
{/await}
|
||||
|
@ -7,6 +7,9 @@
|
||||
import ErrorAlert from '../ui/ErrorAlert.svelte';
|
||||
import { Setting, ToggleSetting, NumericSetting } from '../ui/settings';
|
||||
|
||||
import { fly } from 'svelte/transition';
|
||||
import { backInOut } from 'svelte/easing';
|
||||
|
||||
|
||||
let error = null;
|
||||
async function save() {
|
||||
@ -21,11 +24,13 @@
|
||||
</script>
|
||||
|
||||
|
||||
<Nav />
|
||||
<Nav>
|
||||
<h2 slot="title" class="text-2xl font-bold">Settings</h2>
|
||||
</Nav>
|
||||
|
||||
{#await invoke('get_config') then config}
|
||||
<div class="max-w-md mx-auto mt-1.5 p-4">
|
||||
<h2 class="text-2xl font-bold text-center">Settings</h2>
|
||||
<!-- <h2 class="text-2xl font-bold text-center">Settings</h2> -->
|
||||
|
||||
<ToggleSetting title="Start on login" bind:value={$appState.config.start_on_login} on:update={save}>
|
||||
<svelte:fragment slot="description">
|
||||
@ -66,8 +71,8 @@
|
||||
{/await}
|
||||
|
||||
{#if error}
|
||||
<div class="toast">
|
||||
<div class="alert alert-error">
|
||||
<div transition:fly={{y: 100, easing: backInOut, duration: 400}} class="toast">
|
||||
<div class="alert alert-error no-animation">
|
||||
<div>
|
||||
<span>{error}</span>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user