v0.5.85: move matches page summary next to pager.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
voson
2026-07-29 18:36:22 +08:00
co-authored by Cursor
parent b01552ee6e
commit ef31e43d6c
6 changed files with 56 additions and 28 deletions
+27 -19
View File
@@ -3732,7 +3732,6 @@ function renderMatchesPage() {
const body = $("#matches-body");
const originsEl = $("#matches-origins");
const playersEl = $("#matches-players");
const sub = $("#matches-sub");
if (!body) return;
const origin = MATCH_ORIGIN_FILTERS.some((o) => o.id === state.matchesOrigin)
@@ -3813,7 +3812,6 @@ function renderMatchesPage() {
if (!hasData) {
body.innerHTML =
'<div class="rankings-empty">暂无比赛数据(请运行 python web/fetch_pro_matches.py</div>';
if (sub) sub.textContent = "";
return;
}
@@ -3837,12 +3835,9 @@ function renderMatchesPage() {
}
const start = (page - 1) * pageSize;
const rows = allRows.slice(start, start + pageSize);
if (sub) {
sub.textContent = total
? `${total} 场 · 第 ${page}/${pageCount}`
: "";
}
const summary = total
? `${total} 场 · 第 ${page}/${pageCount}`
: "";
if (!rows.length) {
body.innerHTML = state.matchesPlayerId
@@ -3854,20 +3849,33 @@ function renderMatchesPage() {
const wrap = document.createElement("div");
wrap.className = "matches-page-wrap";
wrap.appendChild(buildMatchList(null, rows, { showHero: true }));
if (pageCount > 1) {
wrap.appendChild(
buildMatchesPager(page, pageCount, (next) => {
state.matchesPage = next;
syncStateToUrl();
renderMatchesPage();
const board = $("#matches-view");
if (board) board.scrollTop = 0;
})
);
}
wrap.appendChild(
buildMatchesFoot(summary, page, pageCount, (next) => {
state.matchesPage = next;
syncStateToUrl();
renderMatchesPage();
const board = $("#matches-view");
if (board) board.scrollTop = 0;
})
);
body.replaceChildren(wrap);
}
function buildMatchesFoot(summaryText, page, pageCount, onGo) {
const foot = document.createElement("div");
foot.className = "matches-foot";
if (summaryText) {
const summary = document.createElement("p");
summary.className = "matches-foot-summary";
summary.textContent = summaryText;
foot.appendChild(summary);
}
if (pageCount > 1) {
foot.appendChild(buildMatchesPager(page, pageCount, onGo));
}
return foot;
}
function buildMatchesPager(page, pageCount, onGo) {
const nav = document.createElement("nav");
nav.className = "matches-pager";
+1 -1
View File
@@ -1,4 +1,4 @@
/* Local defaults; production export overwrites via export_relations_site.py. */
var SITE_VERSION = "0.5.84";
var SITE_VERSION = "0.5.85";
var ABILITY_VIDEO_BASE = "";
var STATIC_ASSET_BASE = "";
+5 -6
View File
@@ -5,8 +5,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>DOTA2 上分帝</title>
<link rel="icon" href="/ui-icon/dota2_logo.png" type="image/png" />
<link rel="stylesheet" href="/style.css?v=0.5.84" />
<script src="/mobile-gate.js?v=0.5.84"></script>
<link rel="stylesheet" href="/style.css?v=0.5.85" />
<script src="/mobile-gate.js?v=0.5.85"></script>
</head>
<body>
<div id="mobile-gate" class="mobile-gate" role="dialog" aria-labelledby="mobile-gate-title" aria-modal="true">
@@ -91,7 +91,6 @@
<aside class="rankings-aside" aria-label="比赛筛选">
<div class="matches-origins" id="matches-origins" role="tablist" aria-label="职业或国服"></div>
<div class="matches-players" id="matches-players" role="tablist" aria-label="选择选手"></div>
<p class="rankings-sub" id="matches-sub"></p>
</aside>
</div>
</div>
@@ -166,8 +165,8 @@
<section class="detail" id="detail" aria-live="polite"></section>
<script src="/config.js?v=0.5.84"></script>
<script src="/router.js?v=0.5.84"></script>
<script src="/app.js?v=0.5.84"></script>
<script src="/config.js?v=0.5.85"></script>
<script src="/router.js?v=0.5.85"></script>
<script src="/app.js?v=0.5.85"></script>
</body>
</html>
+16 -1
View File
@@ -2653,13 +2653,28 @@ body:has(#items-view:not(.hidden)) {
gap: 16px;
width: 100%;
}
.matches-foot {
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
padding: 4px 0 8px;
}
.matches-foot-summary {
margin: 0;
font-size: 13px;
font-weight: 500;
color: var(--muted);
line-height: 1.4;
text-align: center;
}
.matches-pager {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
gap: 6px;
padding: 4px 0 8px;
padding: 0;
}
.matches-pager-btn {
min-width: 36px;