A React-based virtual lock system for escape room games. Players discover locks by entering lock IDs and solve them by manipulating digit wheels.
- Game ID System: 5-character alphanumeric game IDs route to unique game pages
- Lock Discovery: Enter lock IDs to discover and add locks to your collection
- Multiple Lock Types:
- Number: Digits 0-9
- Alphabet: 8 characters per wheel (7 random + correct letter)
- Alpha-numeric: Mixed letters and numbers based on code position
- Interactive Digit Wheels:
- Arrow buttons for increment/decrement
- Drag up/down to change digits
- Smooth animations
- State Persistence: All progress saved to localStorage
- Attempt Limits: Configurable incorrect attempt limits with 5-minute lockout
- Lock Management: Hide/show locks, view lock images
- Escape Room Theme: Dark, mysterious UI with smooth animations
npm installnpm run devThe app will be available at http://localhost:5173
npm run buildThe data structure separates games and locks into two files:
1. Edit src/data/games.json to define games:
{
"GAME1": {
"game_id": "GAME1",
"lock_ids": ["LOCK1", "LOCK2", "LOCK3"]
},
"GAME2": {
"game_id": "GAME2",
"lock_ids": ["LOCK4", "LOCK5"]
}
}2. Edit src/data/locks.json to define locks:
{
"LOCK1": {
"id": "LOCK1",
"type": "number",
"subtype": 4,
"code": "1234",
"limit": 5
},
"LOCK2": {
"id": "LOCK2",
"type": "alphabet",
"subtype": 3,
"code": "KEY",
"image": "/images/lock2.jpg",
"limit": 3
},
"LOCK3": {
"id": "LOCK3",
"type": "alpha-numeric",
"subtype": 5,
"code": "A1B2C",
"limit": 5
}
}Note: Each game references locks by their lock_ids array. Locks can be shared across multiple games by including their ID in multiple games' lock_ids arrays.
- id: 5-character alphanumeric lock identifier (case-insensitive)
- type:
"number","alphabet", or"alpha-numeric" - subtype: Number of digits (3, 4, 5, or 6)
- code: The correct code to unlock
- image: (Optional) Path to lock image
- limit: (Optional) Maximum incorrect attempts before lockout
- Enter a game ID on the home page (e.g.,
GAME1) - Navigate to the game page
- Enter lock IDs as you discover them in the room
- Manipulate digit wheels to enter codes
- Click "Check Code" to verify
- Successfully unlocked locks show a green "UNLOCKED" badge
- Progress is automatically saved and persists across sessions
Click "Reset Game" to clear all progress for the current game (with confirmation).
src/
├── components/ # React components
├── pages/ # Page components
├── utils/ # Utility functions and types
├── data/ # Lock definitions (locks.json)
└── styles/ # Global styles
- React 18
- TypeScript
- Vite
- React Router
- localStorage for persistence
MIT