diff --git a/README.md b/README.md index 74872fd..c9a6b2e 100644 --- a/README.md +++ b/README.md @@ -1,50 +1,55 @@ -# React + TypeScript + Vite - -This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. - -Currently, two official plugins are available: - -- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh -- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh - -## Expanding the ESLint configuration - -If you are developing a production application, we recommend updating the configuration to enable type aware lint rules: - -- Configure the top-level `parserOptions` property like this: - -```js -export default tseslint.config({ - languageOptions: { - // other options... - parserOptions: { - project: ['./tsconfig.node.json', './tsconfig.app.json'], - tsconfigRootDir: import.meta.dirname, - }, - }, -}) -``` - -- Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked` -- Optionally add `...tseslint.configs.stylisticTypeChecked` -- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config: - -```js -// eslint.config.js -import react from 'eslint-plugin-react' - -export default tseslint.config({ - // Set the react version - settings: { react: { version: '18.3' } }, - plugins: { - // Add the react plugin - react, - }, - rules: { - // other rules... - // Enable its recommended rules - ...react.configs.recommended.rules, - ...react.configs['jsx-runtime'].rules, - }, -}) -``` +## :pushpin: 프로젝트명 +## CodeNameDavinci + +> 보드게임 '다빈치코드'를 웹 게임으로 구현 + +## 📆 개발기간 +2024년 12월 ~ 진행중 + +## 🕹 배포주소 : https://www.davincicodegame.store/home + +## 🏢 아키텍쳐 + + + +## 📚 기술스택 + + +## 🌄 화면구성 + + + + + + + + + +## 📺 게임플레이 +... + +## 🤗 맡은 역할 + +### 1⃣ 로그인 개발 +JWT 인증: Access Token 관리 + +### 2⃣ 공통 컴포넌트 개발 + #### Input 컴포넌트 + react-hook-form,zod를 사용하여 입력 검증 + 에러 메시지, 포커스 기능 추가 + + #### Button 컴포넌트 + 상태별 스타일 적용ㅋ + 클릭 이벤트 핸들링 최적화 + +### 3⃣ 게임 로직 개발 + #### 핵심 로직 구현 + 게임 상태 관리 (시작, 진행, 종료) + 플레이어 규칙 반영 + +### 4⃣ Socket 통신을 통한 UI/UX 개발 + 실시간 데이터 동기화 + Socket.io 적용 + 게임 이벤트 처리 + + diff --git a/src/components/ui/card/chatting/ChattingStyle.ts b/src/components/ui/card/chatting/ChattingStyle.ts index 7f6a6ff..4fdb6c2 100644 --- a/src/components/ui/card/chatting/ChattingStyle.ts +++ b/src/components/ui/card/chatting/ChattingStyle.ts @@ -19,4 +19,5 @@ export const chatInputBoxContainer = styled.div` display: flex; flex-direction: column; gap: 10px; + height: 100%; `; diff --git a/src/components/ui/chatInput/chatInputStyle.ts b/src/components/ui/chatInput/chatInputStyle.ts index ca77810..6fe5c36 100644 --- a/src/components/ui/chatInput/chatInputStyle.ts +++ b/src/components/ui/chatInput/chatInputStyle.ts @@ -3,8 +3,8 @@ import styled from "styled-components"; export const chatLog = styled.div` flex-grow: 1; font-size: 14px; - max-height: 290px; overflow-y: scroll; + height: 100%; `; export const chatInput = styled.input` @@ -31,5 +31,4 @@ export const chatInputBox = styled.div` width: 100%; display: flex; gap: 10px; - height: 100%; `; diff --git a/src/components/ui/modal/modalComponent.tsx b/src/components/ui/modal/modalComponent.tsx index 4e17f91..9b7d02c 100644 --- a/src/components/ui/modal/modalComponent.tsx +++ b/src/components/ui/modal/modalComponent.tsx @@ -13,10 +13,10 @@ export const modalComponents: Record = { selectWhiteBlack: , turnWaiting: , gameWaiting: , - GamrRoomJoinConfirm: ( + selectTurn: , + gameRoomJoinConfirm: ( ), guessNumber: , myTurn: , - selectTurn: , }; diff --git a/src/components/ui/ranking/RankingList.tsx b/src/components/ui/ranking/RankingList.tsx index 3ac6345..40e7fe5 100644 --- a/src/components/ui/ranking/RankingList.tsx +++ b/src/components/ui/ranking/RankingList.tsx @@ -1,7 +1,18 @@ import gold from "../../../assets/images/icon_gold.svg"; import silver from "../../../assets/images/icon_silver.svg"; import bronze from "../../../assets/images/icon_bronze.svg"; -import { BronzeImage, GoldImage, SilverImage } from "./rankingListStyle"; +import { + BronzeImage, + GoldImage, + Hr, + NickNameBox, + NicknameImage, + NickNameText, + RankingBox, + RankingNumber, + SilverImage, +} from "./rankingListStyle"; +import profile from "../../../assets/images/image_profile_01.svg"; interface IRankingList { nickname: string; @@ -11,19 +22,25 @@ interface IRankingList { export default function RankingList({ nickname, index }: IRankingList) { return (
-

