Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit ebe2223

Browse files
tetris-react-game #29
1 parent 011f063 commit ebe2223

File tree

28 files changed

+27439
-1
lines changed

28 files changed

+27439
-1
lines changed

tetris-react-web-app-project/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
![under_construction](https://user-images.githubusercontent.com/37651620/93677983-a7942e00-facc-11ea-8b6d-b57e73dc73bf.png)
1+
![image](https://user-images.githubusercontent.com/37651620/94886444-ef369480-0492-11eb-8ff6-31c0dc345f02.png)
2+
![image](https://user-images.githubusercontent.com/37651620/94886472-fd84b080-0492-11eb-9668-db1f2a612b8c.png)
3+
4+
## It's Live 🎉 Visit here ==> https://tetramino-tetris.netlify.app/
25

36
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
47

tetris-react-web-app-project/package-lock.json

Lines changed: 15963 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"name": "tetris-react-web-app-project",
3+
"version": "0.1.0",
4+
"private": true,
5+
"dependencies": {
6+
"@testing-library/jest-dom": "^4.2.4",
7+
"@testing-library/react": "^9.3.2",
8+
"@testing-library/user-event": "^7.1.2",
9+
"react": "^16.13.1",
10+
"react-dom": "^16.13.1",
11+
"react-scripts": "3.4.3",
12+
"styled-components": "^5.2.0"
13+
},
14+
"scripts": {
15+
"start": "react-scripts start",
16+
"build": "react-scripts build",
17+
"test": "react-scripts test",
18+
"eject": "react-scripts eject"
19+
},
20+
"eslintConfig": {
21+
"extends": "react-app"
22+
},
23+
"browserslist": {
24+
"production": [
25+
">0.2%",
26+
"not dead",
27+
"not op_mini all"
28+
],
29+
"development": [
30+
"last 1 chrome version",
31+
"last 1 firefox version",
32+
"last 1 safari version"
33+
]
34+
}
35+
}
Binary file not shown.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<meta name="theme-color" content="#000000" />
8+
<meta
9+
name="description"
10+
content="Web site created using create-react-app"
11+
/>
12+
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
13+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
14+
<title>Tetris Game</title>
15+
</head>
16+
<body>
17+
<noscript>You need to enable JavaScript to run this app.</noscript>
18+
<div id="root"></div>
19+
</body>
20+
</html>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
"src": "logo192.png",
12+
"type": "image/png",
13+
"sizes": "192x192"
14+
},
15+
{
16+
"src": "logo512.png",
17+
"type": "image/png",
18+
"sizes": "512x512"
19+
}
20+
],
21+
"start_url": ".",
22+
"display": "standalone",
23+
"theme_color": "#000000",
24+
"background_color": "#ffffff"
25+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# https://www.robotstxt.org/robotstxt.html
2+
User-agent: *
3+
Disallow:
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import React from "react";
2+
import "./styles/App.css";
3+
import Tetris from "./components/tetris/Tetris";
4+
5+
const App = () => (
6+
<div className="App">
7+
<Tetris />
8+
</div>
9+
);
10+
11+
export default App;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import React from "react";
2+
import { StyledCell } from "./styles/StyleBox";
3+
import { TETROMINOS } from "../../shapes/tetrominos";
4+
5+
const Cell = ({ type }) => (
6+
<StyledCell type={type} color={TETROMINOS[type].color}>
7+
{console.log("rerender cell")}
8+
</StyledCell>
9+
);
10+
11+
export default React.memo(Cell);
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import styled from "styled-components";
2+
3+
export const StyledCell = styled.div`
4+
width: auto;
5+
border-radius: 5px;
6+
background: rgba(${(props) => props.color}, 0.2);
7+
border: ${(props) => (props.type === 0 ? "0px solid" : "4px solid")};
8+
border-bottom-color: rgba(${(props) => props.color}, 0.1);
9+
border-right-color: rgba(${(props) => props.color}, 1);
10+
border-top-color: rgba(${(props) => props.color}, 1);
11+
border-left-color: rgba(${(props) => props.color}, 0.3);
12+
`;

0 commit comments

Comments
 (0)