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) if (compact && post.thumbnail_url)
return `${post.thumbnail_url}?thumbnail=256&format=webp` return `${post.thumbnail_url}?thumbnail=512&format=webp`
else if (compact && post.url) return `${post.url}?thumbnail=256&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) 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 ?? '' return post.url ?? ''
} }
@@ -37,7 +37,7 @@ export const optimizeImageURL = (
url.searchParams.append('format', 'webp') url.searchParams.append('format', 'webp')
url.searchParams.append( url.searchParams.append(
'thumbnail', 'thumbnail',
findClosestNumber([128, 256, 512, 1024], width).toString() findClosestNumber([128, 256, 512, 1024], width * 2).toString()
) )
return url.toString() return url.toString()
} catch (e) { } catch (e) {
@@ -45,9 +45,9 @@
> >
<!-- svelte-ignore a11y-missing-attribute --> <!-- svelte-ignore a11y-missing-attribute -->
<img <img
src={bestImageURL(post, false, 256)} src={bestImageURL(post, false, 64)}
loading="lazy" 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]"> <picture class="max-h-[inherit]">
<source <source
+1 -1
View File
@@ -21,7 +21,7 @@
urlObj.searchParams.append('format', 'webp') urlObj.searchParams.append('format', 'webp')
urlObj.searchParams.append( urlObj.searchParams.append(
'thumbnail', 'thumbnail',
findClosestNumber(sizes, res || width).toString() findClosestNumber(sizes, (res || width) * 2).toString()
) )
return urlObj.toString() return urlObj.toString()