From b878a588e566b181c151b7904e576f668747da6e Mon Sep 17 00:00:00 2001 From: FreddyMSchubert Date: Sun, 17 Aug 2025 22:58:41 +0200 Subject: [PATCH] fix broken replay folder naming --- CLAUDE.md | 62 ------------------- .../{replays => misc}/replay_latest.json | 0 src/ts/main.ts | 2 +- 3 files changed, 1 insertion(+), 63 deletions(-) delete mode 100644 CLAUDE.md rename src/public/{replays => misc}/replay_latest.json (100%) diff --git a/CLAUDE.md b/CLAUDE.md deleted file mode 100644 index c123704..0000000 --- a/CLAUDE.md +++ /dev/null @@ -1,62 +0,0 @@ -# CLAUDE.md - -This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. - -## Development Commands - -- `npm run dev` - Start development mode with TypeScript watch compilation and local server -- `npm run serve` - Build TypeScript and serve on localhost:8080 -- `npm run build` - Compile TypeScript files to JavaScript - -## Code Architecture - -This is a game replay visualizer that renders animated playback of game states. The codebase follows a modular TypeScript architecture with three core components: - -### Core Architecture - -1. **Time Manager** (`src/ts/time_manager/timeManager.ts`) - - Controls playback state (play/pause/speed/navigation) - - Provides tick-based timing with animation progress (tickProgress 0-1) - - Handles keyboard shortcuts (spacebar=play/pause, arrows=navigation, r/s=start, e=end) - - Returns `tickData` containing current tick and animation progress - -2. **Replay Loader** (`src/ts/replay_loader/replayLoader.ts`) - - Loads and processes JSON replay files with differential state encoding - - Implements caching system for performance (default 25-tick intervals) - - Handles live reload detection via ETag headers - - Supports drag-and-drop file loading - - Provides `getStateAt(tick)` for full game state reconstruction - -3. **Renderer** (`src/ts/renderer/renderer.ts`) - - SVG-based grid rendering with smooth animations - - Interpolates object positions between ticks using sine wave progression - - Handles object scaling for spawn/death animations - - Interactive tooltips showing object details - - Asset management for different unit types and teams - -### Key Data Flow - -- Main.ts orchestrates module initialization: ReplayLoader → TimeManager → Renderer -- Renderer calls `getCurrentTickData()` each frame to get current timing -- Uses timing data to fetch game state and interpolate animations -- All animations are mathematical functions (sine waves) for smooth transitions - -### File Structure - -- `src/ts/` - TypeScript source files -- `src/public/js/` - Compiled JavaScript output -- `src/public/assets/` - SVG assets for game objects organized by type and team -- `src/public/misc/replay_latest.json` - Default replay file location - -### Configuration - -- TypeScript compiles from `src/ts/` to `src/public/js/` -- Uses ESNext modules with strict mode enabled -- Biome for linting, Prettier for formatting (devDependencies) -- Supports query parameter `?replay=path` to load custom replay files - -### Docker Support - -- Multi-architecture builds (AMD64/ARM64) -- GitHub Actions CI/CD with container registry publishing -- Nginx-based production deployment \ No newline at end of file diff --git a/src/public/replays/replay_latest.json b/src/public/misc/replay_latest.json similarity index 100% rename from src/public/replays/replay_latest.json rename to src/public/misc/replay_latest.json diff --git a/src/ts/main.ts b/src/ts/main.ts index 8371027..3de1641 100644 --- a/src/ts/main.ts +++ b/src/ts/main.ts @@ -1,7 +1,7 @@ const svgCanvas = document.getElementById('svg-canvas') as HTMLElement; window.addEventListener('DOMContentLoaded', async () => { - let replayFilePath = '/replays/replay_latest.json'; + let replayFilePath = '/misc/replay_latest.json'; const urlParams = new URLSearchParams(window.location.search); if (urlParams.has('replay')) { replayFilePath = urlParams.get('replay') || replayFilePath;