This commit is contained in:
728
2023-05-31 15:47:50 +08:00
parent 7716edb843
commit 462e06c97b
5 changed files with 60 additions and 2 deletions

View File

@ -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 }
}

View File

@ -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 += `<a href="#a${d.aid}"><img src="${src}" loading="lazy"></a>`
}
main.append(t.bind)
main.append(ti.bind)
}
export async function aut(

View File

@ -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"),

View File

@ -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;
}

View File

@ -551,12 +551,21 @@
<p class="idl" style="margin: 2ch 0; line-height: 2;"></p>
</section>
<hr>
<section class="pos flex">
<section class="pos flex" style="margin: 2ch 0;">
<button class="put">编辑比赛信息</button>
<button class="preaid">添加参赛投稿</button>
<button class="preuid">投票</button>
</section>
</article>
</template>
<template id="imgl">
<article>
<section>
<a class="idnam"><code class="id" hidden></code> <span class="nam">参赛作品</span></a>
</section>
<hr>
<section class="imgl"></section>
</article>
</template>