4
0
forked from crowetic/commerce

Min images

This commit is contained in:
Belen Curcio 2020-11-06 15:42:01 -03:00
parent 62cc3b2493
commit d74ffb1401
4 changed files with 12 additions and 16 deletions

View File

@ -125,15 +125,11 @@
} }
.imageContainer { .imageContainer {
& > div { overflow: hidden;
& > div { @apply flex items-center justify-center;
height: 100%;
margin: 0 auto;
}
}
} }
.product-image { .image {
height: 120% !important; object-fit: cover;
top: -10% !important; transform: scale(1.2);
} }

View File

@ -51,8 +51,8 @@ const ProductCard: FC<Props> = ({
width={imgWidth} width={imgWidth}
height={imgHeight} height={imgHeight}
priority={priority} priority={priority}
quality="85"
layout={imgLayout} layout={imgLayout}
quality="85"
/> />
</div> </div>
) : ( ) : (
@ -73,8 +73,8 @@ const ProductCard: FC<Props> = ({
</div> </div>
<div className={s.imageContainer}> <div className={s.imageContainer}>
<Image <Image
className={s.image}
alt={p.name} alt={p.name}
className={cn('w-full object-cover', s['product-image'])}
src={src} src={src}
width={imgWidth} width={imgWidth}
height={imgHeight} height={imgHeight}

View File

@ -1,6 +1,6 @@
module.exports = { module.exports = {
images: { images: {
imagesSizes: [320, 480, 820, 1200, 1600], imagesSizes: [320, 480, 820, 1280],
domains: ['cdn11.bigcommerce.com'], domains: ['cdn11.bigcommerce.com'],
}, },
i18n: { i18n: {

View File

@ -91,8 +91,8 @@ export default function Home({
key={node.path} key={node.path}
product={node} product={node}
// The first image is the largest one in the grid // The first image is the largest one in the grid
imgWidth={i === 0 ? 1280 : 820} imgWidth={i === 0 ? 1080 : 540}
imgHeight={i === 0 ? 1280 : 820} imgHeight={i === 0 ? 1080 : 540}
priority priority
/> />
))} ))}
@ -125,8 +125,8 @@ export default function Home({
key={node.path} key={node.path}
product={node} product={node}
// The second image is the largest one in the grid // The second image is the largest one in the grid
imgWidth={i === 1 ? 1280 : 820} imgWidth={i === 1 ? 1080 : 540}
imgHeight={i === 1 ? 1280 : 820} imgHeight={i === 1 ? 1080 : 540}
/> />
))} ))}
</Grid> </Grid>