diff options
| -rw-r--r-- | src/features/messages.js | 14 | ||||
| -rw-r--r-- | src/style.css | 6 |
2 files changed, 7 insertions, 13 deletions
diff --git a/src/features/messages.js b/src/features/messages.js index 547c050..09e4c95 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -6709,7 +6709,6 @@ export function messagesFeature(ctx) { // opens the thread — not on the picture. function onPicture(e) { const el = e.currentTarget; - if (el.classList.contains('tall')) return true; // cropped to fill its frame: all picture const r = el.getBoundingClientRect(); const nw = el.naturalWidth, nh = el.naturalHeight; if (!nw || !nh || !r.width || !r.height) return true; @@ -6725,19 +6724,14 @@ export function messagesFeature(ctx) { if (isImage || /\.(png|jpe?g|gif|webp|avif)(\?[^\s]*)?$/i.test(url)) { const size = feedPaint ? feedMedia(url) : null; if (feedPaint && !size) return h('a', { href: url, target: '_blank', rel: 'noopener noreferrer' }, label || url); - // tap it to see it properly — a 320px-tall crop of someone's - // photograph is a thumbnail, not the picture they posted + // tap it to see it full size (the feed shows it uncropped, but + // height-capped: see .note-img) const known = size || mediaReady.get(url); - // A tall picture (a phone screenshot, a 9:16 wallpaper) fitted inside - // the 320px box was a skinny strip with the column empty beside it. It - // gets a 3:4 frame as wide as the column allows instead, cropped to - // fill it; a tap still opens the whole thing. - const tall = !!(known && known.width && known.height / known.width > 4 / 3); return h('img', { - src: mediaSrc(url, known), class: 'note-img clickable' + (tall ? ' tall' : ''), loading: feedPaint || known ? 'eager' : 'lazy', alt: label || '', + src: mediaSrc(url, known), class: 'note-img clickable', loading: feedPaint || known ? 'eager' : 'lazy', alt: label || '', decoding: known && known.thumb ? 'sync' : undefined, // a few-ms decode: paint it with the page width: size?.width, height: size?.height, - style: tall ? undefined : size ? 'height:auto;aspect-ratio:' + size.width + '/' + size.height : undefined, + style: size ? 'height:auto;aspect-ratio:' + size.width + '/' + size.height : undefined, onClick: (e) => { if (!onPicture(e)) return; e.stopPropagation(); ctx.openImage && ctx.openImage(url); }, // a picture we were TOLD was a picture and which won't load leaves // nothing behind — the alt text is already in the sentence above it diff --git a/src/style.css b/src/style.css index a59a75d..ad2c7e8 100644 --- a/src/style.css +++ b/src/style.css @@ -660,9 +660,10 @@ html:has(#app .chat-card), body:has(#app .chat-card) { overflow: hidden; } .chat-row.dm .chat-time { font-size: 10px; color: var(--faint); margin-top: 2px; } /* Profile note feed: inline images stay contained, links wrap. */ -.note-img { display: block; max-width: 100%; max-height: 320px; border-radius: 10px; margin-top: 6px; object-fit: contain; } +/* never cropped: the column's width at the picture's own shape, up to a + height a tall one can't grief the feed past (it narrows instead) */ +.note-img { display: block; max-width: 100%; max-height: min(560px, 70vh); border-radius: 10px; margin-top: 6px; object-fit: contain; } .note-img.clickable { cursor: zoom-in; } -.note-img.tall { width: 100%; max-width: 330px; height: auto; max-height: none; aspect-ratio: 3 / 4; object-fit: cover; } /* The row under a post: reply, boost, quote, react, zap — spread across the post's full width so each is a comfortable target, quiet until one carries a count or you've used it. */ @@ -917,7 +918,6 @@ html.no-scroll { overflow: hidden; scrollbar-gutter: auto; } .quote-card .note-text { font-size: 14px; } .quote-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .quote-card .note-img { max-height: 220px; } -.quote-card .note-img.tall { max-width: 165px; } .quote-card .yt-embed { margin-top: 4px; } /* A YouTube link, shown as the video it is: the still, a play button, and a |
