{"id":15131280,"url":"https://github.com/balakrish001/rock-paper-scissors-react-js","last_synced_at":"2026-01-19T05:32:43.994Z","repository":{"id":257341309,"uuid":"857974846","full_name":"Balakrish001/Rock-Paper-Scissors-React-js","owner":"Balakrish001","description":"Developed a Rock Paper Scissors game using React JS","archived":false,"fork":false,"pushed_at":"2024-09-16T04:26:48.000Z","size":189,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T20:43:29.528Z","etag":null,"topics":["css-in-js","popup","reactjs","rock-paper-scissors","styled-components"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Balakrish001.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-16T04:19:07.000Z","updated_at":"2024-09-16T04:26:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"3f14ac68-d50e-41e2-8e98-c76269f4a2b0","html_url":"https://github.com/Balakrish001/Rock-Paper-Scissors-React-js","commit_stats":null,"previous_names":["balakrish001/rock-paper-scissors-react-js"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Balakrish001%2FRock-Paper-Scissors-React-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Balakrish001%2FRock-Paper-Scissors-React-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Balakrish001%2FRock-Paper-Scissors-React-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Balakrish001%2FRock-Paper-Scissors-React-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Balakrish001","download_url":"https://codeload.github.com/Balakrish001/Rock-Paper-Scissors-React-js/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247399894,"owners_count":20932876,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["css-in-js","popup","reactjs","rock-paper-scissors","styled-components"],"created_at":"2024-09-26T03:40:28.669Z","updated_at":"2026-01-19T05:32:43.953Z","avatar_url":"https://github.com/Balakrish001.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"In this project, let's build a **Rock Paper Scissors** by applying the concepts I have learned till now.\n\n### Refer to the image below:\n\n\u003cbr/\u003e\n\u003cdiv style=\"text-align: center;\"\u003e\n    \u003cimg src=\"https://assets.ccbp.in/frontend/content/react-js/rock-paper-scissors-output.gif\" alt=\"rock paper scissors output\" style=\"max-width:70%;box-shadow:0 2.8px 2.2px rgba(0, 0, 0, 0.12)\"\u003e\n\u003c/div\u003e\n\u003cbr/\u003e\n\n### Design Files\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to view\u003c/summary\u003e\n\n- [Extra Small (Size \u003c 576px) and Small (Size \u003e= 576px)](https://assets.ccbp.in/frontend/content/react-js/rock-paper-scissors-sm-outputs.png)\n- [Medium (Size \u003e= 768px), Large (Size \u003e= 992px) and Extra Large (Size \u003e= 1200px) - Playing View](https://assets.ccbp.in/frontend/content/react-js/rock-paper-scissors-lg-playing-output.png)\n- [Medium (Size \u003e= 768px), Large (Size \u003e= 992px) and Extra Large (Size \u003e= 1200px) - Game Results View](https://assets.ccbp.in/frontend/content/react-js/rock-paper-scissors-lg-game-results-output.png)\n- [Medium (Size \u003e= 768px), Large (Size \u003e= 992px) and Extra Large (Size \u003e= 1200px) - Game Rules View](https://assets.ccbp.in/frontend/content/react-js/rock-paper-scissors-lg-rules-output.png)\n\n\u003c/details\u003e\n\n### Set Up Instructions\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to view\u003c/summary\u003e\n\n- Download dependencies by running `npm install`\n- Start up the app using `npm start`\n\u003c/details\u003e\n\n### Completion Instructions\n\n\u003cdetails\u003e\n\u003csummary\u003eFunctionality to be added\u003c/summary\u003e\n\u003cbr/\u003e\n\nThe app must have the following functionalities\n\n- When you click on the **Rules** button, it should trigger a popup, and rules image should be displayed\n- Initially, the score displayed should be `0`\n- The App is provided with `choicesList`. It consists of a list of choice objects with the following properties in each choice object\n\n  |   Key    | Data Type |\n  | :------: | :-------: |\n  |    id    |  String   |\n  | imageUrl |  String   |\n\n- When any of the three buttons (i.e Rock, Paper, Scissors) is clicked, then the [Game Results View](https://assets.ccbp.in/frontend/content/react-js/rock-paper-scissors-lg-game-results-output.png) should be displayed\n- In the Game Results View, the opponent choice should be generated randomly among these three buttons (i.e Rock, Paper, Scissors)\n- When the **Rock** button is clicked, then the rock image should be displayed as your choice in the Game Results View\n- When the **Paper** button is clicked, then the paper image should be displayed as your choice in the Game Results View\n- When the **Scissors** button is clicked, then the scissors image should be displayed as your choice in the Game Results View\n\n  #### Game Rules\n\n    \u003cdetails\u003e\n    \u003csummary\u003eClick to view the Game Rules\u003c/summary\u003e\n    \u003cbr/\u003e\n    \u003cimg src=\"https://assets.ccbp.in/frontend/react-js/rock-paper-scissor/rules-image.png\" alt=\"rules image\" style=\"width:500px\" /\u003e\n    \u003cbr/\u003e\n\n  - Game result based on choices\n\n    - When your choice is **paper** and the opponent choice is **rock**, then the result will be `YOU WON`\n    - When your choice is **scissors** and the opponent choice is **rock**, then the result will be `YOU LOSE`\n    - When your choice is **rock** and the opponent choice is **paper**, then the result will be `YOU LOSE`\n    - When your choice is **scissors** and the opponent choice is **paper**, then the result will be `YOU WON`\n    - When your choice is **rock** and the opponent choice is **scissors**, then the result will be `YOU WON`\n    - When your choice is **paper** and the opponent choice is **scissors**, then the result will be `YOU LOSE`\n    - When your choice and the opponent choice match, then the result will be `IT IS DRAW`\n\n    \u003c/details\u003e\n\n- When the result is `YOU WON`, then the score should be incremented by one\n- When the result is `IT IS DRAW`, then there shouldn't be any change in the score\n- When the result is `YOU LOSE`, then the score should be decremented by one\n- When the **PLAY AGAIN** button is clicked, then the [Playing View](https://assets.ccbp.in/frontend/content/react-js/rock-paper-scissors-lg-playing-output.png) should be displayed\n\n\u003c/details\u003e\n\n### Quick Tips\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to view\u003c/summary\u003e\n\u003cbr\u003e\n\n- You can use `Math.random()` function to get a random number (float value) in range 0 to less than 1 (`0 \u003c= randomNumber \u003c 1`)\n\n  ```\n  Math.random()\n  ```\n\n- You can use `Math.floor()` function that returns the **largest integer less than or equal to a given number**\n\n  ```js\n  console.log(Math.floor(5.95)); // output: 5\n  ```\n\n\u003c/details\u003e\n\n### Important Note\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to view\u003c/summary\u003e\n\n\u003cbr/\u003e\n\n- You can use **reactjs-popup** for displaying the modal\n- `RiCloseLine` icon from `react icons` can be used for the **close** button at `React Popup`\n\n**The following instructions are required for the tests to pass**\n\n- **Styled Components** should be used for styling purposes\n- The Page should consist of three HTML button elements with `data-testid` attribute values as **rockButton**, **scissorsButton** and **paperButton** respectively\n- In Game Results View, the page should consist of an HTML image element with alt as **your choice** and src as URL for your choice image\n- In Game Results View, the page should consist of an HTML image element with alt as **opponent choice** and src as URL for opponent choice image\n- **Roboto** should be applied as `font-family` for **Score** value\n\n\u003c/details\u003e\n\n### Resources\n\n\u003cdetails\u003e\n\u003csummary\u003eImage URLs\u003c/summary\u003e\n\n- [https://assets.ccbp.in/frontend/react-js/rock-paper-scissor/rules-image.png](https://assets.ccbp.in/frontend/react-js/rock-paper-scissor/rules-image.png) alt should be **rules**\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eColors\u003c/summary\u003e\n\n\u003cbr/\u003e\n\n\u003cdiv style=\"background-color: #ffffff; width: 150px; padding: 10px; color: black\"\u003eHex: #ffffff\u003c/div\u003e\n\u003cdiv style=\"background-color: #223a5f; width: 150px; padding: 10px; color: white\"\u003eHex: #223a5f\u003c/div\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eFont-families\u003c/summary\u003e\n\n- Roboto\n- Bree Serif\n\n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbalakrish001%2Frock-paper-scissors-react-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbalakrish001%2Frock-paper-scissors-react-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbalakrish001%2Frock-paper-scissors-react-js/lists"}