-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [init] 모든 작업 초기화 * [style] 공통 스타일, common 스타일 적용 * [style] Common, Global Style Update * [style] 절대경로 설정 * [feat] Header 페이지 전환 Toggle버튼 구현 * [feat]라우트 기능 설정 * [fix] module 버전 불일치로 인한 버그 수정을 위한 npm update * [feat] 404 NotFound Page 구현 * [style] 웹폰트 적용 * [style] Product Img 추가 * [style] 전역 style 수정 * [feat] VM Product Mokdata 구성 * [feat] Page 전환시 Header Slide 구현 * [feat] product context 구현 * [feat] 404 Not found Page 라우트 활성화 * [feat] 자판기 Product 화면 구현, Context를 이용해 재고상황 저장, Local Storage를 통해 페이지 이동시에 상태 손실 해결 * [style]불필요한 코드 제거 * [fix] 충돌 해결문구 제거 * [feat] Context 범위 변경 Local Storage 제거 * [feat] 상태표시창 화면 구현 * [feat]상태표시창 css 추가 * [feat] Context 범위 재설정, Local strorage 삭제
- Loading branch information
Showing
42 changed files
with
2,732 additions
and
5,305 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"compilerOptions": { | ||
"baseUrl": "src" | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React from 'react'; | ||
import { Route, Routes } from 'react-router-dom'; | ||
import { StockProvider } from 'context/productStock'; | ||
import GlobalStyle from 'Assets/Style/Global'; | ||
import GNB from 'components/Header/GNB'; | ||
import VM from 'pages/VM'; | ||
import Wallet from 'pages/Wallet'; | ||
import Store from 'pages/Store'; | ||
import NotFound from 'pages/NotFound'; | ||
|
||
const App = () => { | ||
return ( | ||
<> | ||
<GlobalStyle /> | ||
<GNB /> | ||
<StockProvider> | ||
<Routes> | ||
<Route index element={<VM />} /> | ||
<Route path="/vm" element={<VM />} /> | ||
<Route path="/wallet" element={<Wallet />} /> | ||
<Route path="/store" element={<Store />} /> | ||
<Route path="*" element={<NotFound />} /> | ||
</Routes> | ||
</StockProvider> | ||
</> | ||
); | ||
}; | ||
export default App; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { css } from 'styled-components'; | ||
|
||
const F_center = css` | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
`; | ||
|
||
const Default_shadow = css` | ||
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25); | ||
`; | ||
|
||
const Default_radius = css` | ||
border-radius: 1.5rem; | ||
`; | ||
|
||
const Color = { | ||
black: '#010305;', | ||
white: '#FFFFFF', | ||
gray: '#D9D9D9', | ||
headerGray: '#1C2024', | ||
backGroundGray: '#2B2F34;', | ||
lightGray: '#3D444C', | ||
darkGray: '#1D2125;', | ||
yellowGreen: '#12DD88', | ||
neonGreen: 'rgba(64, 233, 101, 1)', | ||
}; | ||
|
||
export { F_center, Default_radius, Default_shadow, Color }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { createGlobalStyle } from 'styled-components'; | ||
import { reset } from 'styled-reset'; | ||
import { Color } from './Common'; | ||
|
||
const GlobalStyle = createGlobalStyle` | ||
${reset} | ||
input::-webkit-outer-spin-button, | ||
input::-webkit-inner-spin-button { | ||
-webkit-appearance: none; | ||
margin: 0; | ||
} | ||
html{ | ||
font-size: 10px; | ||
font-family: 'Noto Sans KR', sans-serif; | ||
} | ||
body{ | ||
background-color: ${Color.black}; | ||
} | ||
button{ | ||
cursor: pointer; | ||
outline: none; | ||
}; | ||
#root{ | ||
display: flex; | ||
align-items:center; | ||
flex-direction: column; | ||
width: 100vw; | ||
height: 100vh; | ||
} | ||
`; | ||
|
||
export default GlobalStyle; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
const VMproducts = [ | ||
{ | ||
name: '레인보우샤베트', | ||
price: 2500, | ||
img: '/img/rainbow.png', | ||
stock: 2, | ||
id: 'rainbow', | ||
}, | ||
{ | ||
name: '환타', | ||
price: 1000, | ||
img: '/img/orange.png', | ||
stock: 3, | ||
id: 'fanta', | ||
}, | ||
{ | ||
name: '에너지드링크', | ||
price: 800, | ||
img: '/img/soda.png', | ||
stock: 10, | ||
id: 'powerAde', | ||
}, | ||
{ | ||
name: '초코우유', | ||
price: 1000, | ||
img: '/img/chocolate.png', | ||
stock: 5, | ||
id: 'chocolate', | ||
}, | ||
{ | ||
name: '코코아주스', | ||
price: 1200, | ||
img: '/img/papaya.png', | ||
stock: 4, | ||
id: 'cocoa', | ||
}, | ||
{ | ||
name: '오렌지주스', | ||
price: 1300, | ||
img: '/img/orange2.png', | ||
stock: 4, | ||
id: 'orangeJuice', | ||
}, | ||
{ | ||
name: '딸기주스', | ||
price: 1000, | ||
img: '/img/strawJuice.png', | ||
stock: 4, | ||
id: 'strawberry', | ||
}, | ||
{ | ||
name: '블루베리주스', | ||
price: 1000, | ||
img: '/img/grape.png', | ||
stock: 4, | ||
id: 'blueberry', | ||
}, | ||
{ | ||
name: '요구르트', | ||
price: 500, | ||
img: '/img/yogurt.png', | ||
stock: 15, | ||
id: 'yogurt', | ||
}, | ||
{ | ||
name: '아보카도주스', | ||
price: 1500, | ||
img: '/img/abokado.png', | ||
stock: 4, | ||
id: 'abocado', | ||
}, | ||
{ | ||
name: '생수', | ||
price: 500, | ||
img: '/img/water.png', | ||
stock: 15, | ||
id: 'water', | ||
}, | ||
{ | ||
name: '참이슬', | ||
price: 4500, | ||
img: '/img/soju.png', | ||
stock: 100, | ||
id: 'soju', | ||
}, | ||
]; | ||
|
||
export default VMproducts; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
import { useLocation, useNavigate } from 'react-router-dom'; | ||
import { F_center, Color } from 'Assets/Style/Common'; | ||
|
||
const GNB = () => { | ||
const { pathname } = useLocation(); | ||
const navigate = useNavigate(); | ||
|
||
const VMBtnClickHandler = () => { | ||
navigate('/vm'); | ||
}; | ||
const WalletBtnClickHandler = () => { | ||
navigate('/wallet'); | ||
}; | ||
|
||
return ( | ||
<form> | ||
<GNBdiv> | ||
<Slide className="slide" pathname={pathname} /> | ||
<GNBRadioButton | ||
type="radio" | ||
name="GNB" | ||
id="VMPageSelectBtn" | ||
checked={true} | ||
readOnly | ||
/> | ||
<GNBLabel | ||
onClick={VMBtnClickHandler} | ||
htmlFor="VMPageSelectBtn" | ||
className="VMSelectBtn"> | ||
자판기 | ||
</GNBLabel> | ||
<GNBRadioButton | ||
type="radio" | ||
name="GNB" | ||
id="WalletPageSelectBtn" | ||
readOnly | ||
/> | ||
<GNBLabel | ||
onClick={WalletBtnClickHandler} | ||
htmlFor="WalletPageSelectBtn" | ||
className="WalletSelectBtn"> | ||
지갑 | ||
</GNBLabel> | ||
</GNBdiv> | ||
</form> | ||
); | ||
}; | ||
|
||
const Slide = styled.div` | ||
background-color: ${Color.yellowGreen}; | ||
position: absolute; | ||
width: 20rem; | ||
height: 6.9rem; | ||
border-radius: 10rem; | ||
transition: 0.3s; | ||
box-shadow: 0 0.3rem 2rem rgba(79, 255, 181, 0.5); | ||
${({ pathname }) => { | ||
if (pathname !== '/wallet') { | ||
return 'left:50%;transform:translateX(-100%)'; | ||
} | ||
return 'right: 0px'; | ||
}} | ||
`; | ||
|
||
const GNBdiv = styled.div` | ||
${F_center}; | ||
$this: &; | ||
margin-top: 3rem; | ||
justify-content: space-around; | ||
position: relative; | ||
width: 40rem; | ||
height: 6.9rem; | ||
background-color: ${Color.headerGray}; | ||
box-shadow: 0 0.4rem 3rem rgba(19, 15, 37, 0.1); | ||
border-radius: 10rem; | ||
#VMPageSelectBtn:checked ~ .VMSelectBtn { | ||
color: black; | ||
} | ||
#WalletPageSelectBtn:checked ~ .WalletSelectBtn { | ||
color: black; | ||
} | ||
`; | ||
|
||
const GNBRadioButton = styled.input` | ||
display: none; | ||
`; | ||
|
||
const GNBLabel = styled.label` | ||
${F_center} | ||
color: #6E757D; | ||
width: 20rem; | ||
height: 6.9rem; | ||
border-radius: 10rem; | ||
font-size: 2.8rem; | ||
font-weight: 700; | ||
cursor: pointer; | ||
z-index: 1; | ||
`; | ||
export default GNB; |
Oops, something went wrong.