├── .gitignore ├── .parcel-cache ├── 0f817512aa19eef7.txt ├── 164e3ff2ed7520e8 ├── 1d11806abf58443d ├── 37dbec41244c32ee.txt ├── 7c901be8e1fcacd1 ├── 839725f60ad82a5f ├── a9f5484dda8bfe2c ├── be421f5ad77beb1a ├── data.mdb ├── faf76a89a5ae82aa └── lock.mdb ├── README.md ├── dist └── index.html ├── package-lock.json ├── package.json └── src ├── App.js ├── components ├── Footer.js ├── Game.js ├── Header.js ├── Modal.js └── Play.js ├── images ├── bg-pentagon.svg ├── bg-triangle.svg ├── favicon-32x32.png ├── icon-close.svg ├── icon-lizard.svg ├── icon-paper.svg ├── icon-rock.svg ├── icon-scissors.svg ├── icon-spock.svg ├── image-rules-bonus.svg ├── image-rules.svg ├── logo-bonus.svg └── logo.svg ├── index.html ├── index.js ├── scss ├── _footer.scss ├── _game.scss ├── _globals.scss ├── _header.scss ├── _mixins.scss ├── _modal.scss ├── _play.scss └── _variables.scss ├── style-guide.md └── styles.scss /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | .cache/ 3 | coverage/ 4 | dist/* 5 | !dist/index.html 6 | node_modules/ 7 | *.log 8 | 9 | # OS generated files 10 | .DS_Store 11 | .DS_Store? 12 | ._* 13 | .Spotlight-V100 14 | .Trashes 15 | ehthumbs.db 16 | Thumbs.db 17 | -------------------------------------------------------------------------------- /.parcel-cache/164e3ff2ed7520e8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebucks27/ReactJs-rock-paper-scissors-game/7f2c97a833d5a051f27f01d6119652b3d9d2cdbb/.parcel-cache/164e3ff2ed7520e8 -------------------------------------------------------------------------------- /.parcel-cache/1d11806abf58443d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebucks27/ReactJs-rock-paper-scissors-game/7f2c97a833d5a051f27f01d6119652b3d9d2cdbb/.parcel-cache/1d11806abf58443d -------------------------------------------------------------------------------- /.parcel-cache/7c901be8e1fcacd1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebucks27/ReactJs-rock-paper-scissors-game/7f2c97a833d5a051f27f01d6119652b3d9d2cdbb/.parcel-cache/7c901be8e1fcacd1 -------------------------------------------------------------------------------- /.parcel-cache/839725f60ad82a5f: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebucks27/ReactJs-rock-paper-scissors-game/7f2c97a833d5a051f27f01d6119652b3d9d2cdbb/.parcel-cache/839725f60ad82a5f -------------------------------------------------------------------------------- /.parcel-cache/a9f5484dda8bfe2c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebucks27/ReactJs-rock-paper-scissors-game/7f2c97a833d5a051f27f01d6119652b3d9d2cdbb/.parcel-cache/a9f5484dda8bfe2c -------------------------------------------------------------------------------- /.parcel-cache/be421f5ad77beb1a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebucks27/ReactJs-rock-paper-scissors-game/7f2c97a833d5a051f27f01d6119652b3d9d2cdbb/.parcel-cache/be421f5ad77beb1a -------------------------------------------------------------------------------- /.parcel-cache/data.mdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebucks27/ReactJs-rock-paper-scissors-game/7f2c97a833d5a051f27f01d6119652b3d9d2cdbb/.parcel-cache/data.mdb -------------------------------------------------------------------------------- /.parcel-cache/faf76a89a5ae82aa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebucks27/ReactJs-rock-paper-scissors-game/7f2c97a833d5a051f27f01d6119652b3d9d2cdbb/.parcel-cache/faf76a89a5ae82aa -------------------------------------------------------------------------------- /.parcel-cache/lock.mdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebucks27/ReactJs-rock-paper-scissors-game/7f2c97a833d5a051f27f01d6119652b3d9d2cdbb/.parcel-cache/lock.mdb -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Build Rock, Paper and Scissors Game with React JS 2 | 3 | This repository contains code for rock,paper and scissors game in reactjs. 4 | 5 | View Demo: 6 | [React.js Rock Paper Scissors Game](https://react-js-rock-paper-scissors-game.vercel.app/) 7 | 8 | If you want to learn how to create it please follow below tutorial: 9 | 10 | https://youtu.be/tCSaSDgz2Hw 11 | 12 | ## Building and running on localhost 13 | 14 | First install dependencies: 15 | 16 | ```sh 17 | npm install 18 | ``` 19 | 20 | To run in hot module reloading mode: 21 | 22 | ```sh 23 | npm start 24 | ``` 25 | 26 | To create a production build: 27 | 28 | ```sh 29 | npm run build-prod 30 | ``` 31 | 32 | ## Runningg 33 | 34 | Open the file `dist/index.html` in your browser 35 | 36 | ## Credits 37 | 38 | Made with [createapp.dev](https://createapp.dev/) 39 | 40 | -------------------------------------------------------------------------------- /dist/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | Frontend Mentor | Rock, Paper, Scissors 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-rock-paper-scissors", 3 | "version": "1.0.0", 4 | "description": "", 5 | "keywords": [], 6 | "author": "", 7 | "license": "ISC", 8 | "source": "src/index.html", 9 | "scripts": { 10 | "clean": "rm dist/bundle.js", 11 | "start": "parcel", 12 | "build-prod": "parcel build" 13 | }, 14 | "dependencies": { 15 | "react": "^18.2.0", 16 | "react-dom": "^18.2.0", 17 | "react-router-dom": "^6.8.2" 18 | }, 19 | "devDependencies": { 20 | "@babel/core": "^7.21.0", 21 | "@babel/preset-env": "^7.20.0", 22 | "@babel/preset-react": "^7.18.6", 23 | "@parcel/transformer-sass": "^2.8.3", 24 | "parcel": "^2.8.3", 25 | "prettier": "^2.8.4", 26 | "process": "^0.11.10", 27 | "sass": "^1.58.3" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/App.js: -------------------------------------------------------------------------------- 1 | import React, { useState } from "react"; 2 | import Header from "./components/Header"; 3 | import Play from "./components/Play"; 4 | import Game from "./components/Game"; 5 | import Footer from "./components/Footer"; 6 | import { Routes, Route } from "react-router-dom"; 7 | 8 | function App() { 9 | const [myChoice, setMyChoice] = useState(""); 10 | const [score, setScore] = useState(0); 11 | 12 | return ( 13 | <> 14 |
15 |
16 | 17 | } /> 18 | 22 | } 23 | /> 24 | 25 |
26 |