From be73c285f5b91744b4507ea48f32b470e2b89957 Mon Sep 17 00:00:00 2001 From: Xylight Date: Thu, 9 Oct 2025 20:58:43 -0700 Subject: [PATCH] design: use exponential curve for transitions --- src/lib/app/util.svelte.ts | 9 +- src/lib/ui/layout/pages/Tabs.svelte | 1 + src/lib/ui/shared/button/Button.svelte | 2 + src/lib/ui/sidebar/SidebarButton.svelte | 8 +- src/routes/admin/+page.svelte | 2 +- src/routes/explore/communities/+page.ts | 2 +- src/routes/theme/+page.svelte | 124 ++++++++++++------------ 7 files changed, 78 insertions(+), 70 deletions(-) diff --git a/src/lib/app/util.svelte.ts b/src/lib/app/util.svelte.ts index 6b07e753..d0b2c90b 100644 --- a/src/lib/app/util.svelte.ts +++ b/src/lib/app/util.svelte.ts @@ -33,7 +33,9 @@ export const placeholders = { get: (type: 'url' | 'post' | 'body' | 'comment') => { switch (type) { case 'post': - return t.get('placeholders.title') + return Math.random() < 0.01 + ? 'A C E C* B* G D E E F G F E D C E' + : t.get('placeholders.title') case 'body': return t.get('placeholders.body') case 'comment': @@ -194,10 +196,7 @@ export const userLink = (person: Person, prefix: string = '') => /** * Basic types only, don't use for anything more than basic equality */ -export function recursiveEqual( - a: T, - b: T, -): boolean { +export function recursiveEqual(a: T, b: T): boolean { if (a === b) return true if (typeof a !== 'object' || typeof b !== 'object') return false diff --git a/src/lib/ui/layout/pages/Tabs.svelte b/src/lib/ui/layout/pages/Tabs.svelte index 844168ee..c14a158a 100644 --- a/src/lib/ui/layout/pages/Tabs.svelte +++ b/src/lib/ui/layout/pages/Tabs.svelte @@ -38,6 +38,7 @@ const currentSearch = new Set(url.searchParams.values()) const hrefSearch = new Set(href.searchParams.values()) // checks if there is any + // me on 2025/10/9: no shi buh const usePathname = !routes.some( (i) => new Set( diff --git a/src/lib/ui/shared/button/Button.svelte b/src/lib/ui/shared/button/Button.svelte index 8409fa8d..53b6a9e3 100644 --- a/src/lib/ui/shared/button/Button.svelte +++ b/src/lib/ui/shared/button/Button.svelte @@ -172,6 +172,8 @@ font-size: var(--text-sm); gap: calc(var(--spacing) * 1.5); + transition: 75ms cubic-bezier(0.075, 0.82, 0.165, 1); + @variant hover { cursor: pointer; } diff --git a/src/lib/ui/sidebar/SidebarButton.svelte b/src/lib/ui/sidebar/SidebarButton.svelte index 31197846..b197e038 100644 --- a/src/lib/ui/sidebar/SidebarButton.svelte +++ b/src/lib/ui/sidebar/SidebarButton.svelte @@ -14,7 +14,7 @@ } let { - href = '', + href, icon, class: clazz = '', customIcon, @@ -23,7 +23,11 @@ ...rest }: Props = $props() - let selected = $derived(page.url.pathname.startsWith(href)) + let selected = $derived( + page.url.pathname.startsWith( + href ?? 'The power of fluffy boys shines within you.', + ) ?? false, + ) - - - +
+ + + +
{/snippet}
@@ -208,11 +214,7 @@
{#each Object.entries(defaultColors) as [category, value] (category)} - +