From 9a2bca1ca186623f10f9513a748c94d512f65a8e Mon Sep 17 00:00:00 2001 From: Sushant Dhimal Date: Thu, 29 Dec 2022 21:57:05 +0545 Subject: [PATCH] feat: initial commit and create a basic layout --- .gitignore | 24 +- client/.gitignore | 23 ++ README.md => client/README.md | 0 package-lock.json => client/package-lock.json | 0 client/package.json | 38 ++ {public => client/public}/favicon.ico | Bin {public => client/public}/index.html | 0 {public => client/public}/logo192.png | Bin {public => client/public}/logo512.png | Bin {public => client/public}/manifest.json | 0 {public => client/public}/robots.txt | 0 client/src/App.css | 70 ++++ client/src/App.js | 30 ++ {src => client/src}/App.test.js | 0 {src => client/src}/index.css | 0 {src => client/src}/index.js | 0 {src => client/src}/logo.svg | 0 client/src/normal.css | 351 ++++++++++++++++++ {src => client/src}/reportWebVitals.js | 0 {src => client/src}/setupTests.js | 0 package.json | 41 +- src/App.css | 38 -- src/App.js | 25 -- 23 files changed, 520 insertions(+), 120 deletions(-) create mode 100644 client/.gitignore rename README.md => client/README.md (100%) rename package-lock.json => client/package-lock.json (100%) create mode 100644 client/package.json rename {public => client/public}/favicon.ico (100%) rename {public => client/public}/index.html (100%) rename {public => client/public}/logo192.png (100%) rename {public => client/public}/logo512.png (100%) rename {public => client/public}/manifest.json (100%) rename {public => client/public}/robots.txt (100%) create mode 100644 client/src/App.css create mode 100644 client/src/App.js rename {src => client/src}/App.test.js (100%) rename {src => client/src}/index.css (100%) rename {src => client/src}/index.js (100%) rename {src => client/src}/logo.svg (100%) create mode 100644 client/src/normal.css rename {src => client/src}/reportWebVitals.js (100%) rename {src => client/src}/setupTests.js (100%) delete mode 100644 src/App.css delete mode 100644 src/App.js diff --git a/.gitignore b/.gitignore index 4d29575..3c3629e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,23 +1 @@ -# 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* +node_modules diff --git a/client/.gitignore b/client/.gitignore new file mode 100644 index 0000000..4d29575 --- /dev/null +++ b/client/.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/README.md b/client/README.md similarity index 100% rename from README.md rename to client/README.md diff --git a/package-lock.json b/client/package-lock.json similarity index 100% rename from package-lock.json rename to client/package-lock.json diff --git a/client/package.json b/client/package.json new file mode 100644 index 0000000..49794ba --- /dev/null +++ b/client/package.json @@ -0,0 +1,38 @@ +{ + "name": "clone-chatgpt-client", + "version": "0.1.0", + "private": true, + "dependencies": { + "@testing-library/jest-dom": "^5.16.5", + "@testing-library/react": "^13.4.0", + "@testing-library/user-event": "^13.5.0", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "react-scripts": "5.0.1", + "web-vitals": "^2.1.4" + }, + "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/client/public/favicon.ico similarity index 100% rename from public/favicon.ico rename to client/public/favicon.ico diff --git a/public/index.html b/client/public/index.html similarity index 100% rename from public/index.html rename to client/public/index.html diff --git a/public/logo192.png b/client/public/logo192.png similarity index 100% rename from public/logo192.png rename to client/public/logo192.png diff --git a/public/logo512.png b/client/public/logo512.png similarity index 100% rename from public/logo512.png rename to client/public/logo512.png diff --git a/public/manifest.json b/client/public/manifest.json similarity index 100% rename from public/manifest.json rename to client/public/manifest.json diff --git a/public/robots.txt b/client/public/robots.txt similarity index 100% rename from public/robots.txt rename to client/public/robots.txt diff --git a/client/src/App.css b/client/src/App.css new file mode 100644 index 0000000..75642c0 --- /dev/null +++ b/client/src/App.css @@ -0,0 +1,70 @@ +.App { + text-align: center; + background-color: #282c34; + color: #fff; + display: flex; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; +} +.sideMenu { + width: 244px; + padding: 8px; + background-color: #202022; +} +.sideMenu-button { + border: 1px solid hsl(0deg 0% 100% / 20%); + border-radius: 5px; + padding: 10px; + text-align: left; + font-size: 14px; + transition: all 0.25s ease; + -webkit-transition: all 0.25s ease; + -moz-transition: all 0.25s ease; + -o-transition: all 0.25s ease; +} +.sideMenu-button:hover { + cursor: pointer; + background-color: hsla(240, 9%, 59%, 0.1); +} +.sideMenu-button span { + font-size: 20px; + font-weight: 500; + padding-left: 6px; + padding-right: 10px; +} +.chatBox { + flex: 1; + background-color: #353540; + position: relative; +} +.inputPrompt-wrapper { + padding: 8px; + position: absolute; + left: 0; + right: 0; + bottom: 0; +} +.inputPrompt-textarea { + width: 80%; + max-height: 200px; + height: 28px; + padding: 10px; + resize: none; + font-size: 16px; + background-color: #41414e; + color: #fff; + outline: none; + border: none; + border-radius: 5px; + box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.25); + overflow-y: hidden; +} + +@media screen and (max-width: 768px) { + .sideMenu { + display: none; + } +} diff --git a/client/src/App.js b/client/src/App.js new file mode 100644 index 0000000..6ca784d --- /dev/null +++ b/client/src/App.js @@ -0,0 +1,30 @@ +import logo from "./logo.svg"; +import "./normal.css"; +import "./App.css"; + +function App() { + return ( +
+ +
+
+ +

