mirror of
https://github.com/wahyd4/links.git
synced 2026-08-08 21:04:53 +10:00
update style!
This commit is contained in:
@@ -461,9 +461,12 @@
|
||||
if (!img) return;
|
||||
const box = img.getAttribute('data-box');
|
||||
const timestamp = new Date().getTime();
|
||||
// The API rejects dimensions below 300px; portrait cards: height >= width.
|
||||
const width = Math.max(img.offsetWidth || 800, 300);
|
||||
const height = Math.max(img.offsetHeight || 1200, width, 300);
|
||||
// Request the same fixed high-resolution size used for the initial page
|
||||
// load (600x800), regardless of the card's small on-screen CSS size —
|
||||
// the .fan-card is only ~100-170px wide, so using img.offsetWidth/Height
|
||||
// here fetched a much smaller/blurrier image than the initial fetch did.
|
||||
const width = 600;
|
||||
const height = 800;
|
||||
const newUrl = `/api/images/random/${width}/${height}/?fit=crop&v=${timestamp}&box=${box}`;
|
||||
|
||||
const newImg = new Image();
|
||||
|
||||
Reference in New Issue
Block a user