适应多图片排版
This commit is contained in:
parent
38e0b5a451
commit
5c01c590a4
@ -1002,8 +1002,12 @@ export class Init {
|
|||||||
"</button>";
|
"</button>";
|
||||||
|
|
||||||
if (type === "image") {
|
if (type === "image") {
|
||||||
|
const width = m.width || 800; // 默认宽度
|
||||||
|
const height = m.height || 600; // 默认高度
|
||||||
|
const aspectRatio = width / height;
|
||||||
|
|
||||||
media =
|
media =
|
||||||
'<div class="mt-post-mediaa ' +
|
'<div class="mt-post-media ' +
|
||||||
(spoiler ? "mt-post-media-spoiler " : "") +
|
(spoiler ? "mt-post-media-spoiler " : "") +
|
||||||
this.mtSettings.spinnerClass +
|
this.mtSettings.spinnerClass +
|
||||||
'" data-media-type="' +
|
'" data-media-type="' +
|
||||||
@ -1012,9 +1016,11 @@ export class Init {
|
|||||||
m.url +
|
m.url +
|
||||||
'" data-media-alt-txt="' +
|
'" data-media-alt-txt="' +
|
||||||
(m.description ? this.#escapeHTML(m.description) : "") +
|
(m.description ? this.#escapeHTML(m.description) : "") +
|
||||||
'" style="position: relative; float: left; inset: auto;">' +
|
'" style="padding-top: calc(100% / ' +
|
||||||
|
aspectRatio +
|
||||||
|
')">' +
|
||||||
(spoiler ? spoilerBtns : "") +
|
(spoiler ? spoilerBtns : "") +
|
||||||
'<img style="max-width:150%; overflow:hidden;" src="' +
|
'<img src="' +
|
||||||
m.preview_url +
|
m.preview_url +
|
||||||
'" alt="' +
|
'" alt="' +
|
||||||
(m.description ? this.#escapeHTML(m.description) : "") +
|
(m.description ? this.#escapeHTML(m.description) : "") +
|
||||||
|
Loading…
x
Reference in New Issue
Block a user