A fully rule-compliant chess engine built from scratch using HTML, CSS, and Vanilla JavaScript.
This project implements real chess rules with a clean architecture that separates engine logic from UI rendering.
(You can deploy this using GitHub Pages)
👉 Live Demo Link: [https://harshv2608.github.io/Chess_game/]
- Full piece movement validation
- Turn-based gameplay
- Prevents illegal moves
- Self-check prevention
- Check detection
- Checkmate detection
- Stalemate detection
- Castling (King-side & Queen-side with proper validation)
- En Passant
- Pawn Promotion (UI-based modal selection)
- Undo system (restores full board state)
- Move history sidebar
- Last move highlighting
- King-in-check highlighting
- Modern responsive chess board
- Equal-sized grid squares using CSS Grid
- Professional typography
- Clean dark-themed side panel
- Smooth hover animations
- Highlight indicators using border effects (not background override)
The project is structured around a clean separation of concerns:
- 2D board representation
- Central move validation system
- Check detection through board simulation
- Castling rights tracking
- En passant target tracking
- Full game state serialization for undo
- DOM-based board rendering
- Dynamic square highlighting
- Promotion modal overlay
- Move history display
The engine is completely independent of the UI logic.
- HTML5
- CSS3 (Grid, Flexbox, Modern Styling)
- Vanilla JavaScript (ES6+)
- No external chess libraries
- No frameworks
Everything is implemented manually from scratch.
This project demonstrates understanding of:
- Data structures (2D arrays for board state)
- State management
- Algorithmic move validation
- Simulation-based rule enforcement
- Event-driven programming
- DOM manipulation
- Clean UI architecture
- Game logic implementation
- Clone the repository:
git clone https://github.com/Harshv2608/Chess_game.git- Open the project folder.
- Launch
index.htmlin your browser.
No installation or dependencies required.
- Drag-and-drop piece movement
- Chess timers
- AI opponent (Minimax algorithm)
- PGN export
- FEN import/export
- Online multiplayer (WebSockets)
- Sound effects
- Theme switcher (Classic / Modern / Neon)
Harsh Vardhan
If you found this project interesting or helpful, consider giving it a ⭐ on GitHub.
This project is open-source and available under the MIT License.