- {index === 0 ? ( - - ) : index === 1 ? ( - - ) : index === 2 ? ( - - ) : ( - "" - )} -

-

{nickname}

-

{index + 1}

+ + +

+ {index === 0 ? ( + + ) : index === 1 ? ( + + ) : index === 2 ? ( + + ) : ( + "" + )} +

+ + {nickname} +
+ {index + 1} +
+
); } diff --git a/src/components/ui/ranking/rankingListStyle.ts b/src/components/ui/ranking/rankingListStyle.ts index 6b93fd6..9683391 100644 --- a/src/components/ui/ranking/rankingListStyle.ts +++ b/src/components/ui/ranking/rankingListStyle.ts @@ -1,5 +1,43 @@ import styled from "styled-components"; -export const GoldImage = styled.img``; -export const SilverImage = styled.img``; -export const BronzeImage = styled.img``; +export const RankingBox = styled.div` + display: flex; + justify-content: space-between; + align-items: center; + margin: 0px 44px 0px 61px; +`; +export const NickNameBox = styled.div` + display: flex; + gap: 20px; +`; +export const GoldImage = styled.img` + width: 30px; + height: 30px; +`; +export const SilverImage = styled.img` + width: 30px; + height: 30px; +`; +export const BronzeImage = styled.img` + width: 30px; + height: 30px; +`; +export const NicknameImage = styled.img` + width: 40px; + height: 40px; +`; +export const NickNameText = styled.div` + color: var(--gray-999); + font-size: 18px; + font-weight: 500; +`; +export const RankingNumber = styled.div` + color: var(--gray-999); + font-size: 24px; + font-weight: 600; +`; +export const Hr = styled.hr` + width: 400px; + height: 1px; + background: var(--gray-999); +`; diff --git a/src/pages/game/gameRoomList.tsx b/src/pages/game/gameRoomList.tsx index 8025b58..e5df6f4 100644 --- a/src/pages/game/gameRoomList.tsx +++ b/src/pages/game/gameRoomList.tsx @@ -22,7 +22,7 @@ export default function GameRoomList() { const onClickModalOpen = () => { if (!accessToken || accessToken === null) { - openModal("GamrRoomJoinConfirm", "white"); + openModal("gameRoomJoinConfirm", "white"); } else { openModal("makeRoom", "white"); } diff --git a/src/pages/rank/RankingPage.tsx b/src/pages/rank/RankingPage.tsx index fa6aa46..5c5d58c 100644 --- a/src/pages/rank/RankingPage.tsx +++ b/src/pages/rank/RankingPage.tsx @@ -5,25 +5,30 @@ import { MainTextBox, TrophyBox, TrophyImage, + Wrapper, } from "./rankingPageStyle"; import trophy from "../../assets/images/icon_trophy.svg"; +import RankingList from "../../components/ui/ranking/RankingList"; // import RankingList from "../../components/ui/ranking/RankingList"; export default function RangkingPage() { return ( - - - -

전체 랭킹

-
- -
닉네임
-
순위
-
-
- {/* {data?.ranking.map((user, index) => ( + + + + +

전체 랭킹

+
+ +
닉네임
+
순위
+
+
+ {/* {data?.ranking.map((user, index) => ( ))} */} -
+ +
+ ); } diff --git a/src/pages/rank/rankingPageStyle.ts b/src/pages/rank/rankingPageStyle.ts index c11a019..61d0066 100644 --- a/src/pages/rank/rankingPageStyle.ts +++ b/src/pages/rank/rankingPageStyle.ts @@ -1,5 +1,9 @@ import styled from "styled-components"; +export const Wrapper = styled.div` + display: flex; + justify-content: center; +`; export const FullBox = styled.div` width: 400px; display: flex; diff --git a/src/routes/router.tsx b/src/routes/router.tsx index 7d646f3..fbc4112 100644 --- a/src/routes/router.tsx +++ b/src/routes/router.tsx @@ -12,6 +12,7 @@ import Home from "@pages/home/Home"; import SignUpFinish from "@pages/user/signUp/SignUpFinish"; import Error from "@pages/error/Error"; import TestPage from "../pages/testpage/Testpage"; +import MyPage from "../pages/mypage/myScorePage/MyPage"; export const router = createBrowserRouter([ { @@ -58,13 +59,20 @@ export const router = createBrowserRouter([ ], }, { - path: "/user/mypage/checkPassword", - element: , - }, - { - path: "/user/mypage/updateMyPage", - element: , + path: "/user/mypage", + element: , + children: [ + { + path: "checkPassword", + element: , + }, + { + path: "updateMyPage", + element: , + }, + ], }, + { path: "/test", element: ,