An implementation of the classic 2048 puzzle game built with React, TypeScript, and Vite.
- Classic 2048 gameplay
- Touch/swipe controls for mobile devices powered by Motion
- Keyboard controls for desktop (arrow keys)
- Responsive design that works on all screen sizes
- Game state management with score tracking and win/lose detection
- Tech stack: React, TypeScript, Vite, Tailwind CSS
- Comprehensive testing with Vitest and Playwright
- Code quality tools: ESLint and Prettier for linting and formatting
- Automated dependency updates with Renovate
- Node.js (see
mise.tomlfor version requirements) - pnpm package manager
pnpm installStart the development server:
pnpm devThe game will be available at http://localhost:5173
- Desktop: Use arrow keys to move tiles
- Mobile: Swipe in any direction to move tiles
- Goal: Combine tiles with the same number to reach 2048
- Controls:
- Arrow keys or swipe gestures to move tiles
- "New Game" button to restart
- "Reset Game" button to start over anytime
Build for production:
pnpm buildPreview the production build:
pnpm previewRun unit tests:
pnpm testRun end-to-end tests:
pnpm test:e2eCheck code style and issues:
pnpm lintFix code style issues:
pnpm fixMIT