From 45bc041389228e43d6845424131292e60934f424 Mon Sep 17 00:00:00 2001 From: MikunoNaka Date: Thu, 15 Jul 2021 16:05:47 +0530 Subject: Initial commit --- .gitignore | 23 + LICENCE | 15 + README.md | 13 + package.json | 43 + public/favicon.ico | Bin 0 -> 3870 bytes public/index.html | 20 + public/logo192.png | Bin 0 -> 5347 bytes public/logo512.png | Bin 0 -> 9664 bytes public/manifest.json | 25 + public/robots.txt | 3 + src/components/App.tsx | 37 + src/components/Box.tsx | 41 + src/components/Footer.tsx | 32 + src/components/Grid.tsx | 94 + src/components/ScoreBoard.tsx | 36 + src/components/style.css | 93 + src/index.tsx | 16 + src/logo.svg | 1 + src/react-app-env.d.ts | 1 + src/reportWebVitals.ts | 15 + tsconfig.json | 26 + yarn.lock | 11448 ++++++++++++++++++++++++++++++++++++++++ 22 files changed, 11982 insertions(+) create mode 100644 .gitignore create mode 100644 LICENCE create mode 100644 README.md create mode 100644 package.json create mode 100644 public/favicon.ico create mode 100644 public/index.html create mode 100644 public/logo192.png create mode 100644 public/logo512.png create mode 100644 public/manifest.json create mode 100644 public/robots.txt create mode 100644 src/components/App.tsx create mode 100644 src/components/Box.tsx create mode 100644 src/components/Footer.tsx create mode 100644 src/components/Grid.tsx create mode 100644 src/components/ScoreBoard.tsx create mode 100644 src/components/style.css create mode 100644 src/index.tsx create mode 100644 src/logo.svg create mode 100644 src/react-app-env.d.ts create mode 100644 src/reportWebVitals.ts create mode 100644 tsconfig.json create mode 100644 yarn.lock diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4d29575 --- /dev/null +++ b/.gitignore @@ -0,0 +1,23 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# production +/build + +# misc +.DS_Store +.env.local +.env.development.local +.env.test.local +.env.production.local + +npm-debug.log* +yarn-debug.log* +yarn-error.log* diff --git a/LICENCE b/LICENCE new file mode 100644 index 0000000..b5c90d2 --- /dev/null +++ b/LICENCE @@ -0,0 +1,15 @@ +Tic Tac Toe - Minimalistic Tic Tac Toe +Copyright (C) 2021 Vidhu Kant Sharma + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . diff --git a/README.md b/README.md new file mode 100644 index 0000000..c6da899 --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +# Tic Tac Toe + +Minimalistic Tic Tac Toe game, written in React. + +For some reason, I've made the code as functional as I can make it + +## Licence + +Licenced under the GNU General Public Licence + +GNU GPL: https://www.gnu.org/licenses/gpl-3.0.en.html + +Copyright (c) 2021 Vidhu Kant Sharma diff --git a/package.json b/package.json new file mode 100644 index 0000000..8eebd66 --- /dev/null +++ b/package.json @@ -0,0 +1,43 @@ +{ + "name": "Tic Tac Toe", + "version": "0.1.0", + "private": true, + "dependencies": { + "@testing-library/jest-dom": "^5.11.4", + "@testing-library/react": "^11.1.0", + "@testing-library/user-event": "^12.1.10", + "@types/jest": "^26.0.15", + "@types/node": "^12.0.0", + "@types/react": "^17.0.0", + "@types/react-dom": "^17.0.0", + "react": "^17.0.2", + "react-dom": "^17.0.2", + "react-scripts": "4.0.3", + "typescript": "^4.1.2", + "web-vitals": "^1.0.1" + }, + "scripts": { + "start": "react-scripts start", + "build": "react-scripts build", + "test": "react-scripts test", + "eject": "react-scripts eject" + }, + "eslintConfig": { + "extends": [ + "react-app", + "react-app/jest" + ] + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + } +} diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..a11777c Binary files /dev/null and b/public/favicon.ico differ diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..f877834 --- /dev/null +++ b/public/index.html @@ -0,0 +1,20 @@ + + + + + + + + + + + Tic Tac Toe + + + +
+ + diff --git a/public/logo192.png b/public/logo192.png new file mode 100644 index 0000000..fc44b0a Binary files /dev/null and b/public/logo192.png differ diff --git a/public/logo512.png b/public/logo512.png new file mode 100644 index 0000000..a4e47a6 Binary files /dev/null and b/public/logo512.png differ diff --git a/public/manifest.json b/public/manifest.json new file mode 100644 index 0000000..080d6c7 --- /dev/null +++ b/public/manifest.json @@ -0,0 +1,25 @@ +{ + "short_name": "React App", + "name": "Create React App Sample", + "icons": [ + { + "src": "favicon.ico", + "sizes": "64x64 32x32 24x24 16x16", + "type": "image/x-icon" + }, + { + "src": "logo192.png", + "type": "image/png", + "sizes": "192x192" + }, + { + "src": "logo512.png", + "type": "image/png", + "sizes": "512x512" + } + ], + "start_url": ".", + "display": "standalone", + "theme_color": "#000000", + "background_color": "#ffffff" +} diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..e9e57dc --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,3 @@ +# https://www.robotstxt.org/robotstxt.html +User-agent: * +Disallow: diff --git a/src/components/App.tsx b/src/components/App.tsx new file mode 100644 index 0000000..19d1e8c --- /dev/null +++ b/src/components/App.tsx @@ -0,0 +1,37 @@ +/* + * Tic Tac Toe - Minimalistic Tic Tac Toe + * Copyright (C) 2021 Vidhu Kant Sharma + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import React, { useState } from 'react'; +import ScoreBoard from './ScoreBoard'; +import Grid from './Grid'; +import Footer from './Footer'; +import './style.css'; + +const App: React.FC = () => { + const [scoreX, setScoreX] = useState(0); + const [scoreO, setScoreO] = useState(0); + return ( + <> + + +