From 462e06c97bc458f71323ef9824d91feea6f73384 Mon Sep 17 00:00:00 2001 From: 728 Date: Wed, 31 May 2023 15:47:50 +0800 Subject: [PATCH] imgl --- ismism.ts/src/pra/doc.ts | 3 ++- ismism.ts/ui/bind/article.ts | 7 +++++++ ismism.ts/ui/bind/template.ts | 5 +++++ ismism.ts/ui/index/style.css | 36 ++++++++++++++++++++++++++++++++ ismism.ts/ui/index/template.html | 11 +++++++++- 5 files changed, 60 insertions(+), 2 deletions(-) diff --git a/ismism.ts/src/pra/doc.ts b/ismism.ts/src/pra/doc.ts index 891d5d0..edc3515 100644 --- a/ismism.ts/src/pra/doc.ts +++ b/ismism.ts/src/pra/doc.ts @@ -129,7 +129,8 @@ export async function dst( if (rd === null || rdaid === null) return null const aid = rdaid.map(r => r._id.aid!) const ndst = await Promise.all(aid.map(a => dst_n({ rd: lim_rd, aid: a }))) - const dst = aid.map((aid, n) => ({ aid, ndst: ndst[n] ?? 0 })).sort((a, b) => b.ndst - a.ndst) + const img = await Promise.all(aid.map(a => agd_r(a, { img: 1 }))) + const dst = aid.map((aid, n) => ({ aid, ndst: ndst[n] ?? 0, img: img[n]?.img.map(m => m.src) ?? [] })).sort((a, b) => b.ndst - a.ndst) const anam = await idnam(coll.agd, aid) return { rd: rd.json, dst, anam } } diff --git a/ismism.ts/ui/bind/article.ts b/ismism.ts/ui/bind/article.ts index 6130ce7..823aecf 100644 --- a/ismism.ts/ui/bind/article.ts +++ b/ismism.ts/ui/bind/article.ts @@ -611,7 +611,14 @@ export async function dst( if (nav.pas) t.preuid.disabled = true else t.preuid.remove() + + const ti = bind("imgl") + for (const d of q.dst) { + for (const src of d.img) + ti.imgl.innerHTML += `` + } main.append(t.bind) + main.append(ti.bind) } export async function aut( diff --git a/ismism.ts/ui/bind/template.ts b/ismism.ts/ui/bind/template.ts index 71d4ecb..baf5420 100644 --- a/ismism.ts/ui/bind/template.ts +++ b/ismism.ts/ui/bind/template.ts @@ -206,6 +206,11 @@ const template = { put: t("button"), preaid: t("button"), preuid: t("button"), }, + imgl: { + tid: "imgl" as const, + imgl: t("section"), + }, + aut: { tid: "aut" as const, sup: t("p"), aud: t("p"), aut: t("p"), wsl: t("p"), lit: t("p"), diff --git a/ismism.ts/ui/index/style.css b/ismism.ts/ui/index/style.css index 6eccdfe..f13da89 100644 --- a/ismism.ts/ui/index/style.css +++ b/ismism.ts/ui/index/style.css @@ -526,6 +526,42 @@ section.cover>img { box-shadow: rgba(0, 0, 0, 0.4) 0px 2px 4px; } +section.imgl { + column-count: 5; + column-gap: 0px; +} + +section.imgl a, +section.imgl img { + display: block; + width: 100% !important; +} + +@media (max-width: 1200px) { + section.imgl { + column-count: 4; + } +} + +@media (max-width: 1000px) { + section.imgl { + column-count: 3; + } +} + +@media (max-width: 800px) { + section.imgl { + column-count: 2; + } +} + +@media (max-width: 400px) { + section.imgl { + column-count: 1; + } +} + + section.acct>div>:last-child { float: right; } diff --git a/ismism.ts/ui/index/template.html b/ismism.ts/ui/index/template.html index 443519d..e49a54a 100644 --- a/ismism.ts/ui/index/template.html +++ b/ismism.ts/ui/index/template.html @@ -551,12 +551,21 @@


-
+
+ + + +