1
0
mirror of https://github.com/pocket-id/pocket-id.git synced 2026-02-15 22:41:11 +00:00

feat: disable animations setting toggle (#442)

Co-authored-by: Elias Schneider <login@eliasschneider.com>
This commit is contained in:
Kyle Mendell
2025-04-15 14:28:10 -05:00
committed by GitHub
parent d9dd67c51f
commit b45cf68295
11 changed files with 34 additions and 12 deletions

View File

@@ -2,7 +2,9 @@
import { page } from '$app/state';
import FadeWrapper from '$lib/components/fade-wrapper.svelte';
import { m } from '$lib/paraglide/messages';
import appConfigStore from '$lib/stores/application-configuration-store';
import userStore from '$lib/stores/user-store';
import { cn } from '$lib/utils/style';
import { LucideExternalLink, LucideSettings } from 'lucide-svelte';
import type { Snippet } from 'svelte';
import { fade, fly } from 'svelte/transition';
@@ -20,7 +22,7 @@
const links = [
{ href: '/settings/account', label: m.my_account() },
{ href: '/settings/audit-log', label: m.audit_log() },
{ href: '/settings/audit-log', label: m.audit_log() }
];
const adminLinks = [
@@ -54,11 +56,12 @@
{#each links as { href, label }, i}
<a
{href}
class={`animate-fade-in ${
class={cn(
!$appConfigStore.disableAnimations && 'animate-fade-in',
page.url.pathname.startsWith(href)
? 'text-primary bg-card rounded-md px-3 py-1.5 font-medium shadow-sm transition-all'
: 'hover:text-foreground hover:bg-muted/70 rounded-md px-3 py-1.5 transition-all hover:-translate-y-[2px] hover:shadow-sm'
}`}
)}
style={`animation-delay: ${150 + i * 75}ms;`}
>
{label}