ArticleGrid default image size changed
This commit is contained in:
1 parent
0a470e2441
commit
d5390fa99a
1 file changed
+4
-2
@@ -15,14 +15,16 @@ export function resizeImage(src: string, options: IResizeImage): string {
|
|||||||
return `https://images.weserv.nl/?url=${src}&w=${options.w}&h=${options.h}&n=-1`
|
return `https://images.weserv.nl/?url=${src}&w=${options.w}&h=${options.h}&n=-1`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const cardImgSize1 = { w: 500, h: 500 }
|
||||||
|
const cardImgSize2 = { w: 1000, h: 1000 }
|
||||||
function getImage(image?: ImageDefinition) {
|
function getImage(image?: ImageDefinition) {
|
||||||
if (!image) {
|
if (!image) {
|
||||||
const defaultSrc = process.env.APP_CARD_DEFAULT_IMAGE
|
const defaultSrc = process.env.APP_CARD_DEFAULT_IMAGE
|
||||||
const src = resizeImage(defaultSrc, { w: 400, h: 400 })
|
const src = resizeImage(defaultSrc, cardImgSize1)
|
||||||
const set = [
|
const set = [
|
||||||
{
|
{
|
||||||
density: 2,
|
density: 2,
|
||||||
href: resizeImage(defaultSrc, { w: 800, h: 800 }),
|
href: resizeImage(defaultSrc, cardImgSize2),
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
const srcSet = set
|
const srcSet = set
|
||||||
|
|||||||
Reference in new issue
Block a user