Skip to content

Commit 92a8325

Browse files
authored
Video-20-Signin-Screen-UI (basir#20)
1 parent 47da253 commit 92a8325

File tree

3 files changed

+66
-1
lines changed

3 files changed

+66
-1
lines changed

frontend/src/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ import ProductScreen from './srceens/ProductScreen';
33
import { parseRequestUrl } from './utils';
44
import Error404Screen from './srceens/Error404Screen';
55
import CartScreen from './srceens/CartScreen';
6+
import SigninScreen from './srceens/SigninScreen';
67

78
const routes = {
89
'/': HomeScreen,
910
'/product/:id': ProductScreen,
1011
'/cart/:id': CartScreen,
1112
'/cart': CartScreen,
13+
'/signin': SigninScreen,
1214
};
1315
const router = async () => {
1416
const request = parseRequestUrl();
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
const SigninScreen = {
2+
after_render: () => {},
3+
render: () => {
4+
return `
5+
<div class="form-container">
6+
<form id="signin-form">
7+
<ul class="form-items">
8+
<li>
9+
<h1>Sign-In</h1>
10+
</li>
11+
<li>
12+
<label for="email">Email</label>
13+
<input type="email" name="email" id="email" />
14+
</li>
15+
<li>
16+
<label for="password">Password</label>
17+
<input type="password" name="password" id="password" />
18+
</li>
19+
<li>
20+
<button type="submit" class="primary">Signin</button>
21+
</li>
22+
<li>
23+
<div>
24+
New User?
25+
<a href="/#/register">Create your account </a>
26+
</div>
27+
</li>
28+
</ul>
29+
</form>
30+
</div>
31+
`;
32+
},
33+
};
34+
export default SigninScreen;

frontend/style.css

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,17 @@ a {
1616
a:hover {
1717
color: #f08040;
1818
}
19+
button {
20+
cursor: pointer;
21+
}
22+
input,
1923
button {
2024
font: 1.6rem helvetica;
2125
padding: 1rem;
2226
border: 0.1rem #808080 solid;
2327
border-radius: 0.5rem;
24-
cursor: pointer;
2528
}
29+
input:hover,
2630
button:hover {
2731
border: 0.1rem #404040 solid;
2832
}
@@ -220,3 +224,28 @@ footer {
220224
font-size: 1.3rem;
221225
padding: 0.5rem;
222226
}
227+
/* Form */
228+
.form-container {
229+
display: flex;
230+
justify-content: center;
231+
align-items: center;
232+
height: 100%;
233+
}
234+
.form-items {
235+
display: flex;
236+
flex-direction: column;
237+
width: 32rem;
238+
padding: 2rem;
239+
border: 0.1rem #c0c0c0 solid;
240+
border-radius: 0.5rem;
241+
list-style-type: none;
242+
}
243+
.form-items li {
244+
display: flex;
245+
flex-direction: column;
246+
margin-bottom: 1rem;
247+
margin-top: 1rem;
248+
}
249+
.form-container h1 {
250+
font-size: 2.5rem;
251+
}

0 commit comments

Comments
 (0)