diff --git a/src/mastodon-timeline.js b/src/mastodon-timeline.js index 04e6472..d17011c 100644 --- a/src/mastodon-timeline.js +++ b/src/mastodon-timeline.js @@ -1000,10 +1000,14 @@ export class Init { '"; - + if (type === "image") { + const width = m.width || 800; // 默认宽度 + const height = m.height || 600; // 默认高度 + const aspectRatio = width / height; + media = - '
' + + '" style="padding-top: calc(100% / ' + + aspectRatio + + ')">' + (spoiler ? spoilerBtns : "") + - '