# Mini Games Collection

从 GitHub 收集的开源静态 HTML5 小游戏，可直接部署到 Cloudflare Pages。

## 游戏列表（11 款）

| 目录 | 游戏 | 来源 | Demo |
|------|------|------|------|
| `2048/` | 2048 | [gabrielecirulli/2048](https://github.com/gabrielecirulli/2048) | 官方原版 |
| `pac-man/` | 吃豆人 | [talha #02](https://github.com/he-is-talha/html-css-javascript-games/tree/main/02-Pac-Man-Game) | [试玩](https://he-is-talha.github.io/html-css-javascript-games/02-Pac-Man-Game/) |
| `tetris/` | 俄罗斯方块 | [trzaskos/vanilla-js-tetris](https://github.com/trzaskos/vanilla-js-tetris) | — |
| `doodle-jump/` | 涂鸦跳跃 | [talha #04](https://github.com/he-is-talha/html-css-javascript-games/tree/main/04-Doodle-Jump-Game) | [试玩](https://he-is-talha.github.io/html-css-javascript-games/04-Doodle-Jump-Game/) |
| `crossy-road/` | 天天过马路 | [talha #07](https://github.com/he-is-talha/html-css-javascript-games/tree/main/07-Crossy-Road-Game) | [试玩](https://he-is-talha.github.io/html-css-javascript-games/07-Crossy-Road-Game/) |
| `wordle/` | Wordle | [talha #11](https://github.com/he-is-talha/html-css-javascript-games/tree/main/11-Wordle-Game) | [试玩](https://he-is-talha.github.io/html-css-javascript-games/11-Wordle-Game/) |
| `snake/` | 贪吃蛇 | [musthofa-kamaluddin/snake](https://github.com/musthofa-kamaluddin/snake) | — |
| `flappy-bird/` | Flappy Bird | [talha #09](https://github.com/he-is-talha/html-css-javascript-games/tree/main/09-Flappy-Bird-Game) | [试玩](https://he-is-talha.github.io/html-css-javascript-games/09-Flappy-Bird-Game/) |
| `brick-breaker/` | 打砖块 | [ChanMeng666/html-brick-game](https://github.com/ChanMeng666/html-brick-game) | — |
| `pong/` | 乒乓球 | [TheSecondChance/pong_game](https://github.com/TheSecondChance/pong_game) | — |
| `minesweeper/` | 扫雷 | [talha #16](https://github.com/he-is-talha/html-css-javascript-games/tree/main/16-Minesweeper-Game) | [试玩](https://he-is-talha.github.io/html-css-javascript-games/16-Minesweeper-Game/) |

## 升级说明

| 变更 | 说明 |
|------|------|
| 保留 | 2048、俄罗斯方块、贪吃蛇、打砖块、乒乓球 |
| 替换 | 扫雷（旧 1024B 版 → talha 完整版）、Flappy Bird（crypto 变体 → 经典版） |
| 新增 | 吃豆人、涂鸦跳跃、天天过马路、Wordle |
| 修复 | 移除 tetris 无效 Vercel analytics script；Flappy 图片改为 HTTPS |

新增游戏统一来自 [he-is-talha/html-css-javascript-games](https://github.com/he-is-talha/html-css-javascript-games)（MIT，234 stars）。

## 多语言

首页支持 **中文 / English** 切换（右上角按钮），选择会保存到浏览器。

- 中文：http://localhost:8080/?lang=zh
- English：http://localhost:8080/?lang=en

## 本地预览

```bash
cd mini-game
python3 -m http.server 8080
# 打开 http://localhost:8080
```

## 冒烟测试

```bash
# HTTP 检查（无需依赖）
./scripts/smoke-test.sh

# 浏览器检查（需本地安装 Playwright）
npx playwright install chromium
python3 -m http.server 8098 &
BASE_URL=http://127.0.0.1:8098 node scripts/browser-smoke.mjs
```

## 更新游戏

```bash
git clone --depth 1 --filter=blob:none --sparse \
  https://github.com/he-is-talha/html-css-javascript-games /tmp/talha-games
cd /tmp/talha-games
git sparse-checkout set <Game-Folder>
rsync -a /tmp/talha-games/<Game-Folder>/ mini-game/<target-dir>/
```
