A web-based scoreboard application for the Dixit board game. This project addresses the common problem of lost game boards by providing a digital solution for manual score calculation, eliminating calculation errors and speeding up gameplay.
The Dixit Scoreboard Calculator is designed to replace the physical game board with a digital interface that automatically calculates scores according to Dixit game rules. It supports 3-8 players and provides a mobile-friendly interface for seamless gameplay.
- Player Management: Support for 3-8 players with customizable names and colors
- Score Tracking: Round-by-round score input with automatic total calculation
- Visual Progress Board: Interactive 30-point grid showing player positions with colored markers
- Victory Detection: Automatic winner announcement when a player reaches 30 points
- Game Reset: Easy game restart with confirmation dialog
- Mobile-First Design: Fully responsive interface optimized for mobile devices
- Interactive Background: Dynamic parallax background effect responding to mouse movement
- Color-Coded Players: Each player has a unique color that appears throughout the interface
- Visual Scoreboard: Grid-based layout showing player progress from 1-30 points
- Start Line Visualization: Special display showing player starting positions
- Real-time Updates: Instant score calculation and UI updates
- Input Validation: Score input handling with proper number parsing
- State Management: React hooks for efficient game state management
- Responsive Layout: Tailwind CSS for adaptive design across all devices
- Component Architecture: Modular, reusable components for maintainability
- Custom Hooks: Separated business logic for better code organization
- Frontend Framework: React.js 18.3.1
- Styling: Tailwind CSS 3.4.10
- UI Components: Material-UI (TextField, Button, Dialog)
- Icons: React Icons
- Build Tool: Vite 5.4.1
- Package Manager: npm
- Node.js (version 16 or higher)
- npm package manager
-
Clone the repository
git clone https://github.com/fastians/dixit-score-calculator.git cd dixit-score-calculator -
Install dependencies
npm install
-
Start development server
npm run dev
-
Open in browser Navigate to
http://localhost:5173(or the URL shown in terminal)
npm run build- Default Setup: The game starts with 3 players
- Add Players: Click "Add Player" to increase up to 8 players
- Remove Players: Click the red X icon to remove players (minimum 3)
- Customize:
- Click on player color circles to change colors
- Edit player names in the text fields
- Start Game: Click "Start Game" when ready
- Score Input: Enter round scores for each player in the number fields
- Submit Scores: Click "Submit Scores" to add round scores to totals
- Track Progress: Watch colored markers move across the 30-point grid
- Victory: When a player reaches 30 points, a winner popup appears
- Reset: Click the Dixit logo to restart the game
- Scoring: Standard Dixit scoring system
- Victory Condition: First player to reach 30 points wins
- Player Limits: 3-8 players supported
- Score Validation: Handles empty inputs as 0 points
The application is optimized for mobile devices with:
- Touch-friendly interface elements
- Responsive grid layouts
- Optimized button sizes
- Mobile-appropriate spacing and typography
- Dynamic Background: Parallax effect following mouse movement
- Color-Coded Players: Unique colors for easy player identification
- Progress Visualization: Visual grid showing player advancement
- Smooth Animations: Hover effects and transitions
- 30-Point Grid: Visual representation of game progress
- Player Markers: Colored circles showing current positions
- Start Line: Special display for player starting positions
- Score History: Round-by-round score tracking
src/
โโโ constants/
โ โโโ gameConfig.js # Game constants and configuration
โโโ hooks/
โ โโโ useGameState.js # Custom hook for game state management
โโโ utils/
โ โโโ gameUtils.js # Utility functions for positioning
โโโ components/
โ โโโ DixitScoreCalculator.jsx # Main component (orchestrator)
โ โโโ PlayerSetup.jsx # Player setup screen
โ โโโ GameScreen.jsx # Main game screen
โ โโโ ScoreGrid.jsx # Score grid component
โ โโโ ScoreTable.jsx # Score table component
โ โโโ GameDialogs.jsx # Winner and reset dialogs
โโโ App.jsx # Root application component
โโโ main.jsx # Application entry point
โโโ index.css # Global styles
- Modular Design: Each component has a single responsibility
- Reusable Components: Components can be tested and maintained independently
- Clean Separation: UI, logic, and state management are properly separated
- Custom Hook:
useGameStatemanages all game state and logic - Memoized Values: Performance optimizations with
useMemoanduseCallback - Centralized Logic: All game operations are handled in one place
- Centralized Config: All game settings in
gameConfig.js - Easy Maintenance: Game rules and limits can be modified in one place
- Type Safety: Clear structure for game configuration
- Positioning Logic: Separated player positioning calculations
- Reusable Functions: Common operations extracted for reuse
- Performance Optimized: Memoized calculations for smooth gameplay
- Main orchestrator component
- Handles routing between setup and game screens
- Manages background effects and layout
- Player configuration interface
- Add/remove player functionality
- Color and name customization
- Main game interface
- Coordinates scoreboard, grid, and table components
- Handles game flow and interactions
- Visual 30-point progress grid
- Player marker positioning
- Interactive grid cells
- Score input interface
- Player score history display
- Submit scores functionality
- Winner announcement dialog
- Game reset confirmation
- Consistent dialog styling
- Memoized calculations for player positions
- Optimized re-renders with
useCallback - Efficient state updates
- ARIA labels for screen readers
- Keyboard navigation support
- Semantic HTML structure
- Input validation for scores
- Graceful handling of edge cases
- User-friendly error messages
This project is open source and available under the MIT License.
Contributions are welcome! Please feel free to submit pull requests or open issues for bugs and feature requests.