design: use exponential curve for transitions
This commit is contained in:
7 files changed
+78
-70
No files matched your search
@@ -33,7 +33,9 @@ export const placeholders = {
|
|||||||
get: (type: 'url' | 'post' | 'body' | 'comment') => {
|
get: (type: 'url' | 'post' | 'body' | 'comment') => {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'post':
|
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':
|
case 'body':
|
||||||
return t.get('placeholders.body')
|
return t.get('placeholders.body')
|
||||||
case 'comment':
|
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
|
* Basic types only, don't use for anything more than basic equality
|
||||||
*/
|
*/
|
||||||
export function recursiveEqual<T>(
|
export function recursiveEqual<T>(a: T, b: T): boolean {
|
||||||
a: T,
|
|
||||||
b: T,
|
|
||||||
): boolean {
|
|
||||||
if (a === b) return true
|
if (a === b) return true
|
||||||
if (typeof a !== 'object' || typeof b !== 'object') return false
|
if (typeof a !== 'object' || typeof b !== 'object') return false
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,7 @@
|
|||||||
const currentSearch = new Set(url.searchParams.values())
|
const currentSearch = new Set(url.searchParams.values())
|
||||||
const hrefSearch = new Set(href.searchParams.values())
|
const hrefSearch = new Set(href.searchParams.values())
|
||||||
// checks if there is any
|
// checks if there is any
|
||||||
|
// me on 2025/10/9: no shi buh
|
||||||
const usePathname = !routes.some(
|
const usePathname = !routes.some(
|
||||||
(i) =>
|
(i) =>
|
||||||
new Set(
|
new Set(
|
||||||
|
|||||||
@@ -172,6 +172,8 @@
|
|||||||
font-size: var(--text-sm);
|
font-size: var(--text-sm);
|
||||||
gap: calc(var(--spacing) * 1.5);
|
gap: calc(var(--spacing) * 1.5);
|
||||||
|
|
||||||
|
transition: 75ms cubic-bezier(0.075, 0.82, 0.165, 1);
|
||||||
|
|
||||||
@variant hover {
|
@variant hover {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
let {
|
let {
|
||||||
href = '',
|
href,
|
||||||
icon,
|
icon,
|
||||||
class: clazz = '',
|
class: clazz = '',
|
||||||
customIcon,
|
customIcon,
|
||||||
@@ -23,7 +23,11 @@
|
|||||||
...rest
|
...rest
|
||||||
}: Props = $props()
|
}: 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>
|
</script>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
buh
|
Where are you?
|
||||||
@@ -5,7 +5,7 @@ export async function load({ fetch, parent }) {
|
|||||||
const { page, query, sort, type, typeInstance } = await parent()
|
const { page, query, sort, type, typeInstance } = await parent()
|
||||||
|
|
||||||
const feedData = await feed('/explore/communities', async (params) =>
|
const feedData = await feed('/explore/communities', async (params) =>
|
||||||
query != ''
|
params.query != ''
|
||||||
? await client({ func: fetch, instanceURL: typeInstance }).search({
|
? await client({ func: fetch, instanceURL: typeInstance }).search({
|
||||||
limit: 40,
|
limit: 40,
|
||||||
page: params.page,
|
page: params.page,
|
||||||
|
|||||||
@@ -29,6 +29,10 @@
|
|||||||
let defaultColors = $derived(getDefaultColors())
|
let defaultColors = $derived(getDefaultColors())
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<svelte:head>
|
||||||
|
<title>{$t('routes.theme.title')}</title>
|
||||||
|
</svelte:head>
|
||||||
|
|
||||||
{#if importing}
|
{#if importing}
|
||||||
<Modal
|
<Modal
|
||||||
bind:open={importing}
|
bind:open={importing}
|
||||||
@@ -51,64 +55,66 @@
|
|||||||
</Modal>
|
</Modal>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<Header pageHeader>{$t('routes.theme.title')}
|
<Header pageHeader>
|
||||||
|
{$t('routes.theme.title')}
|
||||||
|
|
||||||
{#snippet extended()}
|
{#snippet extended()}
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
<div class="flex items-center gap-2">
|
<Button
|
||||||
<Button
|
onclick={() => {
|
||||||
onclick={() => {
|
importing = !importing
|
||||||
importing = !importing
|
}}
|
||||||
}}
|
rounding="pill"
|
||||||
rounding="pill"
|
disabled={themeData.current.id <= 0}
|
||||||
disabled={themeData.current.id <= 0}
|
>
|
||||||
>
|
<Icon src={ArrowUpTray} size="16" mini />
|
||||||
<Icon src={ArrowUpTray} size="16" mini />
|
{$t('settings.import')}
|
||||||
{$t('settings.import')}
|
</Button>
|
||||||
</Button>
|
<Button
|
||||||
<Button
|
onclick={() => {
|
||||||
onclick={() => {
|
navigator.clipboard.writeText(
|
||||||
navigator.clipboard.writeText(JSON.stringify(themeData.current.colors))
|
JSON.stringify(themeData.current.colors),
|
||||||
toast({ content: 'Copied theme to clipboard.' })
|
)
|
||||||
}}
|
toast({ content: 'Copied theme to clipboard.' })
|
||||||
rounding="pill"
|
}}
|
||||||
>
|
rounding="pill"
|
||||||
<Icon src={ArrowDownTray} size="16" mini />
|
>
|
||||||
{$t('settings.export')}
|
<Icon src={ArrowDownTray} size="16" mini />
|
||||||
</Button>
|
{$t('settings.export')}
|
||||||
<Button
|
</Button>
|
||||||
disabled={themeData.current.id <= 0}
|
<Button
|
||||||
onclick={() => {
|
disabled={themeData.current.id <= 0}
|
||||||
modal({
|
onclick={() => {
|
||||||
actions: [
|
modal({
|
||||||
action({
|
actions: [
|
||||||
content: $t('common.cancel'),
|
action({
|
||||||
close: true,
|
content: $t('common.cancel'),
|
||||||
}),
|
close: true,
|
||||||
action({
|
}),
|
||||||
action: () => {
|
action({
|
||||||
themeData.current.colors = {
|
action: () => {
|
||||||
other: {},
|
themeData.current.colors = {
|
||||||
primary: {},
|
other: {},
|
||||||
zinc: {},
|
primary: {},
|
||||||
slate: {},
|
zinc: {},
|
||||||
}
|
slate: {},
|
||||||
},
|
}
|
||||||
content: $t('settings.reset'),
|
},
|
||||||
close: true,
|
content: $t('settings.reset'),
|
||||||
type: 'danger',
|
close: true,
|
||||||
}),
|
type: 'danger',
|
||||||
],
|
}),
|
||||||
title: $t('routes.theme.resetWarning.title'),
|
],
|
||||||
body: $t('routes.theme.resetWarning.description'),
|
title: $t('routes.theme.resetWarning.title'),
|
||||||
})
|
body: $t('routes.theme.resetWarning.description'),
|
||||||
}}
|
})
|
||||||
rounding="pill"
|
}}
|
||||||
>
|
rounding="pill"
|
||||||
<Icon src={ArrowPath} size="16" mini />
|
>
|
||||||
{$t('settings.reset')}
|
<Icon src={ArrowPath} size="16" mini />
|
||||||
</Button>
|
{$t('settings.reset')}
|
||||||
</div>
|
</Button>
|
||||||
|
</div>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
</Header>
|
</Header>
|
||||||
<div class="flex flex-col gap-4 h-full">
|
<div class="flex flex-col gap-4 h-full">
|
||||||
@@ -208,11 +214,7 @@
|
|||||||
</Material>
|
</Material>
|
||||||
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 mt-4">
|
<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)}
|
{#each Object.entries(defaultColors) as [category, value] (category)}
|
||||||
<Material
|
<Material rounding="2xl" color="uniform" class="flex flex-col gap-2">
|
||||||
rounding="2xl"
|
|
||||||
color="uniform"
|
|
||||||
class="flex flex-col gap-2"
|
|
||||||
>
|
|
||||||
<Header
|
<Header
|
||||||
class="capitalize"
|
class="capitalize"
|
||||||
size="sm"
|
size="sm"
|
||||||
|
|||||||
Reference in new issue
Block a user