Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions BASIC.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,14 @@ jobs:

内容:

- `/play` ルート作成
- `/$lang/$codeLanguage/play` ルート作成(例:`/ja/javascript/play`)
- GameState(score, combo, timer, currentLevel)
- 行タップ処理(当たり / 外れ)
- コンボ計算
- レベル進行(1→2→3)
- スキップ機能
- ゲーム終了処理(フロント内完結)
- レベル内のデータはランダムに選択

---

Expand Down Expand Up @@ -346,13 +347,14 @@ npm create cloudflare@latest -- my-react-router-app --framework=react-router

### 3.1 ルート一覧

| パス | 役割 |
| ---------------- | --------------------------------- |
| `/` | タイトル画面 |
| `/play` | ゲーム画面 |
| `/result/create` | ゲーム終了時のスコア登録 `action` |
| `/result/:id` | 結果画面(SSR、シェア用) |
| `/ranking` | ランキング一覧画面 |
| パス | 役割 |
| ------------------------------ | --------------------------------- |
| `/` | ルート(言語自動判定・リダイレクト) |
| `/$lang` | タイトル画面(例:`/ja`, `/en`) |
| `/$lang/$codeLanguage/play` | ゲーム画面(例:`/ja/javascript/play`) |
| `/result/create` | ゲーム終了時のスコア登録 `action` |
| `/result/:id` | 結果画面(SSR、シェア用) |
| `/ranking` | ランキング一覧画面 |

- ルート定義は `src/routes` 配下に作成する。

Expand Down
3 changes: 2 additions & 1 deletion app/components/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Link } from 'react-router';
import { SupportedLanguage, saveLanguage } from '../locales';
import type { SupportedLanguage } from '../locales';
import { saveLanguage } from '../locales';

interface HeaderProps {
currentLang: SupportedLanguage;
Expand Down
1 change: 1 addition & 0 deletions app/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ import { type RouteConfig, index, route } from '@react-router/dev/routes';
export default [
index('routes/_index.tsx'),
route(':lang', 'routes/$lang.tsx'),
route(':lang/:codeLanguage/play', 'routes/$lang.$codeLanguage.play.tsx'),
] satisfies RouteConfig;
Loading