Skip to content

Commit 5ec26bf

Browse files
committed
Inicio do desenvolvimento
0 parents  commit 5ec26bf

17 files changed

+2908
-0
lines changed

.gitignore

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# See https://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
6+
# testing
7+
/coverage
8+
9+
# production
10+
/build
11+
12+
# misc
13+
.DS_Store
14+
.env.local
15+
.env.development.local
16+
.env.test.local
17+
.env.production.local
18+
19+
npm-debug.log*
20+
yarn-debug.log*
21+
yarn-error.log*

README.md

+2,229
Large diffs are not rendered by default.

package.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "simon_game_react",
3+
"version": "0.1.0",
4+
"private": true,
5+
"dependencies": {
6+
"node-sass-chokidar": "0.0.3",
7+
"npm-run-all": "^4.1.2",
8+
"react": "^16.2.0",
9+
"react-dom": "^16.2.0",
10+
"react-scripts": "1.0.17"
11+
},
12+
"scripts": {
13+
"build-css": "node-sass-chokidar src/ -o src/",
14+
"watch-css": "npm run build-css && node-sass-chokidar src/ -o src/ --watch --recursive",
15+
"start-js": "react-scripts start",
16+
"start": "npm-run-all -p watch-css start-js",
17+
"build": "npm run build-css && react-scripts build",
18+
"test": "react-scripts test --env=jsdom",
19+
"eject": "react-scripts eject"
20+
}
21+
}

public/favicon.ico

3.78 KB
Binary file not shown.

public/index.html

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
6+
<meta name="theme-color" content="#000000">
7+
<!--
8+
manifest.json provides metadata used when your web app is added to the
9+
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
10+
-->
11+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
12+
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
13+
14+
<link href="https://fonts.googleapis.com/css?family=Righteous" rel="stylesheet">
15+
<!--
16+
Notice the use of %PUBLIC_URL% in the tags above.
17+
It will be replaced with the URL of the `public` folder during the build.
18+
Only files inside the `public` folder can be referenced from the HTML.
19+
20+
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
21+
work correctly both with client-side routing and a non-root public URL.
22+
Learn how to configure a non-root public URL by running `npm run build`.
23+
-->
24+
<title>React App</title>
25+
</head>
26+
<body>
27+
<noscript>
28+
You need to enable JavaScript to run this app.
29+
</noscript>
30+
<div id="root"></div>
31+
<!--
32+
This HTML file is a template.
33+
If you open it directly in the browser, you will see an empty page.
34+
35+
You can add webfonts, meta tags, or analytics to this file.
36+
The build step will place the bundled scripts into the <body> tag.
37+
38+
To begin the development, run `npm start` or `yarn start`.
39+
To create a production bundle, use `npm run build` or `yarn build`.
40+
-->
41+
</body>
42+
</html>

public/manifest.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"short_name": "React App",
3+
"name": "Create React App Sample",
4+
"icons": [
5+
{
6+
"src": "favicon.ico",
7+
"sizes": "64x64 32x32 24x24 16x16",
8+
"type": "image/x-icon"
9+
}
10+
],
11+
"start_url": "./index.html",
12+
"display": "standalone",
13+
"theme_color": "#000000",
14+
"background_color": "#ffffff"
15+
}

src/App.js

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import React, { Component } from "react";
2+
import "./assets/style.css";
3+
import startImg from "./assets/img/start.svg";
4+
import strictImg from "./assets/img/strict.svg";
5+
6+
import { Point } from "./components/Point";
7+
import { Simon } from "./components/Simon";
8+
9+
class App extends Component {
10+
constructor(props) {
11+
super(props);
12+
this.state = {
13+
ligado: false,
14+
strict: false
15+
};
16+
}
17+
18+
ligaDesligaSimon = () => {
19+
this.setState({ ligado: !this.state.ligado });
20+
};
21+
22+
ligaDesligaStrict = () => {
23+
let { ligado, strict } = this.state;
24+
if (ligado) {
25+
this.setState({ strict: !strict });
26+
}
27+
};
28+
29+
render() {
30+
let { ligado, strict } = this.state;
31+
32+
return (
33+
<div className="game">
34+
<div className={`board ${ligado ? "on" : "off"}`}>
35+
<Simon />
36+
37+
<div className="menu">
38+
<Point />
39+
40+
<div className="buttons">
41+
<div className="btn-start">
42+
<img src={startImg} alt="Start" />
43+
<span>START</span>
44+
</div>
45+
<div
46+
className="btn-strict"
47+
onClick={() => this.ligaDesligaStrict()}
48+
>
49+
<img src={strictImg} alt="Strict" />
50+
STRICT
51+
</div>
52+
<div className={`strict ${strict ? "on" : "off"}`} />
53+
</div>
54+
55+
<div
56+
className={`on-off ${ligado ? "on" : "off"}`}
57+
onClick={() => this.ligaDesligaSimon()}
58+
/>
59+
</div>
60+
</div>
61+
</div>
62+
);
63+
}
64+
}
65+
66+
export default App;

src/assets/img/off.svg

+39
Loading

src/assets/img/on.svg

+40
Loading

src/assets/img/start.svg

+41
Loading

src/assets/img/strict.svg

+39
Loading

0 commit comments

Comments
 (0)