Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 로그인 페이지 구현 #20

Merged
merged 9 commits into from
Jan 15, 2025
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<link
rel="icon"
type="image/svg+xml"
href="/vite.svg" />
href="/src/assets/images/brainPixIcon.png" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
<title>BrainPIX</title>
</head>
<body>
<div id="root"></div>
Expand Down
11 changes: 8 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import IdeaMarketPayment from './pages/idea-market/IdeaMarketPayment/IdeaMarketP
import { RequestAssign } from './pages/request-assign/RequestAssign';
import { Collaboration } from './pages/collaboration/Collaboration';
import { Signup } from './pages/sign-up/Signup';
import { IndividualMember } from './pages/sign-up/IndividualMember';
import { CorporateMember } from './pages/sign-up/CorporateMember';
import { CompleteSignup } from './pages/sign-up/CompleteSignup';
import { IndividualMember } from './components/sign-up/IndividualMember';
import { CorporateMember } from './components/sign-up/CorporateMember';
import { CompleteSignup } from './components/sign-up/CompleteSignup';
import { Login } from './pages/login/Login';

function App() {
return (
Expand Down Expand Up @@ -52,6 +53,10 @@ function App() {
path='/sign-up/complete'
element={<CompleteSignup />}
/>
<Route
path='/login'
element={<Login />}
/>
</Routes>
</BrowserRouter>
);
Expand Down
1 change: 1 addition & 0 deletions src/assets/icons/eyeNonVisible.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/assets/icons/eyeVisible.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/brainPixIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import classNames from 'classnames';
import { ChangeEvent, useRef, useState, KeyboardEvent } from 'react';

import { useOutsideClick } from '../../hooks/useOutsideClick';
import Search from '../../assets/icons/search.svg?react';
import Delete from '../../assets/icons/delete.svg?react';
import Clock from '../../assets/icons/clock.svg?react';
import { debounce } from '../../utils/debounce';
import Search from '../../../assets/icons/search.svg?react';
import Delete from '../../../assets/icons/delete.svg?react';
import Clock from '../../../assets/icons/clock.svg?react';
import { debounce } from '../../../utils/debounce';
import { useOutsideClick } from '../../../hooks/useOutsideClick';

import styles from './searchInput.module.scss';

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PaymentTitle from '../../../components/payment/PaymentTitle';
import SellerInfo from '../../../components/info/SellerInfo';
import PaymentMethods from '../../../components/payment/PaymentMethods';
import PaymentSummary from '../../../components/payment/PaymentSummary';
import PaymentButton from '../../../components/button/PaymentButton';
import PaymentButton from '../../../components/common/button/PaymentButton';
import styles from './IdeaMarketPayment.module.scss';

const IdeaMarketPayment: React.FC = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/layout/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Outlet } from 'react-router-dom';
import { Header } from '../../components/header/Header';
import { Header } from '../../components/common/header/Header';

export const Layout = () => {
return (
Expand Down
86 changes: 86 additions & 0 deletions src/pages/login/Login.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import { useState } from 'react';
import classNames from 'classnames';
import EyeVisible from '../../assets/icons/eyeVisible.svg?react';
import EyeNonVisible from '../../assets/icons/eyeNonVisible.svg?react';
import Delete from '../../assets/icons/delete.svg?react';
import styles from './login.module.scss';

export const Login = () => {
const [isVisiblePassword, setIsVisiblePassword] = useState(false);
const [member, setMember] = useState<'individual' | 'corparate'>(
'individual',
);

return (
<div className={classNames(styles.container)}>
<div className={classNames(styles.logo)}>로고</div>
<div className={classNames(styles.loginContainer)}>
<div className={classNames(styles.buttonWrapper)}>
<button
className={classNames(styles.memberButton, {
[styles.clicked]: member === 'individual',
})}
onClick={() => setMember('individual')}>
개인 회원
</button>
<button
className={classNames(styles.memberButton, {
[styles.clicked]: member === 'corparate',
})}
onClick={() => setMember('corparate')}>
기업 회원
</button>
</div>
<div
className={classNames(
styles.inputContainer,
member === 'corparate' ? styles.right : styles.left,
)}>
<form className={classNames(styles.form)}>
<label
htmlFor='id'
className={classNames(styles.label)}>
아이디
<div className={classNames(styles.iconWrapper)}>
<Delete />
</div>
</label>
<input
className={classNames(styles.input)}
placeholder='아이디 입력'
type='text'
name='id'
id='id'
/>
<label
htmlFor='password'
className={classNames(styles.label)}>
비밀번호
<div className={classNames(styles.iconWrapper)}>
{isVisiblePassword ? (
<EyeVisible onClick={() => setIsVisiblePassword(false)} />
) : (
<EyeNonVisible onClick={() => setIsVisiblePassword(true)} />
)}
<Delete />
</div>
</label>
<input
className={classNames(styles.input)}
placeholder='비밀번호 입력'
type='password'
name='password'
id='password'
/>
<button className={classNames(styles.loginButton)}>로그인</button>
<a
href='/sign-up'
className={classNames(styles.signUpText)}>
회원가입
</a>
</form>
</div>
</div>
</div>
);
};
146 changes: 146 additions & 0 deletions src/pages/login/login.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
.container {
padding-top: 75px;
}

.logo {
@include flex-center;
width: 293px;
height: 102px;
background-color: #d9d9d9;
border-radius: 5px;
margin: 0px auto;
}

.loginContainer {
width: 575px;
height: 404px;
background-color: #d9d9d9;
border-radius: 15px;
position: relative;
margin: 0px auto;
margin-top: 33px;
animation: shadow-drop-center 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.buttonWrapper {
background-color: #d9d9d9;
border-radius: 15px;
position: absolute;
width: 100%;
}

.memberButton {
width: 50%;
background-color: #d9d9d9;
border-bottom: none;
font-size: 26px;
font-weight: 600;
color: #515151;
border: none;
text-align: center;
cursor: pointer;
border-radius: 15px 15px 0px 0px;
}

.clicked {
position: relative;
color: #222;
background-color: white;
border: 1px solid black;
border-bottom: none;
height: 67px;
z-index: 10;
}

.inputContainer {
@include flex-center;
position: absolute;
top: 66px;
width: 100%;
height: 338px;
background-color: white;
border: 1px solid black;

&.right {
border-radius: 15px 0px 15px 15px;
}
&.left {
border-radius: 0px 15px 15px 15px;
}
}

.form {
@include flex-center;
flex-direction: column;
width: 100%;
padding: 40px 37px 30px;
}

.label {
width: 100%;
color: #333;
font-size: 15px;
font-weight: 400;
text-align: left;
margin-bottom: 8px;
position: relative;
}

.iconWrapper {
height: 17px;
position: absolute;
right: 12px;
top: 40px;
cursor: pointer;
display: flex;
align-items: center;
gap: 10px;
}

.input {
width: 100%;
padding: 12px;
margin-bottom: 20px;
border: 1px solid #7a7a7a;
border-radius: 2px;

&:focus {
outline: none;
}

&::placeholder {
color: #898989;
font-size: 13px;
font-weight: 400;
}
}

.loginButton {
width: 260px;
height: 40px;
border-radius: 2px;
background-color: black;
color: white;
font-size: 15px;
font-weight: 600;
cursor: pointer;
margin-bottom: 20px;
}

.signUpText {
color: #898989;
font-size: 13px;
font-weight: 400;
text-decoration: none;
}

@keyframes shadow-drop-center {
0% {
-webkit-box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
}
100% {
-webkit-box-shadow: 0 0 20px 0px rgba(0, 0, 0, 0.35);
box-shadow: 0 0 20px 0px rgba(0, 0, 0, 0.35);
}
}
2 changes: 1 addition & 1 deletion src/pages/test/Test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import classNames from 'classnames';
import styles from './test.module.scss';

//버튼그룹 test
import ButtonGroup from '../../components/button/ButtonGroup.tsx';
import ButtonGroup from '../../components/common/button/ButtonGroup.tsx';

export const Test = () => {
const [clicked, setClicked] = useState(false);
Expand Down
Loading