1
0
mirror of https://github.com/pocket-id/pocket-id.git synced 2026-02-11 03:39:17 +00:00

fix: only animate login background on initial page load

This commit is contained in:
Elias Schneider
2025-10-24 10:39:52 +02:00
parent 9fc45930a8
commit b356cef766
7 changed files with 16 additions and 15 deletions

View File

@@ -1,23 +1,29 @@
<script lang="ts">
import { afterNavigate } from '$app/navigation';
import { page } from '$app/state';
import { m } from '$lib/paraglide/messages';
import appConfigStore from '$lib/stores/application-configuration-store';
import { cachedBackgroundImage } from '$lib/utils/cached-image-util';
import { cn } from '$lib/utils/style';
import type { Snippet } from 'svelte';
import { type Snippet } from 'svelte';
import { MediaQuery } from 'svelte/reactivity';
import * as Card from './ui/card';
let {
children,
showAlternativeSignInMethodButton = false,
animate = false
showAlternativeSignInMethodButton = false
}: {
children: Snippet;
showAlternativeSignInMethodButton?: boolean;
animate?: boolean;
} = $props();
let isInitialLoad = $state(false);
let animate = $derived(isInitialLoad && !$appConfigStore.disableAnimations);
afterNavigate((e) => {
isInitialLoad = !e?.from?.url;
});
const isDesktop = new MediaQuery('min-width: 1024px');
let alternativeSignInButton = $state({
href: '/login/alternative',