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,70 @@
export function createLevelPresets(seedBase) {
return [
{
id: 1,
difficultyTier: 'intro',
seedBase: seedBase + 1,
elementCount: 6,
piecesPerElement: 3,
layers: 2,
density: 'low',
targetPassRate: 0.95,
targetDurationSec: [90, 150],
},
{
id: 2,
difficultyTier: 'warmup',
seedBase: seedBase + 2,
elementCount: 7,
piecesPerElement: 3,
layers: 2,
density: 'low',
targetPassRate: 0.9,
targetDurationSec: [100, 160],
},
{
id: 3,
difficultyTier: 'ramp',
seedBase: seedBase + 3,
elementCount: 8,
piecesPerElement: 3,
layers: 3,
density: 'medium',
targetPassRate: 0.8,
targetDurationSec: [120, 180],
},
{
id: 4,
difficultyTier: 'mid',
seedBase: seedBase + 4,
elementCount: 9,
piecesPerElement: 3,
layers: 3,
density: 'medium',
targetPassRate: 0.7,
targetDurationSec: [130, 190],
},
{
id: 5,
difficultyTier: 'hard',
seedBase: seedBase + 5,
elementCount: 10,
piecesPerElement: 3,
layers: 4,
density: 'medium_high',
targetPassRate: 0.6,
targetDurationSec: [150, 220],
},
{
id: 6,
difficultyTier: 'boss',
seedBase: seedBase + 6,
elementCount: 10,
piecesPerElement: [3, 3, 3, 3, 3, 6, 3, 3, 3, 3],
layers: 4,
density: 'high',
targetPassRate: 0.55,
targetDurationSec: [180, 260],
},
]
}

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