misc: double image size

This commit is contained in:
Xylight committed 2024-07-06 11:33:31 -07:00
1 parent 09eb3b80c2
commit 1e78fa4180
3 files changed
+8 -8

No files matched your search

+5 -5
View File
@@ -18,12 +18,12 @@ export const bestImageURL = (
}
if (compact && post.thumbnail_url)
return `${post.thumbnail_url}?thumbnail=256&format=webp`
else if (compact && post.url) return `${post.url}?thumbnail=256&format=webp`
return `${post.thumbnail_url}?thumbnail=512&format=webp`
else if (compact && post.url) return `${post.url}?thumbnail=512&format=webp`
if (post.url) return `${post.url}?thumbnail=${width}&format=webp`
if (post.url) return `${post.url}?thumbnail=${width * 2}&format=webp`
else if (post.thumbnail_url)
return `${post.thumbnail_url}?thumbnail=${width}&format=webp`
return `${post.thumbnail_url}?thumbnail=${width * 2}&format=webp`
return post.url ?? ''
}
@@ -37,7 +37,7 @@ export const optimizeImageURL = (
url.searchParams.append('format', 'webp')
url.searchParams.append(
'thumbnail',
findClosestNumber([128, 256, 512, 1024], width).toString()
findClosestNumber([128, 256, 512, 1024], width * 2).toString()
)
return url.toString()
} catch (e) {
@@ -45,9 +45,9 @@
>
<!-- svelte-ignore a11y-missing-attribute -->
<img
src={bestImageURL(post, false, 256)}
src={bestImageURL(post, false, 64)}
loading="lazy"
class="-z-10 absolute top-0 left-0 w-full h-full object-cover blur-xl opacity-50"
class="-z-10 absolute top-0 left-0 w-full h-full object-cover blur-xl opacity-40"
/>
<picture class="max-h-[inherit]">
<source
+1 -1
View File
@@ -21,7 +21,7 @@
urlObj.searchParams.append('format', 'webp')
urlObj.searchParams.append(
'thumbnail',
findClosestNumber(sizes, res || width).toString()
findClosestNumber(sizes, (res || width) * 2).toString()
)
return urlObj.toString()