How evafung/mini-memory-game works
Mini Memory Game is a browser-only React game: the player starts a round, watches a generated shape sequence, repeats it before time expires, and progresses through increasingly difficult rounds for score bonuses. The app also provides settings, audio/haptic feedback, and a personal leaderboard stored locally. App.tsx is the documented screen and transition coordinator. Several component and service links are supported by the source index, but their runtime call sites were not excerpted; those links are marked dashed and unverified.
Main entry points: App.tsx Game screens · PersonalLeaderboard.tsx Leaderboard screen · useGameAudio.ts Game audio · SettingsPage.tsx Settings screen
Components 17
Game flow
- Game screens
src/App.tsx - Sequence and scoring
src/game/engine.ts
Player experience
- Shape graphics
src/components/ShapeIcons.tsx - Home navigation
src/components/HomeNavigation.tsx - Page header
src/components/PageHeader.tsx - Game audio
src/game/useGameAudio.ts - Haptic feedback
src/services/hapticService.ts - Reduced-motion preference
src/hooks/usePrefersReducedMotion.ts
Settings and records
- Settings screen
src/components/SettingsPage.tsx - Leaderboard screen
src/components/PersonalLeaderboard.tsx - Relative time
src/components/formatRelativeTime.ts - Settings persistence
src/services/settingsService.ts - Leaderboard records
src/services/leaderboardService.ts
Browser services
- Browser local storage
- Browser audio
- Device vibration
Other components
- Player
Connections 21
- Player → Game screens: plays
README.md - Game screens → Sequence and scoring: generates sequences
src/App.tsx - Game screens → Haptic feedback: triggers feedback
src/App.tsx - Game screens → Settings persistence: saves settings
src/App.tsx - Game screens → Shape graphics: renders shapes
src/App.tsx - Game screens → Home navigation: shows navigation
src/App.tsx - Game screens → Settings screen: shows settings
src/App.tsx - Game screens → Leaderboard screen: shows leaderboard
src/App.tsx - Game screens → Game audio: uses audio
src/App.tsx - Game screens → Reduced-motion preference: checks preference
src/App.tsx - Home navigation → Shape graphics: renders icons
src/components/HomeNavigation.tsx - Settings screen → Page header: renders header
src/components/SettingsPage.tsx - Settings screen → Shape graphics: renders icons
src/components/SettingsPage.tsx - Leaderboard screen → Page header: renders header
src/components/PersonalLeaderboard.tsx - Leaderboard screen → Relative time: formats dates
src/components/PersonalLeaderboard.tsx - Leaderboard screen → Leaderboard records: displays entries
src/components/PersonalLeaderboard.tsx - Settings persistence → Browser local storage: reads and writes
src/services/settingsService.ts - Leaderboard records → Browser local storage: reads and writes
src/services/leaderboardService.ts - Game audio → Settings persistence: uses settings
src/game/useGameAudio.ts - Game audio → Browser audio: plays sounds
src/game/useGameAudio.ts - Haptic feedback → Device vibration: requests vibration
src/services/hapticService.ts