Commit Graph

12 Commits

Author SHA1 Message Date
e017a87e12 fix(web): prevent stopGame from being called on non-game page transitions
Only stop the game when navigating away from the game page (/) to avoid
WASM runtime errors when navigating between /leaderboard and /download.
Add error handling to gracefully handle crashes during page transitions.
2025-12-29 14:53:42 -06:00
8d3d69da9d feat(web): add cache busting with version-based asset loading
- Inject git hash via Vite plugin for cache-busting WASM/JS assets
- Enable Emscripten assertions for better runtime error messages
- Log Emscripten runtime init for debugging filesystem readiness
- Expand dockerignore to exclude web build artifacts
2025-12-29 14:27:52 -06:00
3bb3908853 feat(web): add smooth page transitions and WASM loading states
- Implement navigation state tracking with optimistic UI updates
- Add loading spinner and error handling for WASM initialization
- Insert browser yield points during game initialization to prevent freezing
- Redesign leaderboard with tabbed navigation and mock data structure
- Add utility CSS classes for consistent page layouts
2025-12-29 03:33:43 -06:00
65a9c6bab9 feat(web): redesign navigation with centered logo and smooth page transitions
- Replace sidebar nav with centered header featuring PAC-MAN title
- Add glimmer animation effect for non-active logo state
- Implement 200ms fade transitions between pages
- Add custom scrollbar styling with OverlayScrollbars
- Switch to Russo One font for title, Outfit for body text
2025-12-29 02:53:55 -06:00
5e86bbb040 feat(web): implement game lifecycle management for SPA navigation
Add stop_game and restart_game FFI functions to properly pause/resume the game loop during page transitions, preventing resource leaks and audio issues when navigating between pages
2025-12-29 02:06:15 -06:00
fc349c45c5 fix(web): implement browser autoplay policy compliance with click-to-start
Add WaitingForInteraction game stage and Suspended audio state for Emscripten builds.
Audio unlocks and game starts after user clicks or presses any key, satisfying browser
autoplay restrictions while maintaining immediate playback on desktop.
2025-12-29 00:41:31 -06:00
Ryan Walters
cb50ade88f fix(web): resolve leaderboard production crashes by removing react-animated-numbers
Remove react-animated-numbers dependency which caused production-only crashes due to CommonJS/ESM interop issues with Vite's production bundler. Replace animated score displays with simple toLocaleString() formatting.

Also add missing +config.ts to disable SSR for the leaderboard page, fixing 307 redirect loop caused by SSR/prerender configuration mismatch.

Changes:
- Remove react-animated-numbers from package.json
- Add web/pages/leaderboard/+config.ts with ssr: false
- Replace AnimatedNumbers component with direct number formatting
- Simplify leaderboard score display (no animation, instant render)
2025-11-23 01:21:02 -06:00
Ryan Walters
c306e992c4 fix(game): resolve race condition in render dirty flag using bitwise OR
The render dirty flag was being reset instead of accumulated, causing
the game to become stuck and unplayable in web builds. Changed from
assignment to bitwise OR to preserve all dirty state updates.

Also adds game layout component and updates Justfile to build frontend.
2025-11-22 21:14:24 -06:00
Ryan Walters
e00d209047 fix(web): enable prerendering for static deployment
Enable prerendering to generate index.html during build while keeping SSR disabled for Emscripten/WASM compatibility. This allows static hosting platforms to serve the application correctly.
2025-11-22 18:30:09 -06:00
Ryan Walters
45e6131121 feat: implement unified deployment with Docker and Railway integration
This commit introduces a comprehensive deployment strategy that unifies the frontend and backend into a single Docker container served by the Rust backend, streamlining the deployment process and improving production architecture.

Key changes:
- Split CI/CD workflows: separated build.yaml (for CI/PR checks) and deploy.yaml (for production deployment)
- Implemented unified Docker deployment where the Axum server serves both API routes (under /api) and frontend static files
- Added GitHub Container Registry integration for Docker image distribution
- Updated Railway configuration to use the new healthcheck path (/api/health)
- Enhanced postgres.ts script with named volumes and constants for better container management
- Added API client utilities (web/lib/api.ts) and environment configuration (web/.env.example) for frontend-backend communication
- Configured Vite proxy for local development while supporting same-origin requests in production
- Updated Dockerfile to include frontend static files and proper environment variable handling

This architecture eliminates the need for separate deployments and CORS configuration, as the frontend and API are served from the same origin.
2025-11-02 19:31:22 -06:00
Ryan Walters
fb98c077b5 refactor(web): migrate frontend to Tailwind CSS and Vike SSR
- Replace Mantine UI components with Tailwind CSS v4
- Migrate from static HTML to Vike-based SSR framework
- Disable SSR for game page (Emscripten requires browser environment)
- Simplify Emscripten loading to avoid hydration conflicts
- Remove Tailwind download logic from web.build.ts
- Add package manager lockfiles for reproducible builds
- Update .gitignore for node_modules and build artifacts
2025-11-02 13:39:51 -06:00
Ryan Walters
55b31ba31e feat: setup 'web' frontend 2025-09-25 12:37:21 -05:00