change avatar from dicebear to vercel

This commit is contained in:
MuslemRahimi 2024-07-07 10:35:44 +02:00
parent ee854a61a7
commit 7f915149dc
12 changed files with 14 additions and 14 deletions

View File

@ -298,7 +298,7 @@ const handleDownvote = async (event) => {
<img class="flex-shrink-0 inline-block bg-slate-300 rounded-full"
src={comment?.expand?.user?.avatar
? getImageURL(comment?.expand?.user?.collectionId, comment?.expand?.user?.id, comment?.expand?.user?.avatar)
: `https://api.dicebear.com/7.x/thumbs/svg?seed=${comment?.expand?.user?.username}`}
: `https://avatar.vercel.sh/${comment?.expand?.user?.username}`}
alt="User avatar" />
</label>
<span class="text-white ml-2 inline-block text-xs sm:text-sm">

View File

@ -15,7 +15,7 @@
<div class="w-8 sm:w-10 rounded-full">
<img src={data?.avatar
? getImageURL(data?.collectionId, data?.id, data?.avatar)
: `https://api.dicebear.com/7.x/thumbs/svg?seed=${data?.user?.username}`} />
: `https://avatar.vercel.sh/${data?.user?.username}`} />
</div>
<div class="w-3.5 h-3.5 sm:w-4 sm:h-4 bg-green-400 border border-2 border-slate-800 rounded-full absolute bottom-0 right-0"></div>
</div>

View File

@ -338,7 +338,7 @@ $: {
<img class="flex-shrink-0 inline-block bg-slate-300 rounded-full"
src={posts?.expand?.user?.avatar
? getImageURL(posts?.expand?.user?.collectionId, posts?.expand?.user?.id, posts?.expand?.user?.avatar)
: `https://api.dicebear.com/7.x/thumbs/svg?seed=${posts?.expand?.user?.username}`}
: `https://avatar.vercel.sh/${posts?.expand?.user?.username}`}
alt="User avatar" />
</label>
<span class="text-white ml-2 inline-block text-sm">

View File

@ -32,7 +32,7 @@
class="rounded-full {rank === 1 ? 'w-16 h-16 sm:w-20 sm:h-20' : rank === 2 ? 'w-14 h-14 sm:w-16 sm:h-16' : 'w-11 h-11 sm:w-12 sm:h-12'} absolute inset-1/2 transform -translate-x-1/2 -translate-y-1/2"
src={data?.expand?.user?.avatar
? getImageURL(data?.expand?.user?.collectionId, data?.expand?.user?.id, data?.expand?.user?.avatar)
: `https://api.dicebear.com/7.x/thumbs/svg?seed=${data?.expand?.user?.username}`}
: `https://avatar.vercel.sh/${data?.expand?.user?.username}`}
alt="User avatar" loading="lazy"/>
</div>

View File

@ -422,7 +422,7 @@ $: {
src={data?.user?.avatar
? getImageURL(data?.user.collectionId, data?.user.id, data?.user.avatar)
: `https://api.dicebear.com/7.x/thumbs/svg?seed=${data?.user?.username}`}
: `https://avatar.vercel.sh/${data?.user?.username}`}
/>
</div>
</label>
@ -431,7 +431,7 @@ $: {
<img style="clip-path: circle(50%);" class="flex-shrink-0 bg-slate-300 rounded-full inline-block "
src={data?.user?.avatar
? getImageURL(data?.user.collectionId, data?.user.id, data?.user.avatar)
: `https://api.dicebear.com/7.x/thumbs/svg?seed=${data?.user?.username}`}
: `https://avatar.vercel.sh/${data?.user?.username}`}
/>
</label>

View File

@ -182,7 +182,7 @@ let allBlogPosts = data?.getAllBlogPost;
class="rounded-full w-10 h-10 mr-2"
src={item?.expand?.user?.avatar
? getImageURL(item?.expand?.user?.collectionId, item?.expand?.user?.id, item?.expand?.user?.avatar)
: `https://api.dicebear.com/7.x/thumbs/svg?seed=${item?.expand?.user?.username}`}
: `https://avatar.vercel.sh/${item?.expand?.user?.username}`}
alt="User avatar" loading='lazy'/>
{item?.expand?.user?.username} &centerdot; {new Date(item?.created)?.toLocaleString('en-US', { month: 'short', day: 'numeric', year: 'numeric', daySuffix: '2-digit' })}

