├── .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 |
27 | >
28 | );
29 | }
30 |
31 | export default App;
32 |
--------------------------------------------------------------------------------
/src/components/Footer.js:
--------------------------------------------------------------------------------
1 | import React, { useState } from "react";
2 | import Modal from "./Modal";
3 | const Footer = () => {
4 | const [modal, setModal] = useState(false);
5 |
6 | const toggle = () => {
7 | setModal(!modal);
8 | };
9 |
10 | return (
11 | <>
12 |
24 | {modal ? : null}
25 | >
26 | );
27 | };
28 |
29 | export default Footer;
30 |
--------------------------------------------------------------------------------
/src/components/Game.js:
--------------------------------------------------------------------------------
1 | import React, { useEffect, useState } from "react";
2 | import { Link } from "react-router-dom";
3 |
4 | const Game = ({ score, myChoice, setScore }) => {
5 | const [house, setHouse] = useState("");
6 | const [playerWin, setPlayerWin] = useState("");
7 |
8 | const [counter, setCounter] = useState(3);
9 |
10 | const newHousePick = () => {
11 | const choices = ["rock", "paper", "scissors"];
12 | setHouse(choices[Math.floor(Math.random() * 3)]);
13 | };
14 | useEffect(() => {
15 | newHousePick();
16 | }, []);
17 |
18 | const Result = () => {
19 | if (myChoice === "rock" && house === "scissors") {
20 | setPlayerWin("win");
21 | setScore(score + 1);
22 | } else if (myChoice === "rock" && house === "paper") {
23 | setPlayerWin("lose");
24 | setScore(score - 1);
25 | } else if (myChoice === "scissors" && house === "paper") {
26 | setPlayerWin("win");
27 | setScore(score + 1);
28 | } else if (myChoice === "scissors" && house === "rock") {
29 | setPlayerWin("lose");
30 | setScore(score - 1);
31 | } else if (myChoice === "paper" && house === "rock") {
32 | setPlayerWin("win");
33 | setScore(score + 1);
34 | } else if (myChoice === "paper" && house === "scissors") {
35 | setPlayerWin("lose");
36 | setScore(score - 1);
37 | } else {
38 | setPlayerWin("draw");
39 | }
40 | };
41 |
42 | useEffect(() => {
43 | const timer =
44 | counter > 0
45 | ? setInterval(() => {
46 | setCounter(counter - 1);
47 | }, 1000)
48 | : Result();
49 |
50 | return () => {
51 | clearInterval(timer);
52 | };
53 | }, [counter, house]);
54 |
55 | return (
56 |
57 |
58 |
You Picked
59 |
64 |
65 | {playerWin == "win" && (
66 |
67 | You Win
68 | setHouse()}>
69 | Play Again
70 |
71 |
72 | )}
73 | {playerWin == "lose" && (
74 |
75 | You Lose
76 | setHouse()}>
77 | Play Again
78 |
79 |
80 | )}
81 | {playerWin == "draw" && (
82 |
83 | Draw
84 | setHouse()}>
85 | Play Again
86 |
87 |
88 | )}
89 |
90 |
91 |
The House Picked
92 | {counter == 0 ? (
93 |
98 | ) : (
99 |
{counter}
100 | )}
101 |
102 |
103 | );
104 | };
105 |
106 | export default Game;
107 |
108 | /*
109 | my choice:{myChoice}
110 | House choice:{house}
111 | Result:
112 | {playerWin == "win" && You Win
}
113 | {playerWin == "lose" && You lose
}
114 | {playerWin == "draw" && Draw
}
115 | setHouse()}>
116 | Play Again
117 |
118 |
119 | */
120 |
--------------------------------------------------------------------------------
/src/components/Header.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | const Header = ({ score }) => {
4 | return (
5 |
6 |
7 | Rock
8 | Paper
9 | Scissors
10 |
11 |
12 |
Score
13 |
{score}
14 |
15 |
16 | );
17 | };
18 |
19 | export default Header;
20 |
--------------------------------------------------------------------------------
/src/components/Modal.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom";
3 | import close from "../images/icon-close.svg";
4 | import rules from "../images/image-rules.svg";
5 |
6 | const Modal = ({ toggle }) => {
7 | return ReactDOM.createPortal(
8 |
9 |
10 |
11 |
Rules
12 |
15 |
16 |

17 |
18 |
,
19 | document.getElementById("modal")
20 | );
21 | };
22 |
23 | export default Modal;
24 |
--------------------------------------------------------------------------------
/src/components/Play.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Link } from "react-router-dom";
3 | import Triangle from "../images/bg-triangle.svg";
4 |
5 | const Play = ({ setMyChoice }) => {
6 | const setChoice = (e) => {
7 | setMyChoice(e.target.dataset.id);
8 | };
9 |
10 | return (
11 |
12 |

13 |
14 |
15 |
20 |
21 |
22 |
27 |
28 |
29 |
34 |
35 |
36 |
37 | );
38 | };
39 |
40 | export default Play;
41 |
--------------------------------------------------------------------------------
/src/images/bg-pentagon.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/images/bg-triangle.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/images/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codebucks27/ReactJs-rock-paper-scissors-game/7f2c97a833d5a051f27f01d6119652b3d9d2cdbb/src/images/favicon-32x32.png
--------------------------------------------------------------------------------
/src/images/icon-close.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/images/icon-lizard.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/images/icon-paper.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/images/icon-rock.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/images/icon-scissors.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/images/icon-spock.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/images/image-rules-bonus.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/images/image-rules.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/images/logo-bonus.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/images/logo.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
19 |
20 | Frontend Mentor | Rock, Paper, Scissors
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { createRoot } from 'react-dom/client';
3 | import { BrowserRouter as Router } from "react-router-dom";
4 | import App from "./App";
5 | import "./styles.scss";
6 |
7 | // This implementation has changed after React 18
8 | const mountNode = document.getElementById('app');
9 | const root = createRoot(mountNode)
10 |
11 | root.render(
12 |
13 |
14 |
15 | );
16 |
--------------------------------------------------------------------------------
/src/scss/_footer.scss:
--------------------------------------------------------------------------------
1 | .footer{
2 | width: 100vw;
3 |
4 | .attribution{
5 | position: absolute;
6 | left: 50%;
7 | transform: translate(-50%);
8 | bottom: 1rem;
9 | }
10 |
11 | button{
12 | position: absolute;
13 | bottom: 1rem;
14 | padding: 7px 25px;
15 | right: 1rem;
16 | border-radius: .4rem;
17 | border: 3px solid $header-outline;
18 | color: lighten($header-outline,20%);
19 | background: none;
20 | font-weight: 600;
21 | letter-spacing: 2px;
22 |
23 | &:hover{
24 | background-color: rgba($color: #ffffff, $alpha: .8);
25 | color: $dark-text;
26 | cursor: pointer;
27 | }
28 | }
29 | }
--------------------------------------------------------------------------------
/src/scss/_game.scss:
--------------------------------------------------------------------------------
1 | .game{
2 | display: flex;
3 | margin-top: 50px;
4 | flex-wrap: nowrap;
5 | align-items: center;
6 |
7 | &__you{
8 | display: flex;
9 | flex-direction: column;
10 | margin-right: 2.5rem;
11 | .text{
12 | text-transform: uppercase;
13 | font-size: 1.2rem;
14 | font-weight: 300;
15 | margin-bottom: 2.5rem;
16 | }
17 | .icon{
18 | height: 250px;
19 | width: 250px;
20 | border-radius: 50%;
21 | border-color: transparent;
22 | border: 25px solid;
23 | background-size: 50%;
24 |
25 |
26 | &--paper{
27 | @include icon($imageP,$paper-gradient);
28 |
29 | &--winner{
30 | @include bigShadow($paper-gradient);
31 | }
32 |
33 | }
34 | &--scissors{
35 | @include icon($imageS,$scissors-gradient);
36 | &--winner{
37 | @include bigShadow($scissors-gradient);
38 | }
39 | }
40 | &--rock{
41 | @include icon($imageR,$rock-gradient);
42 |
43 | &--winner{
44 | @include bigShadow($rock-gradient);
45 | }
46 |
47 |
48 |
49 | }
50 | }
51 | }
52 |
53 | &__play{
54 | display: flex;
55 | flex-direction: column;
56 | margin: 0 2rem;
57 | .text{
58 | text-transform: uppercase;
59 | font-size: 3rem;
60 | font-weight: 700;
61 | margin-bottom: 10px;
62 | }
63 | .play-again{
64 | background-color: #fff;
65 | text-decoration: none;
66 | text-transform: uppercase;
67 | padding: 10px 20px;
68 | border-radius: 5px;
69 | font-size: .8rem;
70 |
71 | &:hover{
72 | color: red;
73 | }
74 | }
75 | }
76 |
77 | &__house{
78 | display: flex;
79 | flex-direction: column;
80 | margin-left: 2.5rem;
81 | .text{
82 | text-transform: uppercase;
83 | font-size: 1.2rem;
84 | font-weight: 300;
85 | margin-bottom: 2.5rem;
86 | }
87 | .icon{
88 | height: 250px;
89 | width: 250px;
90 | border-radius: 50%;
91 | border-color: transparent;
92 | border: 25px solid;
93 | background-size: 50%;
94 |
95 |
96 | &--paper{
97 | @include icon($imageP,$paper-gradient);
98 |
99 | &--winner{
100 | @include bigShadow($paper-gradient);
101 | }
102 | }
103 | &--scissors{
104 | @include icon($imageS,$scissors-gradient);
105 |
106 | &--winner{
107 | @include bigShadow($scissors-gradient);
108 | }
109 | }
110 | &--rock{
111 | @include icon($imageR,$rock-gradient);
112 |
113 | &--winner{
114 | @include bigShadow($rock-gradient);
115 | }
116 | }
117 | }
118 |
119 | .counter{
120 | height: 250px;
121 | width: 250px;
122 | border-radius: 50%;
123 | background-color: rgba($color: #000000, $alpha: .3);
124 | font-size: 8rem;
125 |
126 | display: flex;
127 | flex-direction: column;
128 | justify-content: center;
129 | }
130 | }
131 | }
--------------------------------------------------------------------------------
/src/scss/_globals.scss:
--------------------------------------------------------------------------------
1 | @import url('https://fonts.googleapis.com/css2?family=Barlow+Semi+Condensed:wght@600;700&display=swap');
2 |
3 |
4 | *,*::before,*::after{
5 | margin: 0;
6 | padding: 0;
7 | box-sizing: inherit;
8 | }
9 |
10 | body{
11 | font-family: 'Barlow Semi Condensed', sans-serif;
12 | color: #fff;
13 | background:$background-gradient;
14 | text-align: center;
15 | box-sizing: border-box;
16 | }
17 |
18 | .container{
19 | display: flex;
20 | flex-direction: column;
21 | align-items: center;
22 | }
--------------------------------------------------------------------------------
/src/scss/_header.scss:
--------------------------------------------------------------------------------
1 | .header{
2 | display:flex;
3 | border: 3px solid $header-outline;
4 | max-width: 43.75rem;
5 | width: 100%;
6 |
7 | margin-top: 1.875rem;
8 | border-radius: 1rem;
9 | padding: 1.25rem;
10 |
11 | display: flex;
12 | justify-content: space-between;
13 |
14 | .text{
15 | font-size: 2.5rem;
16 | text-transform: uppercase;
17 | display: flex;
18 | flex-direction: column;
19 | align-items: flex-start;
20 | line-height: 2rem;
21 | }
22 |
23 | .score-box{
24 | padding: .75rem 2.5rem;
25 | background-color: #fff;
26 | color: $score-text;
27 | border-radius: 5px;
28 |
29 | &__score{
30 | color: $dark-text;
31 | font-size: 3.5rem;
32 | font-weight: 700;
33 | }
34 |
35 | }
36 | }
--------------------------------------------------------------------------------
/src/scss/_mixins.scss:
--------------------------------------------------------------------------------
1 | @mixin icon($image,$color){
2 | background-color: #fff;
3 | background-image: url($image);
4 | background-position: center;
5 | background-repeat: no-repeat;
6 | border-color: $color;
7 | box-shadow: inset 0px 5px 6px grey,
8 | 0px 8px darken($color, 15%);
9 |
10 | }
11 |
12 | @mixin bigShadow($color){
13 | box-shadow:inset 0px 5px 6px grey,
14 | 0px 8px darken($color, 15%),
15 | 0px 0px 0px 50px rgba(#ffffff, .07),
16 | 0px 0px 0px 100px rgba(#ffffff, .05),
17 | 0px 0px 0px 150px rgba(#ffffff, .025),;
18 | }
--------------------------------------------------------------------------------
/src/scss/_modal.scss:
--------------------------------------------------------------------------------
1 | .modal-container{
2 | position: absolute;
3 | height: 100vh;
4 | width: 100vw;
5 | z-index: 10;
6 | display: flex;
7 | justify-content: center;
8 | align-items: center;
9 |
10 | .modal-box{
11 | color: $dark-text;
12 | background-color: #fff;
13 | border-radius: 8px;
14 | padding: 30px;
15 |
16 | img{
17 | width: 100%;
18 | }
19 |
20 | .modal__header{
21 | display: flex;
22 | justify-content: space-between;
23 | margin-bottom: 30px;
24 |
25 | h1{
26 | text-transform: uppercase;
27 | margin: 0;
28 | padding: 0;
29 | }
30 | }
31 | }
32 |
33 | button{
34 | background:none ;
35 | border: none;
36 | align-self: center;
37 | color: $dark-text;
38 |
39 | &:hover{
40 | cursor: pointer;
41 | }
42 |
43 | }
44 | }
--------------------------------------------------------------------------------
/src/scss/_play.scss:
--------------------------------------------------------------------------------
1 | .play{
2 |
3 | width: 100%;
4 |
5 | position: relative;
6 | margin-top: 3.125rem;
7 |
8 | display: flex;
9 | flex-direction: column;
10 |
11 | .triangle{
12 | position: absolute;
13 | align-self: center;
14 | margin-top: 4.375rem;
15 | }
16 |
17 | .items{
18 | display: flex;
19 | justify-content: center;
20 |
21 | .icon{
22 | height: 160px;
23 | width: 160px;
24 | border: 18px solid;
25 | border-radius: 50%;
26 | transition: transform .2s;
27 |
28 | &--paper{
29 | @include icon($imageP,$paper-gradient);
30 | transform: translateX(1.5rem);
31 |
32 | &:hover{
33 | transform: translateX(1.5rem) scale(1.1);
34 |
35 | }
36 |
37 | }
38 | &--scissors{
39 | @include icon($imageS,$scissors-gradient);
40 | transform: translateX(8rem);
41 |
42 | &:hover{
43 | transform: translateX(8rem) scale(1.1);
44 |
45 |
46 | }
47 | }
48 | &--rock{
49 | @include icon($imageR,$rock-gradient);
50 | transform: translateX(-10rem) translateY(13rem);
51 |
52 |
53 | &:hover{
54 | transform: translateX(-10rem) translateY(13rem) scale(1.1);
55 |
56 | }
57 |
58 | }
59 | }
60 | }
61 | }
--------------------------------------------------------------------------------
/src/scss/_variables.scss:
--------------------------------------------------------------------------------
1 | //colors
2 |
3 | $scissors-gradient: hsl(39, 89%, 49%);
4 | $paper-gradient: hsl(230, 89%, 62%);
5 | $rock-gradient: hsl(349, 71%, 52%);
6 |
7 |
8 | //text
9 |
10 | $dark-text: hsl(229, 25%, 31%);
11 | $score-text: hsl(229, 64%, 46%);
12 | $header-outline: hsl(217, 16%, 45%);
13 |
14 | //Background
15 | $background-gradient: radial-gradient(circle, hsl(214, 47%, 23%),
16 | hsl(237, 49%, 15%)
17 | );
18 |
19 | //Images
20 |
21 | $imageP:"../src/images/icon-paper.svg";
22 | $imageS:"../src/images/icon-scissors.svg";
23 | $imageR:"../src/images/icon-rock.svg";
24 |
25 |
--------------------------------------------------------------------------------
/src/style-guide.md:
--------------------------------------------------------------------------------
1 | # Front-end Style Guide
2 |
3 | ## Layout
4 |
5 | The designs were created to the following widths:
6 |
7 | - Mobile: 375px
8 | - Desktop: 1366px
9 |
10 | ## Colors
11 |
12 | ### Primary
13 |
14 | - Scissors Gradient: hsl(39, 89%, 49%) to hsl(40, 84%, 53%)
15 | - Paper Gradient: hsl(230, 89%, 62%) to hsl(230, 89%, 65%)
16 | - Rock Gradient: hsl(349, 71%, 52%) to hsl(349, 70%, 56%)
17 | - Lizard Gradient: hsl(261, 73%, 60%) to hsl(261, 72%, 63%)
18 | - Cyan: hsl(189, 59%, 53%) to hsl(189, 58%, 57%)
19 |
20 | ### Neutral
21 |
22 | - Dark Text: hsl(229, 25%, 31%)
23 | - Score Text: hsl(229, 64%, 46%)
24 | - Header Outline: hsl(217, 16%, 45%)
25 |
26 | ### Background
27 |
28 | - Radial Gradient: hsl(214, 47%, 23%) to hsl(237, 49%, 15%)
29 |
30 | ## Fonts
31 |
32 | - Family: [Barlow Semi Condensed](https://fonts.google.com/specimen/Barlow+Semi+Condensed)
33 | - Weights: 600, 700
34 |
--------------------------------------------------------------------------------
/src/styles.scss:
--------------------------------------------------------------------------------
1 | @import "./scss/variables";
2 | @import "./scss/globals";
3 | @import "./scss/mixins";
4 |
5 |
6 |
7 | @import "./scss/header";
8 | @import "./scss/play";
9 | @import "./scss/game";
10 | @import "./scss/footer";
11 | @import "./scss/modal";
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------