feat(web): unify home published/growth cards with heat-strip vertical layout

This commit is contained in:
kairee committed 2026-11-01 17:18:42 +08:00
1 parent 59fa38b6e3
commit e40905da24
6 files changed
+57 -26

No files matched your search

+10
View File
@@ -120,6 +120,16 @@ export function metricGrid(item) {
</div>`;
}
export function mediaCard(item, { rank = null, meta = "", highlight = "" } = {}) {
return `<a class="media-card" href="/video/${item.aid}" data-aid="${item.aid}">
${rank === null || rank === undefined ? "" : `<span class="media-rank">${escapeHtml(String(rank))}</span>`}
${cover(item, "media-thumb")}
<strong class="media-title">${escapeHtml(item.title || "(无标题)")}</strong>
${meta ? `<span class="media-meta">${meta}</span>` : ""}
${highlight ? `<span class="media-highlight">${highlight}</span>` : ""}
</a>`;
}
export function sectionHeader(title, extra = "") {
return `<div class="section-head"><h2>${escapeHtml(title)}</h2>${extra}</div>`;
}