A modern, interactive browser-based Rock, Paper, Scissors game built with vanilla JavaScript and styled with CSS. Play against a computer opponent with a beautiful UI featuring SVG icons, animations, and real-time score tracking!
This project was created as part of The Odin Project curriculum.
- Open the
index.htmlfile in your web browser - Click one of the three buttons: Rock, Paper, or Scissors
- The computer will randomly choose its move with a loading animation
- Both choices are displayed with visual icons
- The winner of each round is determined by the classic rules:
- Rock beats Scissors
- Paper beats Rock
- Scissors beats Paper
- Scores are tracked and displayed on screen with a digital font
- Each round result is shown with colored alert messages
- The game continues indefinitely with automatic round resets
- Visual Interface: Beautiful UI with SVG icons for all choices and players
- Real-time Scoring: Digital scoreboard that updates automatically
- Interactive Feedback: Hover effects and visual choice previews
- Loading Animation: CSS-powered spinning loader for computer thinking
- Alert Messages: Color-coded win/lose/draw notifications
- Responsive Design: Mobile-friendly layout with CSS media queries
- Smooth Animations: Timed transitions between rounds
- Modular Code: ES6 modules for clean code organization
- HTML5: Semantic structure and accessibility
- CSS3: Modern styling, animations, flexbox, and media queries
- JavaScript (ES6+): Modules, event handling, and DOM manipulation
- SVG Icons: Scalable vector graphics for crisp visuals
- Custom Fonts: Digital clock font for retro scoreboard styling
rockPaperScissorsTop/
│
├── index.html # Main HTML file with game interface
├── README.md # Project documentation
├── digital-font/ # Custom font files
│ └── readme.txt
└── static/
├── css/
│ ├── style.css # Main styles and responsive design
│ └── loader.css # CSS loading animation
└── js/
├── script.js # Main game controller and UI logic
├── gameLogic.js # Game rules and computer AI
└── svgIcons.js # SVG icon definitions
The game architecture uses modern JavaScript practices:
getComputerChoice(): Randomly selects rock, paper, or scissors for the computergetWinner(human, computer): Determines round winner based on classic rules- Event-driven gameplay: Button clicks trigger rounds with proper state management
- Round state control: Prevents multiple clicks during computer "thinking"
- Visual feedback system: Icons update to show both player and computer choices
- Score persistence: Scores maintained throughout the session
-
Clone this repository:
git clone https://github.com/AnaLuizanc/rockPaperScissorsTop.git
-
Navigate to the project directory:
cd rockPaperScissorsTop -
Open
index.htmlin your preferred web browser:# On Mac/Linux open index.html # On Windows start index.html # Or simply double-click the index.html file
No build process or dependencies required - it's pure vanilla JavaScript!
- SVG Icons: All game icons are embedded as SVG for crisp display at any size
- Digital Scoreboard: Uses a custom digital font for retro arcade feel
- Loading Animation: Pure CSS spinning animation while computer "thinks"
- Alert System: Color-coded feedback (green for wins, red for losses)
- Responsive Design: Adapts layout for mobile devices
- Hover Previews: See your choice before clicking
This project is open source and available for educational purposes as part of The Odin Project curriculum.
AnaLuizanc
- GitHub: @AnaLuizanc
Made with ❤️ as part of The Odin Project curriculum