-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
74 lines (74 loc) · 2 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<link
rel="stylesheet"
href="https://pro.fontawesome.com/releases/v5.15.2/css/all.css"
/>
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x"
crossorigin="anonymous"
/>
</head>
<style>
body {
height: 100vh;
overflow: hidden;
}
#form {
width: 560px;
top: -50%;
left: 50%;
transform: translate(-50%, -50%);
transition: top 0.5s;
}
</style>
<body class="bg-dark">
<button class="btn btn-outline-primary" id="btnEnter">
<i class="fal fa-sign-in"></i>
<span>Авторизация</span>
</button>
<div class="d-flex flex-column bg-warning position-absolute p-3" id="form">
<label class="form-label">
<span>Введите логин:</span>
<input
type="email"
class="form-control"
id="emailValue"
placeholder="name@example.com"
/>
</label>
<label class="form-label">
<span>Введите пароль:</span>
<input
type="password"
class="form-control"
id="passwordValue"
placeholder="1234"
/>
</label>
<button class="btn btn-primary" id="loginBtn">
<i class="fal fa-sign-in"></i>
<span>Вход</span>
</button>
</div>
</body>
<script>
let btnEnter = document.getElementById('btnEnter')
let loginBtn = document.getElementById('loginBtn')
let form = document.getElementById('form')
btnEnter.addEventListener("click", openForm)
function openForm(){
form.style.top = '50%';
}
loginBtn.addEventListener('click', closeForm)
function closeForm() {
form.style.top = '-50%';
}
</script>
</html>