diff --git a/links/templates/links/link_list.html b/links/templates/links/link_list.html index cc6f5b4..bab816c 100644 --- a/links/templates/links/link_list.html +++ b/links/templates/links/link_list.html @@ -316,7 +316,8 @@ /* ---------- Image tiles ---------- */ .image-tile-btn { - position: relative; display: block; width: 100%; aspect-ratio: 16 / 10; + position: relative; display: block; width: 100%; max-width: 22rem; margin: 0 auto; + aspect-ratio: 3 / 4; padding: 0; border: none; border-radius: var(--apple-radius-lg); overflow: hidden; cursor: pointer; background: #e8e8ed; box-shadow: var(--apple-shadow-card); } @@ -371,8 +372,9 @@ if (!img) return; const box = img.getAttribute('data-box'); const timestamp = new Date().getTime(); - const width = img.offsetWidth || 1200; - const height = img.offsetHeight || 750; + // Portrait tiles: height must always be >= width. + const width = img.offsetWidth || 800; + const height = Math.max(img.offsetHeight || 1200, width); const newUrl = `/api/images/random/${width}/${height}/?fit=crop&v=${timestamp}&box=${box}`; const newImg = new Image(); @@ -649,7 +651,7 @@