impr: use gradients for placeholder avatars

This commit is contained in:
James Xylight committed 2025-07-25 21:21:42 -07:00
1 parent 1f078bd6e1
commit 12d7b70571
7 files changed
+71 -38

No files matched your search

@@ -20,7 +20,7 @@
Flag,
Icon,
PencilSquare,
Square2Stack,
Share,
Trash,
} from 'svelte-hero-icons'
@@ -87,14 +87,18 @@
else navigator.clipboard.writeText(comment.comment.ap_id)
}}
>
<Icon src={Square2Stack} mini size="16" />
<div>{$t('post.actions.more.share')}</div>
{#snippet prefix()}
<Icon src={Share} mini size="16" />
{/snippet}
{$t('post.actions.more.share')}
</MenuButton>
{#if profile.current?.jwt}
{#if comment.creator.id == profile.current.user?.local_user_view.person.id}
<MenuButton onclick={() => onedit?.(comment)}>
<Icon src={PencilSquare} mini size="16" />
<span>{$t('post.actions.more.edit')}</span>
{#snippet prefix()}
<Icon src={PencilSquare} mini size="16" />
{/snippet}
{$t('post.actions.more.edit')}
</MenuButton>
{/if}
<MenuButton
@@ -103,10 +107,10 @@
comment.saved = await save(comment, !comment.saved)
}}
>
<Icon src={comment.saved ? BookmarkSlash : Bookmark} mini size="16" />
<span>
{comment.saved ? $t('post.actions.unsave') : $t('post.actions.save')}
</span>
{#snippet prefix()}
<Icon src={comment.saved ? BookmarkSlash : Bookmark} mini size="16" />
{/snippet}
{comment.saved ? $t('post.actions.unsave') : $t('post.actions.save')}
</MenuButton>
{#if profile.current?.user && profile.current.jwt && profile.current.user.local_user_view.person.id == comment.creator.id}
<MenuButton
@@ -119,18 +123,20 @@
)
}}
>
<Icon src={Trash} mini size="16" />
<span>
{comment.comment.deleted
? $t('post.actions.more.restore')
: $t('post.actions.more.delete')}
</span>
{#snippet prefix()}
<Icon src={Trash} mini size="16" />
{/snippet}
{comment.comment.deleted
? $t('post.actions.more.restore')
: $t('post.actions.more.delete')}
</MenuButton>
{/if}
{#if profile.current.jwt && profile.current.user?.local_user_view.person.id != comment.creator.id}
<MenuButton onclick={() => report(comment)} color="danger-subtle">
<Icon src={Flag} mini size="16" />
<span>{$t('moderation.report')}</span>
{#snippet prefix()}
<Icon src={Flag} mini size="16" />
{/snippet}
{$t('moderation.report')}
</MenuButton>
{/if}
{/if}
+28
View File
@@ -83,6 +83,34 @@
>
{@html createAvatar(initials, {
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()}
</div>
{/if}
@@ -48,7 +48,7 @@
rounding="none"
{href}
title={label}
style="transition-property: background-color, filter;"
style="transition-property: background-color, filter, transform, scale;"
aria-selected={isSelected}
>
{#snippet prefix()}