add page transitions

This commit is contained in:
seriousm4x
2023-07-25 18:35:36 +02:00
parent a875613b76
commit da3f424019
3 changed files with 19 additions and 6 deletions

View File

@@ -0,0 +1,10 @@
<script lang="ts">
import { fly } from 'svelte/transition';
export let url: URL;
</script>
{#key url}
<div in:fly={{ y: 50, duration: 300 }}>
<slot />
</div>
{/key}

View File

@@ -6,6 +6,7 @@
import { pocketbase, backendUrl, devices } from '$lib/stores/pocketbase';
import { settingsPub } from '$lib/stores/settings';
import Navbar from '$lib/components/Navbar.svelte';
import Transition from '$lib/components/Transition.svelte';
import type { Device } from '$lib/types/device';
onMount(async () => {
@@ -68,6 +69,8 @@
<Navbar />
{/if}
<div class="container mx-auto p-2">
<slot />
</div>
<Transition url={$page.url}>
<div class="container mx-auto p-2 mb-4">
<slot />
</div>
</Transition>

View File

@@ -280,15 +280,15 @@
linux or
<span class="badge">curl</span> in general to make web requests.
</p>
<p class="my-2 font-bold">Example:</p>
<div class="alert text-sm bg-base-100 text-start">
<p class="my-2 font-bold">Examples:</p>
<div class="alert text-sm bg-base-100 text-start w-fit">
<div>
<span class="font-bold">Shutdown remote windows machine:</span>
<pre
class="break-words whitespace-pre-wrap">net rpc shutdown -I 192.168.1.13 -U "user%password"</pre>
</div>
</div>
<div class="alert text-sm my-2 bg-base-100 text-start">
<div class="alert text-sm my-2 bg-base-100 text-start w-fit">
<div>
<span class="font-bold">Shutdown remote linux machine:</span>
<pre