Login.js
2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
import React from 'react';
import { Link } from 'react-router-dom';
import styled from 'styled-components';
import palette from '../lib/styles/palette';
import Button from './common/Button';
const FormBlock = styled.form`
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 25rem;
padding: 2.5rem;
box-sizing: border-box;
border: 1px solid #dadce0;
-webkit-border-radius: 8px;
border-radius: 8px;
text-align: center;
`;
const InputBox = styled.div`
position: relative;
input {
width: 93%;
padding: 0.625rem 10px;
font-size: 1rem;
letter-spacing: 0.062rem;
margin-bottom: 1.875rem;
border: 1px solid #ccc;
background: transparent;
border-radius: 4px;
}
.label {
position: absolute;
top: 0;
left: 10px;
padding: 0.625rem 0;
font-size: 1rem;
color: grey;
pointer-events: none;
transition: 0.5s;
}
input:focus ~ .label,
input:valid ~ .label,
input:not([value='']) ~ .label {
top: -1.125rem;
left: 10px;
color: ${palette.blue6};
font-size: 0.75rem;
background-color: #fff;
height: 10px;
padding-left: 5px;
padding-right: 5px;
}
input:focus {
outline: none;
border: 2px solid ${palette.blue6};
}
input[type='submit'] {
border: none;
outline: none;
color: #fff;
background-color: ${palette.blue6};
padding: 0.625rem 1.25rem;
cursor: pointer;
border-radius: 0.312rem;
font-size: 1rem;
float: right;
}
input[type='submit']:hover {
background-color: ${palette.blue6};
box-shadow: 0 1px 1px 0 rgba(66, 133, 244, 0.45),
0 1px 3px 1px rgba(66, 133, 244, 0.3);
}
`;
const ButtonBlock = styled.div`
display: flex;
justify-content: space-between;
padding: 1rem;
a {
color: ${palette.blue6};
text-decoration: none;
}
`;
const Login = () => {
return (
<FormBlock>
<div>Logo</div>
<h1>로그인</h1>
<InputBox>
<input type="email" id="email" name="email" value="" />
<div className="label">Email</div>
</InputBox>
<InputBox>
<input type="text" name="text" value="" />
<div className="label">Password</div>
</InputBox>
<ButtonBlock>
<Link to="/">홈으로</Link>
<Button color="blue">로그인</Button>
</ButtonBlock>
</FormBlock>
);
};
export default Login;