diff --git a/src/components/MasonryGallery.js b/src/components/MasonryGallery.js index 5ce3ed9..cbac5c6 100644 --- a/src/components/MasonryGallery.js +++ b/src/components/MasonryGallery.js @@ -103,9 +103,15 @@ const MasonryGallery = ({ } const rowAspectRatioSum = currentRow.aspect; const ar = getAspectRatio(image); - const widthNumber = ((ar / rowAspectRatioSum) * 100).toFixed(7); - - const width = `${widthNumber}%`; + let width; + let height = `calc(100vw / ${rowAspectRatioSum} - 10px)` + if (ar === rowAspectRatioSum) { + width = `calc(300px * ${ar})`; + height = 'unset' + } else { + const widthNumber = ((ar / rowAspectRatioSum) * 100).toFixed(7); + width = `${widthNumber}%`; + } return (