nav: 三级导航分页结构 + 中国地区索引

- 02-game-design 地图结构重写:洲→国家→城市,3x3棋盘分页
- 中国 40 城按 8 地区分组(华北/东北/华东/华中/华南/西南/西北/港澳)
- 导航索引数据:continents/index + asia + regions/china + pagination工具

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
manpengan
2026-03-28 23:20:58 +08:00
parent 2d960632d6
commit faeb453a64
7 changed files with 355 additions and 21 deletions

View File

@@ -0,0 +1,14 @@
// 通用分页工具 — 将数组按 pageSize 分页
// 默认 pageSize = 93x3 棋盘)
export function paginate(items, pageSize = 9) {
const pages = []
for (let i = 0; i < items.length; i += pageSize) {
pages.push(items.slice(i, i + pageSize))
}
return pages
}
export function getPageCount(totalItems, pageSize = 9) {
return Math.ceil(totalItems / pageSize)
}