feat: Switch to dicebear
This commit is contained in:
1 parent
f8278d0419
commit
20ec519407
4 files changed
+75
-7
No files matched your search
@@ -41,6 +41,11 @@
|
||||
parent_id: parent.comment_view.comment.id,
|
||||
})
|
||||
|
||||
if (newComments.comments.length == 0) {
|
||||
loadingChildren = false
|
||||
return
|
||||
}
|
||||
|
||||
// this code sucks, but for some reason it works
|
||||
// lemmy api is quite goofy
|
||||
parent.children = buildCommentsTree(newComments.comments, true).find(
|
||||
|
||||
@@ -1,14 +1,28 @@
|
||||
<script lang="ts">
|
||||
import { createAvatar } from '@dicebear/core'
|
||||
import * as initials from '@dicebear/initials'
|
||||
|
||||
export let url: string | undefined
|
||||
export let alt: string = ''
|
||||
|
||||
export let width: number
|
||||
</script>
|
||||
|
||||
<img
|
||||
src="{url ?? `/img/logo-background.svg`}?format=webp&thumbnail={width * 2}"
|
||||
{alt}
|
||||
{width}
|
||||
loading="lazy"
|
||||
class="rounded-full aspect-square object-cover overflow-hidden"
|
||||
/>
|
||||
{#if url}
|
||||
<img
|
||||
src="{url}?format=webp&thumbnail={width * 2}"
|
||||
{alt}
|
||||
{width}
|
||||
loading="lazy"
|
||||
class="rounded-full aspect-square object-cover overflow-hidden"
|
||||
/>
|
||||
{:else}
|
||||
<div
|
||||
style="width: {width}px; height: {width}px;"
|
||||
class="rounded-full aspect-square object-cover overflow-hidden"
|
||||
>
|
||||
{@html createAvatar(initials, {
|
||||
seed: alt,
|
||||
}).toString()}
|
||||
</div>
|
||||
{/if}
|
||||
Reference in new issue
Block a user