View File

@ -68,7 +68,7 @@ const article = data?.getArticle;
class="rounded-full w-10 h-10 mr-2"
src={article?.expand?.user?.avatar
? getImageURL(article?.expand?.user?.collectionId, article?.expand?.user?.id, article?.expand?.user?.avatar)
: `https://api.dicebear.com/7.x/thumbs/svg?seed=${article?.expand?.user?.username}`}
: `https://avatar.vercel.sh/${article?.expand?.user?.username}`}
alt="User avatar" loading='lazy'/>
<div class="flex flex-col items-start">
<span class="text-white text-sm">

View File

@ -648,7 +648,7 @@ function updateVote(postVote) {
<img class="flex-shrink-0 inline-block bg-slate-300 rounded-full"
src={post?.expand?.user?.avatar
? getImageURL(post?.expand?.user?.collectionId, post?.expand?.user?.id, post?.expand?.user?.avatar)
: `https://api.dicebear.com/7.x/thumbs/svg?seed=${post?.expand?.user?.username}`}
: `https://avatar.vercel.sh/${post?.expand?.user?.username}`}
alt="User avatar" />
</label>
<span class="text-white ml-2 inline-block text-sm">

View File

@ -618,7 +618,7 @@ onDestroy(async () => {
<img style="clip-path: circle(50%);" class="w-24 bg-slate-300 border border-slate-400 rounded-full inline-block "
src={data?.user?.avatar
? getImageURL(data?.user?.collectionId, data?.user?.id, data?.user?.avatar)
: `https://api.dicebear.com/7.x/thumbs/svg?scale=200`}
: `https://avatar.vercel.sh/${data?.user?.username}`}
alt="User avatar"
id="avatar-preview"
/>

View File

@ -271,7 +271,7 @@ onMount(async () => {
<img style="clip-path: circle(50%);" class="w-24 bg-slate-300 border border-slate-400 rounded-full inline-block "
src={userData?.avatar
? getImageURL(userData?.collectionId, userData?.id, userData?.avatar)
: `https://api.dicebear.com/7.x/thumbs/svg?scale=200`}
: `https://avatar.vercel.sh/${userData?.username}`}
alt="User avatar"
id="avatar-preview"
/>

View File

@ -371,7 +371,7 @@ async function getLeaderboard() {
class="rounded-full w-10 h-10 absolute inset-1/2 transform -translate-x-1/2 -translate-y-1/2"
src={item?.expand?.user?.avatar
? getImageURL(item?.expand?.user?.collectionId, item?.expand?.user?.id, item?.expand?.user?.avatar)
: `https://api.dicebear.com/7.x/thumbs/svg?seed=${item?.expand?.user?.username}`}
: `https://avatar.vercel.sh/${item?.expand?.user?.username}`}
alt="User avatar" />
</div>
@ -445,7 +445,7 @@ async function getLeaderboard() {
class="rounded-full w-8 h-8 absolute inset-1/2 transform -translate-x-1/2 -translate-y-1/2"
src={item?.expand?.user?.avatar
? getImageURL(item?.expand?.user?.collectionId, item?.expand?.user?.id, item?.expand?.user?.avatar)
: `https://api.dicebear.com/7.x/thumbs/svg?seed=${item?.expand?.user?.username}`}
: `https://avatar.vercel.sh/${item?.expand?.user?.username}`}
alt="User avatar" />
</div>

View File

@ -150,7 +150,7 @@ onMount(async () => {
<img style="clip-path: circle(50%);" class="flex-shrink-0 w-8 h-8 sm:w-11 sm:h-11 rounded-full inline-block"
src={item?.expand?.user?.avatar
? getImageURL(item?.expand?.user?.collectionId, item?.expand?.user?.id, item?.expand?.user?.avatar)
: `https://api.dicebear.com/7.x/thumbs/svg?seed=${item?.expand?.user?.username}`}
: `https://avatar.vercel.sh/${item?.expand?.user?.username}`}
alt="User avatar"
/>
</label>