From 72e89afac0f11d59e4399f245e6dcc728bec38d9 Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Sat, 15 Jul 2023 02:46:14 +0530 Subject: cleaned up code, added timeout, etc --- LICENCE | 15 - Procfile | 1 - README.md | 71 +- app.json | 5 - build/asset-manifest.json | 13 + build/favicon.ico | Bin 0 -> 1150 bytes build/index.html | 1 + build/static/css/main.aa39b0f9.css | 2 + build/static/css/main.aa39b0f9.css.map | 1 + build/static/js/main.9c7c2e70.js | 3 + build/static/js/main.9c7c2e70.js.LICENSE.txt | 39 + build/static/js/main.9c7c2e70.js.map | 1 + package-lock.json | 17670 +++++++++++++++++++++++++ package.json | 19 +- public/favicon.ico | Bin 3870 -> 1150 bytes public/index.html | 29 +- public/logo192.png | Bin 5347 -> 0 bytes public/logo512.png | Bin 9664 -> 0 bytes public/manifest.json | 25 - public/robots.txt | 3 - src/components/App.js | 88 +- src/components/MultiplayerGrid.js | 11 +- src/components/style.css | 7 +- src/logo.svg | 1 - src/react-app-env.d.ts | 1 - src/server/index.js | 9 +- yarn.lock | 11398 ---------------- 27 files changed, 17890 insertions(+), 11523 deletions(-) delete mode 100644 LICENCE delete mode 100644 Procfile delete mode 100644 app.json create mode 100644 build/asset-manifest.json create mode 100644 build/favicon.ico create mode 100644 build/index.html create mode 100644 build/static/css/main.aa39b0f9.css create mode 100644 build/static/css/main.aa39b0f9.css.map create mode 100644 build/static/js/main.9c7c2e70.js create mode 100644 build/static/js/main.9c7c2e70.js.LICENSE.txt create mode 100644 build/static/js/main.9c7c2e70.js.map create mode 100644 package-lock.json delete mode 100644 public/logo192.png delete mode 100644 public/logo512.png delete mode 100644 public/manifest.json delete mode 100644 public/robots.txt delete mode 100644 src/logo.svg delete mode 100644 src/react-app-env.d.ts delete mode 100644 yarn.lock diff --git a/LICENCE b/LICENCE deleted file mode 100644 index b5c90d2..0000000 --- a/LICENCE +++ /dev/null @@ -1,15 +0,0 @@ -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/Procfile b/Procfile deleted file mode 100644 index 5f015e4..0000000 --- a/Procfile +++ /dev/null @@ -1 +0,0 @@ -web: node src/server/index.js diff --git a/README.md b/README.md index 0ee4db1..58beeac 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,70 @@ -# Tic Tac Toe +# Getting Started with Create React App -Minimalistic Tic Tac Toe game, written in React. +This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). -For some reason, I've made the code as functional as I can make it +## Available Scripts -This game is hosted [here](https://mikunonaka-tic-tac-toe.herokuapp.com/). +In the project directory, you can run: -## Licence +### `npm start` -Licenced under the GNU General Public Licence +Runs the app in the development mode.\ +Open [http://localhost:3000](http://localhost:3000) to view it in your browser. -GNU GPL: https://www.gnu.org/licenses/gpl-3.0.en.html +The page will reload when you make changes.\ +You may also see any lint errors in the console. -Copyright (c) 2021 Vidhu Kant Sharma +### `npm test` + +Launches the test runner in the interactive watch mode.\ +See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. + +### `npm run build` + +Builds the app for production to the `build` folder.\ +It correctly bundles React in production mode and optimizes the build for the best performance. + +The build is minified and the filenames include the hashes.\ +Your app is ready to be deployed! + +See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. + +### `npm run eject` + +**Note: this is a one-way operation. Once you `eject`, you can't go back!** + +If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. + +Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own. + +You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it. + +## Learn More + +You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). + +To learn React, check out the [React documentation](https://reactjs.org/). + +### Code Splitting + +This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) + +### Analyzing the Bundle Size + +This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) + +### Making a Progressive Web App + +This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) + +### Advanced Configuration + +This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) + +### Deployment + +This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) + +### `npm run build` fails to minify + +This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify) diff --git a/app.json b/app.json deleted file mode 100644 index 4b598d1..0000000 --- a/app.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "Minimalistic tic tac toe", - "description": "What else description do you need", - "keywords": ["react", "tic tac toe", "gpl"] -} diff --git a/build/asset-manifest.json b/build/asset-manifest.json new file mode 100644 index 0000000..d197bec --- /dev/null +++ b/build/asset-manifest.json @@ -0,0 +1,13 @@ +{ + "files": { + "main.css": "/static/css/main.aa39b0f9.css", + "main.js": "/static/js/main.9c7c2e70.js", + "index.html": "/index.html", + "main.aa39b0f9.css.map": "/static/css/main.aa39b0f9.css.map", + "main.9c7c2e70.js.map": "/static/js/main.9c7c2e70.js.map" + }, + "entrypoints": [ + "static/css/main.aa39b0f9.css", + "static/js/main.9c7c2e70.js" + ] +} \ No newline at end of file diff --git a/build/favicon.ico b/build/favicon.ico new file mode 100644 index 0000000..4927520 Binary files /dev/null and b/build/favicon.ico differ diff --git a/build/index.html b/build/index.html new file mode 100644 index 0000000..dcb387d --- /dev/null +++ b/build/index.html @@ -0,0 +1 @@ +React App
\ No newline at end of file diff --git a/build/static/css/main.aa39b0f9.css b/build/static/css/main.aa39b0f9.css new file mode 100644 index 0000000..ebb8ae1 --- /dev/null +++ b/build/static/css/main.aa39b0f9.css @@ -0,0 +1,2 @@ +body{background-color:#232627;color:#fff;margin:0;padding:0}#root{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0}.GamemodeChooser{align-items:center;display:flex;flex-direction:column;height:calc(100vh - 6rem);justify-content:center;width:100vw}.GamemodeChooser .GamemodeButton{border:1px solid #5b76b7;font-size:1.5rem;margin:1rem;padding:.5rem 0;text-align:center;width:15rem}.MessageBox{align-items:center;bottom:0;display:flex;font-size:7rem;justify-content:center;left:0;position:fixed;right:0;text-align:center;top:0;z-index:10}.MessageBox p{background-color:#000000dd;padding:.5rem 2rem}.ScoreBoardContainer{left:0;margin:1rem auto;min-height:9rem;position:relative;right:0;text-align:center;width:30rem}.ScoreBoard{display:flex;font-size:3rem;justify-content:space-around;width:100%}.Grid{grid-row-gap:1.5rem;grid-column-gap:1.5rem;display:grid;grid-template-columns:9rem 9rem 9rem;grid-template-rows:9rem 9rem 9rem;height:calc(100vh - 17rem);left:0;margin:1rem auto;position:relative;right:0;width:30rem}.Box{border:1px solid #5b76b7;font-size:7rem;height:100%;justify-content:center}.Box,.Footer{align-items:center;display:flex;width:100%}.Footer{background-color:#0f0f0f;bottom:0;flex-direction:column;min-height:6rem;padding:.2rem 0;position:relative;text-align:center}.Footer p{color:#a75cb8;margin:.2rem;width:90%}.Footer a{color:#fff}@media only screen and (max-width:600px){.MessageBox{font-size:4rem}.ScoreBoardContainer{width:20rem}.ScoreBoard{font-size:3.5rem}.Grid{grid-row-gap:1.5rem;grid-column-gap:1.5rem;grid-template-columns:6rem 6rem 6rem;grid-template-rows:6rem 6rem 6rem;width:21rem}.Box{font-size:6rem}} +/*# sourceMappingURL=main.aa39b0f9.css.map*/ \ No newline at end of file diff --git a/build/static/css/main.aa39b0f9.css.map b/build/static/css/main.aa39b0f9.css.map new file mode 100644 index 0000000..fa9c860 --- /dev/null +++ b/build/static/css/main.aa39b0f9.css.map @@ -0,0 +1 @@ +{"version":3,"file":"static/css/main.aa39b0f9.css","mappings":"AAkBA,KAGE,wBAAyB,CACzB,UAAY,CAHZ,QAAS,CACT,SAGF,CAEA,MAGU,QAAS,CACjB,MAAO,CAFP,WAAY,CADZ,iBAAkB,CAGT,OAAQ,CADjB,KAEF,CAEA,iBAIE,kBAAmB,CAHnB,YAAa,CACb,qBAAsB,CAGtB,yBAA0B,CAF1B,sBAAuB,CAGvB,WACF,CAEA,iCACE,wBAAyB,CAEzB,gBAAiB,CAGjB,WAAY,CAFZ,eAAiB,CAFjB,iBAAkB,CAGlB,WAEF,CAEA,YAIE,kBAAmB,CAIX,QAAS,CANjB,YAAa,CADb,cAAe,CAEf,sBAAuB,CAMvB,MAAO,CAFP,cAAe,CAEN,OAAQ,CAJjB,iBAAkB,CAGlB,KAAM,CAEN,UACF,CAEA,cACE,0BAA2B,CAC3B,kBACF,CAEA,qBAGE,MAAO,CACP,gBAAiB,CAEjB,eAAgB,CAJhB,iBAAkB,CACT,OAAQ,CAFjB,iBAAkB,CAIlB,WAEF,CAEA,YACE,YAAa,CAGb,cAAe,CAFf,4BAA6B,CAC7B,UAEF,CAEA,MAKE,mBAAoB,CACpB,sBAAuB,CAJvB,YAAa,CACb,oCAAqC,CACrC,iCAAkC,CAHlC,0BAA2B,CAQ3B,MAAO,CACP,gBAAiB,CAFjB,iBAAkB,CACT,OAAQ,CAEjB,WACF,CAEA,KACE,wBAAyB,CAMzB,cAAe,CAFf,WAAY,CAFZ,sBAKF,CAEA,aANE,kBAAmB,CAFnB,YAAa,CAIb,UAeF,CAXA,QAME,wBAAyB,CAHzB,QAAS,CAKT,qBAAsB,CAPtB,eAAgB,CAIhB,eAAiB,CAHjB,iBAAkB,CAQlB,iBACF,CAEA,UACE,aAAc,CACd,YAAc,CACd,SACF,CAEA,UACE,UACF,CAEA,yCACE,YACE,cACF,CACA,qBACE,WACF,CACA,YACE,gBACF,CACA,MAGE,mBAAoB,CACpB,sBAAuB,CAHvB,oCAAqC,CACrC,iCAAkC,CAGlC,WACF,CACA,KACE,cACF,CACF","sources":["components/style.css"],"sourcesContent":["/*\n * Tic Tac Toe - Minimalistic Tic Tac Toe\n * Copyright (C) 2021 Vidhu Kant Sharma\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n */\n\nbody {\n margin: 0;\n padding: 0;\n background-color: #232627;\n color: white;\n}\n\n#root {\n position: absolute;\n margin: auto;\n top: 0; bottom: 0;\n left: 0; right: 0;\n}\n\n.GamemodeChooser {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n height: calc(100vh - 6rem);\n width: 100vw;\n}\n\n.GamemodeChooser .GamemodeButton {\n border: 1px solid #5b76b7;\n text-align: center;\n font-size: 1.5rem;\n padding: 0.5rem 0;\n width: 15rem;\n margin: 1rem;\n}\n\n.MessageBox {\n font-size: 7rem;\n display: flex;\n justify-content: center;\n align-items: center;\n text-align: center;\n\n position: fixed;\n top: 0; bottom: 0;\n left: 0; right: 0;\n z-index: 10;\n}\n\n.MessageBox p {\n background-color: #000000dd;\n padding: 0.5rem 2rem;\n}\n\n.ScoreBoardContainer {\n text-align: center;\n position: relative;\n left: 0; right: 0;\n margin: 1rem auto;\n width: 30rem;\n min-height: 9rem;\n}\n\n.ScoreBoard { \n display: flex;\n justify-content: space-around;\n width: 100%;\n font-size: 3rem;\n}\n\n.Grid {\n height: calc(100vh - 17rem);\n display: grid;\n grid-template-columns: 9rem 9rem 9rem;\n grid-template-rows: 9rem 9rem 9rem;\n grid-row-gap: 1.5rem;\n grid-column-gap: 1.5rem;\n\n position: relative;\n left: 0; right: 0;\n margin: 1rem auto;\n width: 30rem;\n}\n\n.Box {\n border: 1px solid #5b76b7;\n display: flex;\n justify-content: center;\n align-items: center;\n height: 100%;\n width: 100%;\n font-size: 7rem;\n}\n\n.Footer {\n min-height: 6rem;\n position: relative;\n bottom: 0;\n width: 100%;\n padding: 0.2rem 0;\n background-color: #0f0f0f;\n display: flex;\n flex-direction: column;\n align-items: center;\n text-align: center;\n}\n\n.Footer p {\n color: #a75cb8;\n margin: 0.2rem;\n width: 90%;\n}\n\n.Footer a {\n color: white;\n}\n\n@media only screen and (max-width: 600px) {\n .MessageBox {\n font-size: 4rem;\n }\n .ScoreBoardContainer {\n width: 20rem;\n }\n .ScoreBoard { \n font-size: 3.5rem;\n }\n .Grid {\n grid-template-columns: 6rem 6rem 6rem;\n grid-template-rows: 6rem 6rem 6rem;\n grid-row-gap: 1.5rem;\n grid-column-gap: 1.5rem;\n width: 21rem;\n }\n .Box {\n font-size: 6rem;\n }\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/build/static/js/main.9c7c2e70.js b/build/static/js/main.9c7c2e70.js new file mode 100644 index 0000000..ba942f9 --- /dev/null +++ b/build/static/js/main.9c7c2e70.js @@ -0,0 +1,3 @@ +/*! For license information please see main.9c7c2e70.js.LICENSE.txt */ +!function(){"use strict";var e={463:function(e,t,n){var r=n(791),a=n(296);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n