Thanks to visit codestin.com
Credit goes to github.com

Skip to content

salujayatharth/othello

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ”ดโšซ Othello Game

GitHub Pages HTML5 CSS3 JavaScript Tailwind CSS

A modern, responsive implementation of the classic Othello (Reversi) board game with beautiful animations.

๐ŸŽฎ Play Now

๐Ÿš€ Live Demo

โœจ Features

  • ๐ŸŽฏ Classic Othello Gameplay - Full implementation of traditional Othello rules
  • ๐Ÿ“ฑ Responsive Design - Perfect on desktop, tablet, and mobile devices
  • ๐Ÿ’ก Move Hints - Toggle-able valid move indicators for beginners
  • โšก Smooth Animations - Fluid piece placement and flipping animations
  • ๐ŸŽจ Modern UI - Clean, professional interface built with Tailwind CSS
  • ๐Ÿ”„ New Game - Quick restart functionality
  • ๐Ÿ” Reset Game - Quickly undo all moves back to initial state without animation
  • ๐Ÿ“Š Live Score Tracking - Real-time score updates for both players
  • ๐ŸŽช Turn Indicators - Clear visual indication of current player with breathing animations
  • โ†ถโ†ท Undo/Redo - Full move history with undo and redo functionality
  • ๐Ÿ’พ Local Storage - Automatic game state saving, sound preferences, and settings persistence
  • ๐Ÿ”Š Sound Effects - Audio feedback for piece placement with toggle control
  • ๐Ÿ“ฑ Fullscreen Mode - Mobile fullscreen toggle for immersive gameplay experience
  • ๐Ÿ”ง Progressive Web App - Install the game as a native-like app, works offline

๐ŸŽฏ How to Play

Othello (also known as Reversi) is a strategy board game for two players. Here's how to play:

Objective

Have the majority of your colored pieces on the board when the game ends.

Rules

  1. Starting Position: The game begins with 4 pieces in the center - two black and two white arranged diagonally
  2. Taking Turns: Black always goes first, then players alternate turns
  3. Valid Moves: You must place your piece adjacent to an opponent's piece, with at least one of your pieces on the opposite side (horizontally, vertically, or diagonally)
  4. Capturing: All opponent pieces between your new piece and existing piece get flipped to your color
  5. Passing: If you have no valid moves, your turn is skipped
  6. Game End: When the board is full or no valid moves exist for either player
  7. Winner: Player with the most pieces on the board wins

Controls

  • Click any highlighted cell to place your piece
  • New Game button to restart
  • Reset button to quickly undo all moves back to initial state
  • Show valid moves checkbox to toggle move hints
  • Undo (โ†ถ) and Redo (โ†ท) buttons to navigate move history
  • Sound toggle (๐Ÿ”Š/๐Ÿ”‡) button to enable/disable audio effects
  • Fullscreen toggle (๐Ÿ“ฑ/๐Ÿ”ณ) button for mobile immersive experience

๐Ÿ› ๏ธ Technology Stack

  • Frontend: HTML5, CSS3, JavaScript (ES6+)
  • Styling: Tailwind CSS
  • Fonts: Inter (Google Fonts)
  • PWA: Service Worker, Web App Manifest
  • Deployment: GitHub Pages
  • CI/CD: GitHub Actions

๐Ÿš€ Local Development

Prerequisites

  • A modern web browser
  • Basic web server (optional, for local development)

Quick Start

  1. Clone the repository

    git clone https://github.com/salujayatharth/othello.git
    cd othello
  2. Open in browser

    # Option 1: Direct file opening
    open index.html
    
    # Option 2: Local server (recommended)
    python -m http.server 8000
    # or
    npx serve .
  3. Access the game

    • Direct file: file:///path/to/othello/index.html
    • Local server: http://localhost:8000

Development Notes

  • No build process required - it's a pure client-side application
  • All game logic is contained in index.html
  • Responsive design works on all screen sizes

๐Ÿ“ฑ Progressive Web App (PWA)

This Othello game is a fully-featured Progressive Web App with the following capabilities:

Installation

  • Install on Mobile: Open in Chrome/Safari and tap "Add to Home Screen"
  • Install on Desktop: Look for the install icon in the address bar or use the install prompt

Features

  • ๐Ÿ“ด Offline Play: Game works completely offline after first visit
  • ๐Ÿ  App-like Experience: Launches in standalone mode without browser UI
  • ๐Ÿ”„ Auto-updates: New versions are cached and updated automatically
  • ๐Ÿ’พ Persistent Storage: Game state is saved even when offline
  • ๐ŸŽจ Native Theming: Matches your device's theme and provides proper app icons

PWA Files

  • manifest.json - App configuration and metadata
  • sw.js - Service Worker for offline functionality
  • icons/ - App icons for different devices and sizes

๐Ÿ“ Project Structure

othello/
โ”œโ”€โ”€ index.html          # Complete game implementation
โ”œโ”€โ”€ main.js            # Main game logic and PWA functionality
โ”œโ”€โ”€ AudioManager.js    # Audio management system
โ”œโ”€โ”€ style.css          # Custom styles and animations
โ”œโ”€โ”€ manifest.json      # PWA manifest configuration
โ”œโ”€โ”€ sw.js             # Service Worker for offline functionality
โ”œโ”€โ”€ favicon.ico       # App favicon
โ”œโ”€โ”€ drop.mp3          # Sound effect file
โ”œโ”€โ”€ icons/            # PWA app icons (various sizes)
โ”œโ”€โ”€ README.md         # This file
โ””โ”€โ”€ .github/
    โ””โ”€โ”€ workflows/
        โ””โ”€โ”€ static.yml # GitHub Pages deployment

๐ŸŽจ Design Features

  • Color Scheme: Professional green game board with contrasting pieces
  • Typography: Inter font family for clean, modern text
  • Animations: CSS keyframes for smooth piece placement
  • Responsive Grid: CSS Grid for perfect board scaling
  • Hover Effects: Interactive feedback for better UX

๐Ÿค Contributing

Contributions are welcome! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Ideas for Contributions

  • ๐Ÿค– AI opponent implementation
  • ๐Ÿ“Š Game statistics and history
  • ๐ŸŽต Background music
  • ๐Ÿ† Achievement system
  • ๐ŸŒ Multiplayer support

๐Ÿ“ License

This project is open source and available under the MIT License.

๐Ÿ™ Acknowledgments

  • Classic Othello game rules and design inspiration
  • Tailwind CSS for the excellent utility-first framework
  • Google Fonts for the beautiful Inter typeface
  • GitHub Pages for free hosting

Credits


Enjoy playing Othello! ๐ŸŽฎ

โญ Star this repo if you found it helpful!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •