impr: use gradients for placeholder avatars
This commit is contained in:
7 files changed
+54
-21
No files matched your search
@@ -20,7 +20,7 @@
|
|||||||
Flag,
|
Flag,
|
||||||
Icon,
|
Icon,
|
||||||
PencilSquare,
|
PencilSquare,
|
||||||
Square2Stack,
|
Share,
|
||||||
Trash,
|
Trash,
|
||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons'
|
||||||
|
|
||||||
@@ -87,14 +87,18 @@
|
|||||||
else navigator.clipboard.writeText(comment.comment.ap_id)
|
else navigator.clipboard.writeText(comment.comment.ap_id)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Icon src={Square2Stack} mini size="16" />
|
{#snippet prefix()}
|
||||||
<div>{$t('post.actions.more.share')}</div>
|
<Icon src={Share} mini size="16" />
|
||||||
|
{/snippet}
|
||||||
|
{$t('post.actions.more.share')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
{#if profile.current?.jwt}
|
{#if profile.current?.jwt}
|
||||||
{#if comment.creator.id == profile.current.user?.local_user_view.person.id}
|
{#if comment.creator.id == profile.current.user?.local_user_view.person.id}
|
||||||
<MenuButton onclick={() => onedit?.(comment)}>
|
<MenuButton onclick={() => onedit?.(comment)}>
|
||||||
|
{#snippet prefix()}
|
||||||
<Icon src={PencilSquare} mini size="16" />
|
<Icon src={PencilSquare} mini size="16" />
|
||||||
<span>{$t('post.actions.more.edit')}</span>
|
{/snippet}
|
||||||
|
{$t('post.actions.more.edit')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
{/if}
|
{/if}
|
||||||
<MenuButton
|
<MenuButton
|
||||||
@@ -103,10 +107,10 @@
|
|||||||
comment.saved = await save(comment, !comment.saved)
|
comment.saved = await save(comment, !comment.saved)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
{#snippet prefix()}
|
||||||
<Icon src={comment.saved ? BookmarkSlash : Bookmark} mini size="16" />
|
<Icon src={comment.saved ? BookmarkSlash : Bookmark} mini size="16" />
|
||||||
<span>
|
{/snippet}
|
||||||
{comment.saved ? $t('post.actions.unsave') : $t('post.actions.save')}
|
{comment.saved ? $t('post.actions.unsave') : $t('post.actions.save')}
|
||||||
</span>
|
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
{#if profile.current?.user && profile.current.jwt && profile.current.user.local_user_view.person.id == comment.creator.id}
|
{#if profile.current?.user && profile.current.jwt && profile.current.user.local_user_view.person.id == comment.creator.id}
|
||||||
<MenuButton
|
<MenuButton
|
||||||
@@ -119,18 +123,20 @@
|
|||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
{#snippet prefix()}
|
||||||
<Icon src={Trash} mini size="16" />
|
<Icon src={Trash} mini size="16" />
|
||||||
<span>
|
{/snippet}
|
||||||
{comment.comment.deleted
|
{comment.comment.deleted
|
||||||
? $t('post.actions.more.restore')
|
? $t('post.actions.more.restore')
|
||||||
: $t('post.actions.more.delete')}
|
: $t('post.actions.more.delete')}
|
||||||
</span>
|
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
{/if}
|
{/if}
|
||||||
{#if profile.current.jwt && profile.current.user?.local_user_view.person.id != comment.creator.id}
|
{#if profile.current.jwt && profile.current.user?.local_user_view.person.id != comment.creator.id}
|
||||||
<MenuButton onclick={() => report(comment)} color="danger-subtle">
|
<MenuButton onclick={() => report(comment)} color="danger-subtle">
|
||||||
|
{#snippet prefix()}
|
||||||
<Icon src={Flag} mini size="16" />
|
<Icon src={Flag} mini size="16" />
|
||||||
<span>{$t('moderation.report')}</span>
|
{/snippet}
|
||||||
|
{$t('moderation.report')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -83,6 +83,34 @@
|
|||||||
>
|
>
|
||||||
{@html createAvatar(initials, {
|
{@html createAvatar(initials, {
|
||||||
seed: alt,
|
seed: alt,
|
||||||
|
backgroundType: ['gradientLinear'],
|
||||||
|
fontWeight: 800,
|
||||||
|
randomizeIds: true,
|
||||||
|
chars: 1,
|
||||||
|
scale: 125,
|
||||||
|
textColor: ['fff', '000'],
|
||||||
|
backgroundColor: [
|
||||||
|
'7B68EE',
|
||||||
|
'FF6347',
|
||||||
|
'20B2AA',
|
||||||
|
'DDA0DD',
|
||||||
|
'F0E68C',
|
||||||
|
'FF1493',
|
||||||
|
'4682B4',
|
||||||
|
'32CD32',
|
||||||
|
'FFB6C1',
|
||||||
|
'8B4513',
|
||||||
|
'00CED1',
|
||||||
|
'9370DB',
|
||||||
|
'FFA500',
|
||||||
|
'2E8B57',
|
||||||
|
'DC143C',
|
||||||
|
'BA55D3',
|
||||||
|
'708090',
|
||||||
|
'ADFF2F',
|
||||||
|
'CD853F',
|
||||||
|
'48D1CC',
|
||||||
|
],
|
||||||
}).toString()}
|
}).toString()}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
rounding="none"
|
rounding="none"
|
||||||
{href}
|
{href}
|
||||||
title={label}
|
title={label}
|
||||||
style="transition-property: background-color, filter;"
|
style="transition-property: background-color, filter, transform, scale;"
|
||||||
aria-selected={isSelected}
|
aria-selected={isSelected}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ items-center px-2 w-max top-6 lg:top-22"
|
|||||||
</div>
|
</div>
|
||||||
</Header>
|
</Header>
|
||||||
|
|
||||||
<div class="h-4 sm:h-6"></div>
|
<div class="h-3 sm:h-6"></div>
|
||||||
|
|
||||||
{#if !data.inbox?.value || (data.inbox.value?.length ?? 0) == 0}
|
{#if !data.inbox?.value || (data.inbox.value?.length ?? 0) == 0}
|
||||||
<Placeholder
|
<Placeholder
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
import UserAutocomplete from '$lib/components/lemmy/user/UserAutocomplete.svelte'
|
import UserAutocomplete from '$lib/components/lemmy/user/UserAutocomplete.svelte'
|
||||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||||
import Skeleton from '$lib/components/ui/generic/Skeleton.svelte'
|
import Skeleton from '$lib/components/ui/generic/Skeleton.svelte'
|
||||||
|
import CommonList from '$lib/components/ui/layout/CommonList.svelte'
|
||||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||||
import Pageination from '$lib/components/ui/Pageination.svelte'
|
import Pageination from '$lib/components/ui/Pageination.svelte'
|
||||||
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
||||||
@@ -120,9 +121,6 @@
|
|||||||
{@const conversations = res.private_messages}
|
{@const conversations = res.private_messages}
|
||||||
{@const previews = conversationPreviews(conversations)}
|
{@const previews = conversationPreviews(conversations)}
|
||||||
|
|
||||||
<ul
|
|
||||||
class="flex flex-col divide-y divide-slate-200 dark:divide-zinc-800 w-full mt-6 h-full"
|
|
||||||
>
|
|
||||||
{#if previews.length == 0}
|
{#if previews.length == 0}
|
||||||
<Placeholder
|
<Placeholder
|
||||||
title={$t('routes.inbox.messages.empty.title')}
|
title={$t('routes.inbox.messages.empty.title')}
|
||||||
@@ -132,11 +130,12 @@
|
|||||||
{@render startChat?.()}
|
{@render startChat?.()}
|
||||||
</Placeholder>
|
</Placeholder>
|
||||||
{/if}
|
{/if}
|
||||||
{#each previews as preview, index (preview)}
|
<div class="h-3 sm:h-6"></div>
|
||||||
|
<CommonList items={previews}>
|
||||||
|
{#snippet item(preview, index)}
|
||||||
<a
|
<a
|
||||||
href="/inbox/messages/{preview.user.id}"
|
href="/inbox/messages/{preview.user.id}"
|
||||||
class="flex flex-row gap-2 py-3 -mx-3 sm:-mx-6 px-3 sm:px-6 min-w-0
|
class="flex flex-row gap-2"
|
||||||
hover:bg-slate-100 dark:hover:bg-zinc-900 transition-colors"
|
|
||||||
in:fly|global={{
|
in:fly|global={{
|
||||||
duration: 1000,
|
duration: 1000,
|
||||||
easing: expoOut,
|
easing: expoOut,
|
||||||
@@ -165,8 +164,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
{/each}
|
{/snippet}
|
||||||
</ul>
|
</CommonList>
|
||||||
|
|
||||||
{#if res.private_messages.length == 50 || data.page != 1}
|
{#if res.private_messages.length == 50 || data.page != 1}
|
||||||
<div class="mt-auto pb-4">
|
<div class="mt-auto pb-4">
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
if (browser && page.url.hash)
|
if (browser && !isNaN(Number(page.url.hash)))
|
||||||
// hack because virtual list needs to calc heights
|
// hack because virtual list needs to calc heights
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
document
|
document
|
||||||
|
|||||||
@@ -62,7 +62,7 @@
|
|||||||
{/snippet}
|
{/snippet}
|
||||||
</Header>
|
</Header>
|
||||||
|
|
||||||
<div class="h-4 sm:h-6"></div>
|
<div class="h-3 sm:h-6"></div>
|
||||||
|
|
||||||
{#if !data.data || (data.data?.length ?? 0) == 0}
|
{#if !data.data || (data.data?.length ?? 0) == 0}
|
||||||
<Placeholder
|
<Placeholder
|
||||||
|
|||||||
Reference in new issue
Block a user