diff --git a/README.md b/README.md index 60958c6..ac29fb6 100644 --- a/README.md +++ b/README.md @@ -30,12 +30,12 @@ go build ./cmd/acb-mapgen # Start web development server cd web && npm install && npm run dev -# Open http://localhost:3000/app.html +# Open http://localhost:3000/ ``` ### Viewing Replays -1. Open the web app at `http://localhost:3000/app.html` +1. Open the web app at `http://localhost:3000/` 2. Navigate to "Replay Viewer" in the menu 3. Load a replay JSON file or enter a URL diff --git a/cmd/acb-index-builder/deploy.go b/cmd/acb-index-builder/deploy.go index 6ddd6fc..2ea0835 100644 --- a/cmd/acb-index-builder/deploy.go +++ b/cmd/acb-index-builder/deploy.go @@ -107,16 +107,6 @@ func verifyMergedOutput(cfg *Config) error { slog.Warn("leaderboard.json not yet generated, deploying with partial data") } - // Ensure _redirects routes / → app.html so the main leaderboard app is the - // entry point. The replay viewer stays at /index.html for direct linking. - redirectsPath := filepath.Join(cfg.OutputDir, "_redirects") - if _, err := os.Stat(redirectsPath); err != nil { - redirectsContent := "/ /app.html 301\n" - if writeErr := os.WriteFile(redirectsPath, []byte(redirectsContent), 0644); writeErr != nil { - slog.Warn("Failed to write _redirects", "error", writeErr) - } - } - slog.Info("Merged output verified", "directory", cfg.OutputDir) return nil } diff --git a/web/index.html b/web/index.html index 595bfba..e34e038 100644 --- a/web/index.html +++ b/web/index.html @@ -3,498 +3,923 @@ - AI Code Battle - Replay Viewer + AI Code Battle + + + + + + + + + + + + + + -
-

AI Code Battle - Replay Viewer

+ + -
-

View Options

-
- - -
-
- - -
-
- -
-

Match Info

-
-
Match ID
-
-
-
Winner
-
-
-
Turns
-
-
-
Reason
-
-
-
-
- -
-

Events This Turn

-
-
No events
-
-
- -
- Space Play/Pause - Step - HomeEnd First/Last -
-
+ +
+
- - -
-
-

Turn-by-Turn Transcript

- -
-
- -
-

- Load a replay to view the transcript. -

-
-
-
- - +
+ + + diff --git a/web/pages.json b/web/pages.json index 80d41a5..5f74194 100644 --- a/web/pages.json +++ b/web/pages.json @@ -10,8 +10,8 @@ "root_dir": "web" }, "routes": { - "app": "app.html", - "replay_viewer": "index.html" + "app": "index.html", + "replay_viewer": "replay.html" }, "data_paths": { "pages_data": "https://aicodebattle.com/data", diff --git a/web/replay.html b/web/replay.html new file mode 100644 index 0000000..595bfba --- /dev/null +++ b/web/replay.html @@ -0,0 +1,500 @@ + + + + + + AI Code Battle - Replay Viewer + + + +
+

AI Code Battle - Replay Viewer

+ +
+
+
+ +
Load a replay file to view
+
+ +
+
+
+ + +
+
+ + + +
+
+

Turn-by-Turn Transcript

+ +
+
+ +
+

+ Load a replay to view the transcript. +

+
+
+
+ + + + diff --git a/web/vite.config.ts b/web/vite.config.ts index c7bf115..e0415da 100644 --- a/web/vite.config.ts +++ b/web/vite.config.ts @@ -9,7 +9,7 @@ export default defineConfig({ rollupOptions: { input: { main: resolve(__dirname, 'index.html'), - app: resolve(__dirname, 'app.html'), + replay: resolve(__dirname, 'replay.html'), embed: resolve(__dirname, 'embed.html'), }, output: {