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
+25 -17

No files matched your search

+4 -5
View File
@@ -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
+1
View File
@@ -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(
+2
View File
@@ -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;
} }
+6 -2
View File
@@ -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
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 { 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,
+10 -8
View File
@@ -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,10 +55,10 @@
</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={() => {
@@ -68,7 +72,9 @@
</Button> </Button>
<Button <Button
onclick={() => { onclick={() => {
navigator.clipboard.writeText(JSON.stringify(themeData.current.colors)) navigator.clipboard.writeText(
JSON.stringify(themeData.current.colors),
)
toast({ content: 'Copied theme to clipboard.' }) toast({ content: 'Copied theme to clipboard.' })
}} }}
rounding="pill" rounding="pill"
@@ -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"