design: consistency improvements

This commit is contained in:
James Xylight committed 2025-02-22 12:53:39 -08:00
1 parent a2f62cceb1
commit 176ffd9b46
8 files changed
+51 -45

No files matched your search

+13 -6
View File
@@ -22,6 +22,7 @@
import { settings } from '$lib/settings.svelte' import { settings } from '$lib/settings.svelte'
import { optimizeImageURL } from './post/helpers' import { optimizeImageURL } from './post/helpers'
import Link from '../input/Link.svelte' import Link from '../input/Link.svelte'
import EndPlaceholder from '../ui/EndPlaceholder.svelte'
interface Props { interface Props {
site: SiteView site: SiteView
@@ -76,9 +77,11 @@
<hr class="border-slate-200 dark:border-zinc-900 my-1" /> <hr class="border-slate-200 dark:border-zinc-900 my-1" />
<Expandable bind:open={settings.expand.about}> <Expandable bind:open={settings.expand.about}>
{#snippet title()} {#snippet title()}
<span class="flex items-center gap-1 py-1 px-2"> <span class="flex items-center gap-1 py-1 px-2 w-full">
<Icon src={InformationCircle} size="16" mini />
{$t('cards.site.about')} {$t('cards.site.about')}
<hr
class="w-full flex-1 ml-1 border-slate-200 dark:border-zinc-800"
/>
</span> </span>
{/snippet} {/snippet}
<Markdown source={site.site.description} /> <Markdown source={site.site.description} />
@@ -89,9 +92,11 @@
<hr class="border-slate-200 dark:border-zinc-900 my-1" /> <hr class="border-slate-200 dark:border-zinc-900 my-1" />
<Expandable bind:open={settings.expand.stats}> <Expandable bind:open={settings.expand.stats}>
{#snippet title()} {#snippet title()}
<span class="flex items-center gap-1 py-1 px-2"> <span class="flex items-center gap-1 py-1 px-2 w-full">
<Icon src={ChartBar} size="16" mini />
{$t('cards.site.stats')} {$t('cards.site.stats')}
<hr
class="w-full flex-1 ml-1 border-slate-200 dark:border-zinc-800"
/>
</span> </span>
{/snippet} {/snippet}
<div class="flex flex-row gap-4 flex-wrap"> <div class="flex flex-row gap-4 flex-wrap">
@@ -117,9 +122,11 @@
<hr class="border-slate-200 dark:border-zinc-900 my-1" /> <hr class="border-slate-200 dark:border-zinc-900 my-1" />
<Expandable bind:open={settings.expand.team}> <Expandable bind:open={settings.expand.team}>
{#snippet title()} {#snippet title()}
<span class="flex items-center gap-1 py-1 px-2"> <span class="flex items-center gap-1 py-1 px-2 w-full">
<Icon src={UserGroup} size="16" mini />
{$t('cards.site.admins')} {$t('cards.site.admins')}
<hr
class="w-full flex-1 ml-1 border-slate-200 dark:border-zinc-800"
/>
</span> </span>
{/snippet} {/snippet}
<ItemList <ItemList
@@ -172,9 +172,11 @@
<hr class="border-slate-200 dark:border-zinc-900 my-1" /> <hr class="border-slate-200 dark:border-zinc-900 my-1" />
<Expandable bind:open={settings.expand.about} class="!pt-0"> <Expandable bind:open={settings.expand.about} class="!pt-0">
{#snippet title()} {#snippet title()}
<span class="py-1 px-1 flex gap-1 items-center"> <span class="py-1 px-1 flex gap-1 items-center w-full">
<Icon src={InformationCircle} size="15" mini />
{$t('cards.site.about')} {$t('cards.site.about')}
<hr
class="w-full flex-1 ml-1 border-slate-200 dark:border-zinc-800"
/>
</span> </span>
{/snippet} {/snippet}
<Markdown source={community_view.community.description} /> <Markdown source={community_view.community.description} />
@@ -183,9 +185,11 @@
<hr class="border-slate-200 dark:border-zinc-900 my-1" /> <hr class="border-slate-200 dark:border-zinc-900 my-1" />
<Expandable bind:open={settings.expand.stats}> <Expandable bind:open={settings.expand.stats}>
{#snippet title()} {#snippet title()}
<span class="py-1 px-1 flex gap-1 items-center"> <span class="py-1 px-1 flex gap-1 items-center w-full">
<Icon src={ChartBar} size="15" mini />
{$t('cards.site.stats')} {$t('cards.site.stats')}
<hr
class="w-full flex-1 ml-1 border-slate-200 dark:border-zinc-800"
/>
</span> </span>
{/snippet} {/snippet}
<div class="flex flex-row gap-4 flex-wrap"> <div class="flex flex-row gap-4 flex-wrap">
@@ -206,9 +210,12 @@
<hr class="border-slate-200 dark:border-zinc-900 my-1" /> <hr class="border-slate-200 dark:border-zinc-900 my-1" />
<Expandable bind:open={settings.expand.team}> <Expandable bind:open={settings.expand.team}>
{#snippet title()} {#snippet title()}
<span class="py-1 px-1 flex gap-1 items-center"> <span class="py-1 px-1 flex gap-1 items-center w-full">
<ShieldIcon width={15} filled />
{$t('cards.community.moderators')} {$t('cards.community.moderators')}
<hr
class="w-full flex-1 ml-1 border-slate-200 dark:border-zinc-800"
/>
</span> </span>
{/snippet} {/snippet}
<ItemList <ItemList
@@ -231,11 +238,12 @@
disabled={loading.subscribing} disabled={loading.subscribing}
loading={loading.subscribing} loading={loading.subscribing}
size="md" size="md"
rounding="xl"
color={community_view.subscribed == 'Subscribed' color={community_view.subscribed == 'Subscribed'
? 'secondary' ? 'secondary'
: 'primary'} : 'primary'}
onclick={subscribe} onclick={subscribe}
class="flex-1 relative z-[inherit]" class="px-5 relative z-[inherit]"
> >
{#snippet prefix()} {#snippet prefix()}
<Icon <Icon
@@ -265,7 +273,7 @@
{/if} {/if}
<Menu placement="top-end"> <Menu placement="top-end">
{#snippet target()} {#snippet target()}
<Button size="square-md" class="ml-auto"> <Button size="square-md">
{#snippet prefix()} {#snippet prefix()}
<Icon src={EllipsisHorizontal} size="16" mini /> <Icon src={EllipsisHorizontal} size="16" mini />
{/snippet} {/snippet}
+4 -6
View File
@@ -50,9 +50,7 @@
> >
{@render children?.()} {@render children?.()}
<div <div
class="fixed lg:sticky bottom-0 {dockVisible class="fixed bottom-0 {dockVisible ? '' : 'max-lg:-bottom-24'} lg:top-0
? ''
: 'max-lg:-bottom-24'} lg:top-0
max-w-3xl p-4 left-1/2 -translate-x-1/2 lg:max-w-full lg:p-0 lg:left-0 lg:translate-x-0 max-w-3xl p-4 left-1/2 -translate-x-1/2 lg:max-w-full lg:p-0 lg:left-0 lg:translate-x-0
w-full z-50 pointer-events-none" w-full z-50 pointer-events-none"
style="grid-area: navbar; style="grid-area: navbar;
@@ -71,16 +69,16 @@
> >
{@render sidebar?.({ {@render sidebar?.({
class: `hidden md:flex sticky top-0 left-0 h-max bg-slate-50 dark:bg-zinc-950 class: `hidden md:flex sticky top-0 left-0 h-max bg-slate-50 dark:bg-zinc-950
z-40 lg:top-16`, z-40 lg:!pt-20`,
style: 'grid-area: sidebar; width: 100% !important;', style: 'grid-area: sidebar; width: 100% !important;',
})} })}
{@render main?.({ {@render main?.({
class: `w-full bg-slate-25 dark:bg-zinc-925 justify-self-center shadow-sm z-0 main !pb-22 lg:!pb-0`, class: `w-full bg-slate-25 dark:bg-zinc-925 justify-self-center shadow-sm z-0 main !pb-22 lg:!pb-0 lg:!pt-22`,
style: 'grid-area: main', style: 'grid-area: main',
})} })}
{@render suffix?.({ {@render suffix?.({
class: `max-xl:hidden w-full sticky top-0 left-0 max-h-screen bg-slate-50 dark:bg-zinc-950 class: `max-xl:hidden w-full sticky top-0 left-0 max-h-screen bg-slate-50 dark:bg-zinc-950
z-40 lg:top-16`, z-40 lg:!pt-20`,
style: 'grid-area: suffix;', style: 'grid-area: suffix;',
})} })}
</div> </div>
@@ -20,7 +20,7 @@
{#each items.sort( (a, b) => a.title.localeCompare(b.title), ) as follow (follow.id)} {#each items.sort( (a, b) => a.title.localeCompare(b.title), ) as follow (follow.id)}
<div <div
class="inline-flex w-full items-center pl-3 hover:bg-slate-100 hover:dark:bg-zinc-800 class="inline-flex w-full items-center pl-3 hover:bg-slate-100 hover:dark:bg-zinc-900
transition-colors rounded-lg" transition-colors rounded-lg"
animate:flip={{ duration: 500, easing: expoOut }} animate:flip={{ duration: 500, easing: expoOut }}
> >
@@ -22,6 +22,7 @@
color="tertiary" color="tertiary"
alignment="left" alignment="left"
loading={switching} loading={switching}
rounding="lg"
loaderWidth={22} loaderWidth={22}
selected={profile.data?.id == prof.id} selected={profile.data?.id == prof.id}
onclick={async () => { onclick={async () => {
+10 -20
View File
@@ -109,11 +109,13 @@
</EndPlaceholder> </EndPlaceholder>
</span> </span>
{/snippet} {/snippet}
{#each [...profileData.profiles] as prof, index} <div class="w-full flex gap-px flex-col">
<div class="w-full"> {#each [...profileData.profiles] as prof, index}
<ProfileButton {index} {prof} /> <div class="w-full">
</div> <ProfileButton {index} {prof} />
{/each} </div>
{/each}
</div>
<SidebarButton href="/accounts" icon={UserGroup}> <SidebarButton href="/accounts" icon={UserGroup}>
{$t('account.accounts')} {$t('account.accounts')}
</SidebarButton> </SidebarButton>
@@ -126,11 +128,7 @@
bind:open={settings.expand.favorites} bind:open={settings.expand.favorites}
> >
{#snippet title()} {#snippet title()}
<span <span class="px-2 py-1 w-full">
class="px-2 py-1 w-full {settings.expandSidebar
? ''
: '//max-lg:hidden'}"
>
<EndPlaceholder> <EndPlaceholder>
{$t('routes.profile.favorites')} {$t('routes.profile.favorites')}
{#snippet action()} {#snippet action()}
@@ -152,11 +150,7 @@
bind:open={settings.expand.moderates} bind:open={settings.expand.moderates}
> >
{#snippet title()} {#snippet title()}
<span <span class="px-2 py-1 w-full">
class="px-2 py-1 w-full {settings.expandSidebar
? ''
: '//max-lg:hidden'}"
>
<EndPlaceholder> <EndPlaceholder>
{$t('routes.profile.moderates')} {$t('routes.profile.moderates')}
{#snippet action()} {#snippet action()}
@@ -179,11 +173,7 @@
bind:open={settings.expand.communities} bind:open={settings.expand.communities}
> >
{#snippet title()} {#snippet title()}
<span <span class="px-2 py-1 w-full">
class="px-2 py-1 w-full {settings.expandSidebar
? ''
: '//max-lg:hidden'}"
>
<EndPlaceholder> <EndPlaceholder>
{$t('profile.subscribed')} {$t('profile.subscribed')}
{#snippet action()} {#snippet action()}
@@ -33,13 +33,14 @@
</script> </script>
<Button <Button
color={selected ? 'primary' : 'tertiary'} color="tertiary"
alignment="left" alignment="left"
rounding="pill"
{...rest} {...rest}
{href} {href}
class="font-normal block !origin-left border border-transparent {!selected class="font-normal block !origin-left border border-transparent hover:dark:bg-zinc-900 {!selected
? 'text-slate-600 dark:text-zinc-400' ? 'text-slate-600 dark:text-zinc-400'
: ''} {clazz}" : 'bg-slate-100 dark:bg-zinc-925'} {clazz}"
> >
{#snippet prefix()} {#snippet prefix()}
{#if customIcon} {#if customIcon}
+2 -1
View File
@@ -147,13 +147,14 @@
<div class=" {c}" style={s}> <div class=" {c}" style={s}>
{#if page.data.slots?.sidebar?.component} {#if page.data.slots?.sidebar?.component}
{@const SvelteComponent = page.data.slots.sidebar.component} {@const SvelteComponent = page.data.slots.sidebar.component}
<SvelteComponent {...page.data.slots.sidebar.props} /> <SvelteComponent {...page.data.slots.sidebar.props} class="!pt-0" />
{:else if site.data} {:else if site.data}
<SiteCard <SiteCard
site={site.data.site_view} site={site.data.site_view}
taglines={site.data.taglines} taglines={site.data.taglines}
admins={site.data.admins} admins={site.data.admins}
version={site.data.version} version={site.data.version}
class="!pt-0"
/> />
{:else} {:else}
<div class="h-64 w-full grid place-items-center"> <div class="h-64 w-full grid place-items-center">