Skip to content

Commit

Permalink
fix: feedRow image seed
Browse files Browse the repository at this point in the history
  • Loading branch information
ndom91 committed Aug 23, 2024
1 parent 4d3a982 commit daf314d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
8 changes: 2 additions & 6 deletions apps/web/src/lib/components/bookmark-row/BookmarkRow.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
if (bookmark.image) {
return `${PUBLIC_WORKER_URL}/img/s_260x144,pos_top/${bookmark.image}`
} else {
return `${PUBLIC_WORKER_URL}/img/_/https://picsum.photos/seed/${btoa(bookmark.url).substring(0, 16)}/256/144.webp`
return `${PUBLIC_WORKER_URL}/img/_/https://picsum.photos/seed/${btoa(bookmark.url).substring(bookmark.url.length - 32, bookmark.url.length)}/256/144.webp`
}
})
Expand Down Expand Up @@ -91,11 +91,7 @@
alt="URL Favicon"
class="size-4 rounded-full"
/>
<a
target="_blank"
href={bookmark.url}
class="truncate text-neutral-500"
>
<a target="_blank" href={bookmark.url} class="truncate text-neutral-500">
{bookmark.url}
</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/lib/components/feed-row/FeedRow.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
if (feedEntry.feedMedia?.[0]?.href) {
return `${PUBLIC_WORKER_URL}/img/s_160x96/${feedEntry.feedMedia?.[0]?.href}`
} else {
return `${PUBLIC_WORKER_URL}/img/_/https://picsum.photos/seed/${btoa(feedEntry.link).substring(0, 16)}/160/96.webp`
return `${PUBLIC_WORKER_URL}/img/_/https://picsum.photos/seed/${btoa(feedEntry.link).substring(feedEntry.link.length - 32, feedEntry.link.length)}/160/96.webp`
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
if (item.image) {
return `${PUBLIC_WORKER_URL}/img/s_256x144/${item.image}`
} else {
return `${PUBLIC_WORKER_URL}/img/_/https://picsum.photos/seed/${btoa(item.url).substring(0, 16)}/256/144.webp`
return `${PUBLIC_WORKER_URL}/img/_/https://picsum.photos/seed/${btoa(item.url).substring(item.url.length - 32, item.url.length)}/256/144.webp`
}
})
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
if (item.feedMedia?.[0]?.href) {
return `${PUBLIC_WORKER_URL}/img/s_256x144/${item.feedMedia[0].href}`
} else {
return `${PUBLIC_WORKER_URL}/img/_/https://picsum.photos/seed/${btoa(item.link).substring(0, 16)}/256/144.webp`
return `${PUBLIC_WORKER_URL}/img/_/https://picsum.photos/seed/${btoa(item.link).substring(item.link.length - 32, item.link.length)}/256/144.webp`
}
})
</script>
Expand Down

0 comments on commit daf314d

Please sign in to comment.