Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import CreateProblem from './pages/CreateProblem'
import CreateProblemDetail from './pages/CreateProblem/detail'
import Header from './components/Header/Header'
import Admin from './pages/Admin'
import Signup from './pages/Signup/page'

const MainLayout: React.FC = () => {
const [state, setState] = useState<boolean>(true)
Expand All @@ -40,6 +41,7 @@ const router = createBrowserRouter(
createRoutesFromElements(
<>
<Route path="/login" element={<Login />} />
<Route path="/signup" element={<Signup />} />
<Route path="/" element={<MainLayout />}>
<Route path="/" element={<Home />} />
<Route path="/problem" element={<Problems />} />
Expand Down
1 change: 1 addition & 0 deletions src/assets/eye.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/eyeOff.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 40 additions & 5 deletions src/pages/Login/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
import styles from './style.module.css'
import logo from '../../assets/w2cLogo.svg'
import eyeIcon from '../../assets/eye.svg'
import eyeOffIcon from '../../assets/eyeOff.svg'
import { Button } from '@/stories/Button'
import { useState } from 'react'
import { Link } from 'react-router-dom'

export default function Login() {
const [showPassword, setShowPassword] = useState(false)

const togglePassword = () => {
setShowPassword((prev) => !prev)
}

return (
<>
<div className={styles.loginBg}>
Expand All @@ -19,20 +29,45 @@ export default function Login() {
<div className={styles.input}>
<label>メールアドレス</label>
<input
type="text"
type="email"
name="email"
id="email"
placeholder="学籍番号@ecc.ac.jp"
autoComplete="email"
required
/>
</div>
<div className={styles.input}>
<label>パスワード</label>
<input type="password" />
<label htmlFor="password">
パスワード{' '}
<span>※半角英数字のみ・8文字以上</span>
</label>
<div className={styles.passwordField}>
<input
type={
showPassword ? 'text' : 'password'
}
name="password"
id="password"
autoComplete="current-password"
required
/>
<img
src={
showPassword ? eyeOffIcon : eyeIcon
}
alt="パスワード表示切り替え"
onClick={togglePassword}
className={styles.eyeIcon}
/>
</div>
</div>
</div>
<div className={styles.BtnWrap}>
<Button label="ログインして進む" />
<a href="#">
<Link to={'/signup'}>
<p>新規登録はこちら &gt;&gt;</p>
</a>
</Link>
</div>
</form>
</div>
Expand Down
61 changes: 56 additions & 5 deletions src/pages/Login/style.module.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* ログイン・サインイン共通部分あり */
.loginBg {
width: 100%;
height: 100vh;
Expand All @@ -23,6 +24,7 @@
flex-direction: column;
align-items: center;
justify-content: center;
filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.25));

form {
width: 100%;
Expand All @@ -40,7 +42,7 @@

>p {
color: white;
font-size: 32px;
font-size: 2.6rem;
font-weight: bold;
}
.input {
Expand All @@ -50,24 +52,73 @@

label {
color: white;
margin: 4px 0;
margin: 7px 0;
font-size: 1.3rem;
font-weight: 500;
span{
font-size: 1rem;
color: var(--gray);

}

}
input {
width: 100%;
height: 40px;
height: 55px;
border-radius: 8px;
border: none;
padding-left: 1rem;
font-size: 1.5rem;
}
::placeholder{
color: var(--grayText);
}

}
.passwordField {
position: relative;
display: flex;
align-items: center;
}

.passwordField input {
width: 100%;
padding-right: 60px;
}

.eyeIcon {
position: absolute;
right: 20px;
width: 32px;
height: 32px;
cursor: pointer;
opacity: 0.7;
transition: opacity 0.2s;
}

.eyeIcon:hover {
opacity: 1;
}

}
.BtnWrap {
text-align: center;
button{
color: #FFFFFF;
font-size: 1.5rem;
background: linear-gradient(90deg, #FFA322 0%, #FF7253 100%);
height: 55px;
width: 400px;
border: solid 0.7px #FFFFFF;
filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.25));
}
p {
margin-top: 8px;
margin-top: 20px;
font-size: 1rem;
color: white;
text-decoration: underline;
}
}
}
}
}
}
125 changes: 125 additions & 0 deletions src/pages/Signup/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
import styles from './style.module.css'
import logo from '../../assets/w2cLogo.svg'
import eyeIcon from '../../assets/eye.svg'
import eyeOffIcon from '../../assets/eyeOff.svg'
import { Button } from '@/stories/Button'
import { useState } from 'react'
import { Link } from 'react-router-dom'

export default function Signup() {
const [showPassword, setShowPassword] = useState(false)

const togglePassword = () => {
setShowPassword((prev) => !prev)
}

return (
<>
<div className={styles.loginBg}>
<h1>
<img src={logo} alt="W2Cロゴ" />
</h1>
<p className={styles.errorMes}>
学校のメールアドレスを入力してください
</p>
<div className={styles.loginForm}>
<form action="">
<div className={styles.inputWrap}>
<p>新規登録</p>
<div className={styles.input}>
<label>学校メールアドレス</label>
<input
type="email"
name="email"
id="email"
placeholder="学籍番号@ecc.ac.jp"
autoComplete="email"
required
/>
</div>
<div className={styles.input}>
<label htmlFor="password">
パスワード{' '}
<span>※半角英数字のみ・8文字以上</span>
</label>
<div className={styles.passwordField}>
<input
type={
showPassword ? 'text' : 'password'
}
name="password"
id="password"
autoComplete="current-password"
required
/>
<img
src={
showPassword ? eyeOffIcon : eyeIcon
}
alt="パスワード表示切り替え"
onClick={togglePassword}
className={styles.eyeIcon}
/>
</div>
</div>
<div className={styles.input}>
<label htmlFor="password">
パスワード{' '}
<span>
※確認のためにもう一度入力してください
</span>
</label>
<div className={styles.passwordField}>
<input
type={
showPassword ? 'text' : 'password'
}
name="password"
id="password"
autoComplete="current-password"
required
/>
<img
src={
showPassword ? eyeOffIcon : eyeIcon
}
alt="パスワード表示切り替え"
onClick={togglePassword}
className={styles.eyeIcon}
/>
</div>
</div>
<div className={styles.input}>
<label>名前</label>
<input
type="name"
name="name"
id="name"
placeholder="例)ウェブ 二郎"
autoComplete="email"
required
/>
</div>
<div className={styles.input}>
<label>クラス</label>
<input
type="text"
name="text"
id="text"
placeholder="例)WD1A"
required
/>
</div>
</div>
<div className={styles.BtnWrap}>
<Button label="登録する" />
<Link to={'/login'}>
<p>ログイン画面に戻る &gt;&gt;</p>
</Link>
</div>
</form>
</div>
</div>
</>
)
}
Loading
Loading