design: use exponential curve for transitions

This commit is contained in:
Xylight committed 2025-10-09 20:58:59 -07:00
1 parent 09f6d4808b
commit be73c285f5
7 files changed
+78 -70

No files matched your search

+4 -5
View File
@@ -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<T>(
a: T,
b: T,
): boolean {
export function recursiveEqual<T>(a: T, b: T): boolean {
if (a === b) return true
if (typeof a !== 'object' || typeof b !== 'object') return false
+1
View File
@@ -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(
+2
View File
@@ -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;
}
+6 -2
View File
@@ -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,
)
</script>
<Button
+1 -1
View File
@@ -1 +1 @@
buh
Where are you?
+1 -1
View File
@@ -5,7 +5,7 @@ export async function load({ fetch, parent }) {
const { page, query, sort, type, typeInstance } = await parent()
const feedData = await feed('/explore/communities', async (params) =>
query != ''
params.query != ''
? await client({ func: fetch, instanceURL: typeInstance }).search({
limit: 40,
page: params.page,
+63 -61
View File
@@ -29,6 +29,10 @@
let defaultColors = $derived(getDefaultColors())
</script>
<svelte:head>
<title>{$t('routes.theme.title')}</title>
</svelte:head>
{#if importing}
<Modal
bind:open={importing}
@@ -51,64 +55,66 @@
</Modal>
{/if}
<Header pageHeader>{$t('routes.theme.title')}
<Header pageHeader>
{$t('routes.theme.title')}
{#snippet extended()}
<div class="flex items-center gap-2">
<Button
onclick={() => {
importing = !importing
}}
rounding="pill"
disabled={themeData.current.id <= 0}
>
<Icon src={ArrowUpTray} size="16" mini />
{$t('settings.import')}
</Button>
<Button
onclick={() => {
navigator.clipboard.writeText(JSON.stringify(themeData.current.colors))
toast({ content: 'Copied theme to clipboard.' })
}}
rounding="pill"
>
<Icon src={ArrowDownTray} size="16" mini />
{$t('settings.export')}
</Button>
<Button
disabled={themeData.current.id <= 0}
onclick={() => {
modal({
actions: [
action({
content: $t('common.cancel'),
close: true,
}),
action({
action: () => {
themeData.current.colors = {
other: {},
primary: {},
zinc: {},
slate: {},
}
},
content: $t('settings.reset'),
close: true,
type: 'danger',
}),
],
title: $t('routes.theme.resetWarning.title'),
body: $t('routes.theme.resetWarning.description'),
})
}}
rounding="pill"
>
<Icon src={ArrowPath} size="16" mini />
{$t('settings.reset')}
</Button>
</div>
<div class="flex items-center gap-2">
<Button
onclick={() => {
importing = !importing
}}
rounding="pill"
disabled={themeData.current.id <= 0}
>
<Icon src={ArrowUpTray} size="16" mini />
{$t('settings.import')}
</Button>
<Button
onclick={() => {
navigator.clipboard.writeText(
JSON.stringify(themeData.current.colors),
)
toast({ content: 'Copied theme to clipboard.' })
}}
rounding="pill"
>
<Icon src={ArrowDownTray} size="16" mini />
{$t('settings.export')}
</Button>
<Button
disabled={themeData.current.id <= 0}
onclick={() => {
modal({
actions: [
action({
content: $t('common.cancel'),
close: true,
}),
action({
action: () => {
themeData.current.colors = {
other: {},
primary: {},
zinc: {},
slate: {},
}
},
content: $t('settings.reset'),
close: true,
type: 'danger',
}),
],
title: $t('routes.theme.resetWarning.title'),
body: $t('routes.theme.resetWarning.description'),
})
}}
rounding="pill"
>
<Icon src={ArrowPath} size="16" mini />
{$t('settings.reset')}
</Button>
</div>
{/snippet}
</Header>
<div class="flex flex-col gap-4 h-full">
@@ -208,11 +214,7 @@
</Material>
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 mt-4">
{#each Object.entries(defaultColors) as [category, value] (category)}
<Material
rounding="2xl"
color="uniform"
class="flex flex-col gap-2"
>
<Material rounding="2xl" color="uniform" class="flex flex-col gap-2">
<Header
class="capitalize"
size="sm"