+
+
+
+ ); +} + +export default App; diff --git a/src/App.test.js b/client/src/App.test.js similarity index 100% rename from src/App.test.js rename to client/src/App.test.js diff --git a/src/index.css b/client/src/index.css similarity index 100% rename from src/index.css rename to client/src/index.css diff --git a/src/index.js b/client/src/index.js similarity index 100% rename from src/index.js rename to client/src/index.js diff --git a/src/logo.svg b/client/src/logo.svg similarity index 100% rename from src/logo.svg rename to client/src/logo.svg diff --git a/client/src/normal.css b/client/src/normal.css new file mode 100644 index 0000000..bb6e2a7 --- /dev/null +++ b/client/src/normal.css @@ -0,0 +1,351 @@ +/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ + +/* Document + ========================================================================== */ + +/** + * 1. Correct the line height in all browsers. + * 2. Prevent adjustments of font size after orientation changes in iOS. + */ + +html { + line-height: 1.15; /* 1 */ + -webkit-text-size-adjust: 100%; /* 2 */ +} + +/* Sections + ========================================================================== */ + +/** + * Remove the margin in all browsers. + */ + +body { + margin: 0; +} + +/** + * Render the `main` element consistently in IE. + */ + +main { + display: block; +} + +/** + * Correct the font size and margin on `h1` elements within `section` and + * `article` contexts in Chrome, Firefox, and Safari. + */ + +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +/* Grouping content + ========================================================================== */ + +/** + * 1. Add the correct box sizing in Firefox. + * 2. Show the overflow in Edge and IE. + */ + +hr { + box-sizing: content-box; /* 1 */ + height: 0; /* 1 */ + overflow: visible; /* 2 */ +} + +/** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ + +pre { + font-family: monospace, monospace; /* 1 */ + font-size: 1em; /* 2 */ +} + +/* Text-level semantics + ========================================================================== */ + +/** + * Remove the gray background on active links in IE 10. + */ + +a { + background-color: transparent; +} + +/** + * 1. Remove the bottom border in Chrome 57- + * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. + */ + +abbr[title] { + border-bottom: none; /* 1 */ + text-decoration: underline; /* 2 */ + text-decoration: underline dotted; /* 2 */ +} + +/** + * Add the correct font weight in Chrome, Edge, and Safari. + */ + +b, +strong { + font-weight: bolder; +} + +/** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ + +code, +kbd, +samp { + font-family: monospace, monospace; /* 1 */ + font-size: 1em; /* 2 */ +} + +/** + * Add the correct font size in all browsers. + */ + +small { + font-size: 80%; +} + +/** + * Prevent `sub` and `sup` elements from affecting the line height in + * all browsers. + */ + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sub { + bottom: -0.25em; +} + +sup { + top: -0.5em; +} + +/* Embedded content + ========================================================================== */ + +/** + * Remove the border on images inside links in IE 10. + */ + +img { + border-style: none; +} + +/* Forms + ========================================================================== */ + +/** + * 1. Change the font styles in all browsers. + * 2. Remove the margin in Firefox and Safari. + */ + +button, +input, +optgroup, +select, +textarea { + font-family: inherit; /* 1 */ + font-size: 100%; /* 1 */ + line-height: 1.15; /* 1 */ + margin: 0; /* 2 */ +} + +/** + * Show the overflow in IE. + * 1. Show the overflow in Edge. + */ + +button, +input { + /* 1 */ + overflow: visible; +} + +/** + * Remove the inheritance of text transform in Edge, Firefox, and IE. + * 1. Remove the inheritance of text transform in Firefox. + */ + +button, +select { + /* 1 */ + text-transform: none; +} + +/** + * Correct the inability to style clickable types in iOS and Safari. + */ + +button, +[type="button"], +[type="reset"], +[type="submit"] { + -webkit-appearance: button; +} + +/** + * Remove the inner border and padding in Firefox. + */ + +button::-moz-focus-inner, +[type="button"]::-moz-focus-inner, +[type="reset"]::-moz-focus-inner, +[type="submit"]::-moz-focus-inner { + border-style: none; + padding: 0; +} + +/** + * Restore the focus styles unset by the previous rule. + */ + +button:-moz-focusring, +[type="button"]:-moz-focusring, +[type="reset"]:-moz-focusring, +[type="submit"]:-moz-focusring { + outline: 1px dotted ButtonText; +} + +/** + * Correct the padding in Firefox. + */ + +fieldset { + padding: 0.35em 0.75em 0.625em; +} + +/** + * 1. Correct the text wrapping in Edge and IE. + * 2. Correct the color inheritance from `fieldset` elements in IE. + * 3. Remove the padding so developers are not caught out when they zero out + * `fieldset` elements in all browsers. + */ + +legend { + box-sizing: border-box; /* 1 */ + color: inherit; /* 2 */ + display: table; /* 1 */ + max-width: 100%; /* 1 */ + padding: 0; /* 3 */ + white-space: normal; /* 1 */ +} + +/** + * Add the correct vertical alignment in Chrome, Firefox, and Opera. + */ + +progress { + vertical-align: baseline; +} + +/** + * Remove the default vertical scrollbar in IE 10+. + */ + +textarea { + overflow: auto; +} + +/** + * 1. Add the correct box sizing in IE 10. + * 2. Remove the padding in IE 10. + */ + +[type="checkbox"], +[type="radio"] { + box-sizing: border-box; /* 1 */ + padding: 0; /* 2 */ +} + +/** + * Correct the cursor style of increment and decrement buttons in Chrome. + */ + +[type="number"]::-webkit-inner-spin-button, +[type="number"]::-webkit-outer-spin-button { + height: auto; +} + +/** + * 1. Correct the odd appearance in Chrome and Safari. + * 2. Correct the outline style in Safari. + */ + +[type="search"] { + -webkit-appearance: textfield; /* 1 */ + outline-offset: -2px; /* 2 */ +} + +/** + * Remove the inner padding in Chrome and Safari on macOS. + */ + +[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * 1. Correct the inability to style clickable types in iOS and Safari. + * 2. Change font properties to `inherit` in Safari. + */ + +::-webkit-file-upload-button { + -webkit-appearance: button; /* 1 */ + font: inherit; /* 2 */ +} + +/* Interactive + ========================================================================== */ + +/* + * Add the correct display in Edge, IE 10+, and Firefox. + */ + +details { + display: block; +} + +/* + * Add the correct display in all browsers. + */ + +summary { + display: list-item; +} + +/* Misc + ========================================================================== */ + +/** + * Add the correct display in IE 10+. + */ + +template { + display: none; +} + +/** + * Add the correct display in IE 10. + */ + +[hidden] { + display: none; +} diff --git a/src/reportWebVitals.js b/client/src/reportWebVitals.js similarity index 100% rename from src/reportWebVitals.js rename to client/src/reportWebVitals.js diff --git a/src/setupTests.js b/client/src/setupTests.js similarity index 100% rename from src/setupTests.js rename to client/src/setupTests.js diff --git a/package.json b/package.json index 8ee8bfe..b5438e4 100644 --- a/package.json +++ b/package.json @@ -1,38 +1,11 @@ { - "name": "clone-chatgpt", - "version": "0.1.0", - "private": true, - "dependencies": { - "@testing-library/jest-dom": "^5.16.5", - "@testing-library/react": "^13.4.0", - "@testing-library/user-event": "^13.5.0", - "react": "^18.2.0", - "react-dom": "^18.2.0", - "react-scripts": "5.0.1", - "web-vitals": "^2.1.4" - }, + "name": "clone-chatgpt-server", + "version": "1.0.0", + "description": "", + "main": "index.js", "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test", - "eject": "react-scripts eject" + "test": "echo \"Error: no test specified\" && exit 1" }, - "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" - ] - } + "author": "Sushant Dhimal", + "license": "ISC" } diff --git a/src/App.css b/src/App.css deleted file mode 100644 index 74b5e05..0000000 --- a/src/App.css +++ /dev/null @@ -1,38 +0,0 @@ -.App { - text-align: center; -} - -.App-logo { - height: 40vmin; - pointer-events: none; -} - -@media (prefers-reduced-motion: no-preference) { - .App-logo { - animation: App-logo-spin infinite 20s linear; - } -} - -.App-header { - background-color: #282c34; - min-height: 100vh; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - font-size: calc(10px + 2vmin); - color: white; -} - -.App-link { - color: #61dafb; -} - -@keyframes App-logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -} diff --git a/src/App.js b/src/App.js deleted file mode 100644 index 3784575..0000000 --- a/src/App.js +++ /dev/null @@ -1,25 +0,0 @@ -import logo from './logo.svg'; -import './App.css'; - -function App() { - return ( -
-
- logo -

- Edit src/App.js and save to reload. -

- - Learn React - -
-
- ); -} - -export default App;