fix(web): center active filters and compact mobile cards

This commit is contained in:
kairee committed 2026-10-31 23:50:19 +08:00
1 parent d18ebbfb2f
commit 60d7b0f24f
6 files changed
+25 -5

No files matched your search

+9
View File
@@ -127,6 +127,15 @@ export function metricChips(metrics, active, dataName = "metric") {
)).join("");
}
export function centerActiveChips(root) {
root.querySelectorAll(".chip-row.scroll-x").forEach((row) => {
const active = row.querySelector(".chip.active");
if (!active) return;
const target = active.offsetLeft - row.clientWidth / 2 + active.clientWidth / 2;
row.scrollLeft = Math.max(0, target);
});
}
export function pager(page, pages) {
if (!pages || pages <= 1) return "";
return `<div class="pager">