diff --git a/package.json b/package.json index 58e1bb0..d3090db 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "typescript": "^5.1.3" }, "dependencies": { + "cors": "^2.8.5", "express": "^4.18.2" } } diff --git a/src/index.html b/src/index.html new file mode 100644 index 0000000..a0b6762 --- /dev/null +++ b/src/index.html @@ -0,0 +1,8 @@ + + +
+ + + + + \ No newline at end of file diff --git a/src/index.js b/src/index.js new file mode 100644 index 0000000..ee19410 --- /dev/null +++ b/src/index.js @@ -0,0 +1,21 @@ +function hellowWorldButton() { + const [isClick, setClickState] = React.useState(false) + return React.createElement('button', { onClick: () => {} }, 'Hello world!') +} +const rootContainer = document.getElementById('react-root') +ReactDOM.render(React.createElement(hellowWorldButton), rootContainer) + +const Navbar = ({ title }) => { + return ( + + ) +} + +export default Navbar diff --git a/src/main.js b/src/main.js index ba3dc19..cdcc752 100644 --- a/src/main.js +++ b/src/main.js @@ -1 +1,23 @@ // @ts-check + +const exp = require('constants') +const express = require('express') + +const path = require('path') + +const app = express() + +app.use(express.json()) +var cors = require('cors') +app.use(cors()) + +app.listen(3000, () => { + console.log('App Listening on port 3000') +}) +app.use(express.static(path.join(__dirname, '../style/build'))) +app.get('/', (req, res) => { + res.sendFile(path.join(__dirname, '../style/build/index.html')) +}) +app.get('*', (req, res) => { + res.sendFile(path.join(__dirname, '../style/build/index.html')) +}) diff --git a/style/.gitignore b/style/.gitignore new file mode 100644 index 0000000..4d29575 --- /dev/null +++ b/style/.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/style/.prettierrc b/style/.prettierrc new file mode 100644 index 0000000..667a7ed --- /dev/null +++ b/style/.prettierrc @@ -0,0 +1,5 @@ +{ + "semi": false, + "singleQuote": true, + "trailingComma": "es5" +} \ No newline at end of file diff --git a/style/README.md b/style/README.md new file mode 100644 index 0000000..58beeac --- /dev/null +++ b/style/README.md @@ -0,0 +1,70 @@ +# Getting Started with Create React App + +This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). + +## Available Scripts + +In the project directory, you can run: + +### `npm start` + +Runs the app in the development mode.\ +Open [http://localhost:3000](http://localhost:3000) to view it in your browser. + +The page will reload when you make changes.\ +You may also see any lint errors in the console. + +### `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/style/package.json b/style/package.json new file mode 100644 index 0000000..6db89d9 --- /dev/null +++ b/style/package.json @@ -0,0 +1,52 @@ +{ + "name": "style", + "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", + "bootstrap": "^5.3.0", + "eslint-config-prettier": "^8.8.0", + "eslint-plugin-prettier": "^4.2.1", + "prop-types": "^15.8.1", + "react": "^18.2.0", + "react-bootstrap": "^2.7.4", + "react-dom": "^18.2.0", + "react-redux": "^8.1.1", + "react-scripts": "5.0.1", + "redux": "^4.2.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" + ] + }, + "devDependencies": { + "@babel/plugin-proposal-private-property-in-object": "^7.21.11", + "eslint": "^8.42.0", + "nodemon": "^2.0.22", + "prettier": "^2.8.8", + "redux-devtools-extension": "^2.13.9" + } +} diff --git a/style/public/favicon.ico b/style/public/favicon.ico new file mode 100644 index 0000000..a11777c Binary files /dev/null and b/style/public/favicon.ico differ diff --git a/style/public/index.html b/style/public/index.html new file mode 100644 index 0000000..aa069f2 --- /dev/null +++ b/style/public/index.html @@ -0,0 +1,43 @@ + + + + + + + + + + + + + React App + + + +
+ + + diff --git a/style/public/logo192.png b/style/public/logo192.png new file mode 100644 index 0000000..fc44b0a Binary files /dev/null and b/style/public/logo192.png differ diff --git a/style/public/logo512.png b/style/public/logo512.png new file mode 100644 index 0000000..a4e47a6 Binary files /dev/null and b/style/public/logo512.png differ diff --git a/style/public/manifest.json b/style/public/manifest.json new file mode 100644 index 0000000..080d6c7 --- /dev/null +++ b/style/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/style/public/robots.txt b/style/public/robots.txt new file mode 100644 index 0000000..e9e57dc --- /dev/null +++ b/style/public/robots.txt @@ -0,0 +1,3 @@ +# https://www.robotstxt.org/robotstxt.html +User-agent: * +Disallow: diff --git a/style/src/MyPage.js b/style/src/MyPage.js new file mode 100644 index 0000000..5009409 --- /dev/null +++ b/style/src/MyPage.js @@ -0,0 +1,20 @@ +import { useEffect, useState } from 'react' +import styles from './styles/MyPage.module.css' +import MyLeftSubPage from './components/MyPage/MyLeftSubPage' +import MyRightSubPage from './components/MyPage/MyRightSubPage' + +function MyPage() { + const [page, setPage] = useState('privacy') + const changePage = (pageName) => { + setPage(pageName) + console.log(pageName) + } + return ( +
+ + +
+ ) +} + +export default MyPage diff --git a/style/src/components/Content.css b/style/src/components/Content.css new file mode 100644 index 0000000..e03fccf --- /dev/null +++ b/style/src/components/Content.css @@ -0,0 +1,13 @@ +.container { + display: flex; + align-items: center; /* 수직 가운데 정렬 */ + } + + .photo { + flex: 0 0 auto; /* 사진이 크기를 유지하도록 설정 */ + margin-right: 10px; /* 사진과 글 사이의 간격 설정 */ + } + + .text { + flex: 1; /* 글이 남은 공간을 모두 차지하도록 설정 */ + } \ No newline at end of file diff --git a/style/src/components/Content.js b/style/src/components/Content.js new file mode 100644 index 0000000..59d9d6e --- /dev/null +++ b/style/src/components/Content.js @@ -0,0 +1,58 @@ +import './Content.css' +import photo1 from '../images/photo1.png' +import photo2 from '../images/photo2.png' +import photo3 from '../images/photo3.png' +import photo4 from '../images/photo4.png' +import photo5 from '../images/photo5.png' + +function Content() { + return ( +
+
+
+ Photo 1 +
+
+

ㅇㅇㅇㅇ장의 데이터로 학습한 AI

+

실착한 핏을 온라인에서 쉽고 편안하게 확인

+

당신의 AI 핏 어드바이저

+
+
+
+
+

매장을 번거롭게 방문하지 마세요.

+

집에서 편하게 입혀보세요.

+

가상 피팅으로 당신의 시간을 절약하세요.

+
+
+ Photo 2 +
+
+
+ Photo 3 +
+
+

사이즈,

+

더 이상 고민하지 마세요.

+

AI가 스마트하게 당신에게 최적의 사이즈를 추천합니다.

+
+ +
+

무슨 옷을 살지 고민이신가요?

+

당신에게 맞는, 최적의 코디를 추천해드립니다.

+
+
+ Photo 4 +
+ +
+ Photo 5 +
+
+

당신의 멋진 감각을 공유하세요.

+
+
+ ) +} + +export default Content diff --git a/style/src/components/Footer.js b/style/src/components/Footer.js new file mode 100644 index 0000000..95f0f7a --- /dev/null +++ b/style/src/components/Footer.js @@ -0,0 +1,9 @@ +const Footer = () => { + return ( + + ) +} + +export default Footer diff --git a/style/src/components/MyPage/FormBox.js b/style/src/components/MyPage/FormBox.js new file mode 100644 index 0000000..8906749 --- /dev/null +++ b/style/src/components/MyPage/FormBox.js @@ -0,0 +1,45 @@ +import ClassMerger from '../../tools/ClassNameGenerater' +import Proptypes from 'prop-types' +import { Form } from 'react-bootstrap' +import styles from '../../styles/MyPage.module.css' + +function FormBox({ + id, + label, + type, + data, + min, + max, + pattern, + disabled = false, +}) { + return ( + + + {label} + + + + ) +} + +FormBox.propTypes = { + id: Proptypes.string.isRequired, + label: Proptypes.string.isRequired, + type: Proptypes.string.isRequired, + data: Proptypes.string.isRequired, + min: Proptypes.string, + max: Proptypes.string, + pattern: Proptypes.string, + disabled: Proptypes.bool, +} + +export default FormBox diff --git a/style/src/components/MyPage/MyLeftSubPage.js b/style/src/components/MyPage/MyLeftSubPage.js new file mode 100644 index 0000000..e9f6db7 --- /dev/null +++ b/style/src/components/MyPage/MyLeftSubPage.js @@ -0,0 +1,69 @@ +import styles from '../../styles/MyPage.module.css' +import profileImage from '../../images/profile.jpg' +import Proptypes from 'prop-types' +import ClassMerger from '../../tools/ClassNameGenerater' + +function TransButton({ context, option, page, onClick }) { + return ( + + ) +} + +TransButton.propTypes = { + context: Proptypes.string.isRequired, + option: Proptypes.string.isRequired, + onClick: Proptypes.func.isRequired, +} + +function MyLeftSubPage({ page, onClickHandler }) { + return ( +
+

마이페이지

+ profile + + + + +
+ ) +} + +MyLeftSubPage.propTypes = { + page: Proptypes.string.isRequired, + onClickHandler: Proptypes.func.isRequired, +} + +export default MyLeftSubPage diff --git a/style/src/components/MyPage/MyPrivacy.js b/style/src/components/MyPage/MyPrivacy.js new file mode 100644 index 0000000..65acc23 --- /dev/null +++ b/style/src/components/MyPage/MyPrivacy.js @@ -0,0 +1,41 @@ +import ClassMerger from '../../tools/ClassNameGenerater' +import styles from '../../styles/MyPage.module.css' +import FormBox from './FormBox' + +function MyPrivacy() { + return ( +
+
+ + + + + +
+
+
+ +
+
+
+ ) +} + +export default MyPrivacy diff --git a/style/src/components/MyPage/MyRightSubPage.js b/style/src/components/MyPage/MyRightSubPage.js new file mode 100644 index 0000000..1f2e704 --- /dev/null +++ b/style/src/components/MyPage/MyRightSubPage.js @@ -0,0 +1,27 @@ +import Proptypes from 'prop-types' +import MyPrivacy from './MyPrivacy' + +function MyRightSubPage({ page }) { + switch (page) { + case 'privacy': + return + case 'size': + return <>사이즈정보 + case 'closet': + return ( + <>옷장 - 어떻게 해야할 지 생각 중. 무슨 데이터가 들어가야 할까요? + ) + case 'style': + return ( + <>스타일 - 어떻게 해야할 지 생각 중. 무슨 데이터가 들어가야 할까요? + ) + default: + return <>error! + } +} + +MyRightSubPage.propTypes = { + page: Proptypes.string.isRequired, +} + +export default MyRightSubPage diff --git a/style/src/components/Nav.js b/style/src/components/Nav.js new file mode 100644 index 0000000..c76c272 --- /dev/null +++ b/style/src/components/Nav.js @@ -0,0 +1,39 @@ +import Container from 'react-bootstrap/Container' +import Nav from 'react-bootstrap/Nav' +import Navbar from 'react-bootstrap/Navbar' +import NavDropdown from 'react-bootstrap/NavDropdown' + +function Navigation() { + return ( + + + 메인페이지 + + + + + + + + ) +} + +export default Navigation diff --git a/style/src/images/photo1.png b/style/src/images/photo1.png new file mode 100644 index 0000000..2ed499f Binary files /dev/null and b/style/src/images/photo1.png differ diff --git a/style/src/images/photo2.png b/style/src/images/photo2.png new file mode 100644 index 0000000..fe491ab Binary files /dev/null and b/style/src/images/photo2.png differ diff --git a/style/src/images/photo3.png b/style/src/images/photo3.png new file mode 100644 index 0000000..b44b677 Binary files /dev/null and b/style/src/images/photo3.png differ diff --git a/style/src/images/photo4.png b/style/src/images/photo4.png new file mode 100644 index 0000000..c42f8cb Binary files /dev/null and b/style/src/images/photo4.png differ diff --git a/style/src/images/photo5.png b/style/src/images/photo5.png new file mode 100644 index 0000000..e677a2d Binary files /dev/null and b/style/src/images/photo5.png differ diff --git a/style/src/images/profile.jpg b/style/src/images/profile.jpg new file mode 100644 index 0000000..f7ac204 Binary files /dev/null and b/style/src/images/profile.jpg differ diff --git a/style/src/index.css b/style/src/index.css new file mode 100644 index 0000000..e4dac3c --- /dev/null +++ b/style/src/index.css @@ -0,0 +1,8 @@ +@font-face { + font-family: 'BMJUA'; + src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_one@1.0/BMJUA.woff') format('woff'); + font-weight: normal; + font-style: normal; +} + +@import url('https://cdn.rawgit.com/moonspam/NanumSquare/master/nanumsquare.css'); \ No newline at end of file diff --git a/style/src/index.js b/style/src/index.js new file mode 100644 index 0000000..05fe4a4 --- /dev/null +++ b/style/src/index.js @@ -0,0 +1,20 @@ +import React from 'react' +import ReactDOM from 'react-dom/client' +import MyPage from './MyPage' +import './index.css' +import Nav from './components/Nav' +import 'bootstrap/dist/css/bootstrap.css' + +import { Provider } from 'redux' +import { createStore } from 'redux' + +const root = ReactDOM.createRoot(document.getElementById('root')) +root.render( + <> + {/* */} + +