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
This commit is contained in:
2025-12-29 03:33:43 -06:00
parent d3514b84e9
commit 3bb3908853
22 changed files with 602 additions and 328 deletions
+3 -3
View File
@@ -1,10 +1,10 @@
import type { OnPageTransitionEndAsync } from "vike/types";
import { getPacmanWindow } from "@/lib/pacman";
import { setPendingNavigation } from "@/lib/navigation";
export const onPageTransitionEnd: OnPageTransitionEndAsync = async (
pageContext
) => {
export const onPageTransitionEnd: OnPageTransitionEndAsync = async (pageContext) => {
console.log("Page transition end");
setPendingNavigation(null);
document.querySelector("body")?.classList.remove("page-is-transitioning");
// Restart the game loop when returning to the game page