-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
193 lines (167 loc) · 5.93 KB
/
index.html
File metadata and controls
193 lines (167 loc) · 5.93 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>KHOA CNTT - HUTECH - HỘI THẢO SENIOR DEVELOPER ROADMAP FROM 2 YEARS</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- MATERIAL DESIGN ICONIC FONT -->
<link rel="stylesheet" href="fonts/material-design-iconic-font/css/material-design-iconic-font.min.css">
<!-- STYLE CSS -->
<link rel="stylesheet" href="css/style.css">
<style>
:root {
--accent: #F18260;
--purple: #252431;
}
.form-container {
position: relative;
background: #fff;
padding: 2rem;
border-radius: 6px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
width: 350px;
min-height: 300px;
margin: 0 auto;
box-shadow: 0 10px 50px 0 #ccc;
margin-bottom: 2rem;
}
.is-hidden {
display: none !important;
}
a {
display: block;
width: max-content;
margin: 0 auto;
color: var(--accent);
text-decoration: none;
margin-bottom: 0.5rem;
}
@keyframes rotate {
100% { transform: rotate(360deg); }
}
@keyframes dash {
0% { stroke-dasharray: 1,200; stroke-dashoffset: 0; }
50% { stroke-dasharray: 89,200; stroke-dashoffset: -35; }
100% { stroke-dasharray: 89,200; stroke-dashoffset: -124; }
}
.loading {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.loading-spinner {
width: 50px;
height: 50px;
}
.loading-spinner svg {
position: relative;
animation: rotate 2s linear infinite;
height: 50px;
width: 50px;
}
.loading-spinner circle {
stroke: var(--accent);
stroke-dasharray: 1,200;
stroke-dashoffset: 0;
stroke-linecap: round;
animation: dash 1.5s ease-in-out infinite;
}
p.js-success-message {
text-align: center;
font-size: 20px;
height: 500px;
padding-right: 300px;
}
</style>
</head>
<body>
<div class="wrapper" style="background-image: url('images/bg-registration-form-2.jpg');">
<div class="inner">
<form name="submit-to-google-sheet">
<h3>ĐĂNG KÝ THAM GIA HỘI THẢO SENIOR DEVELOPER ROADMAP FROM 2 YEARS</h3>
<div class="form-group">
<div class="form-wrapper">
<label for="">Mã SV</label>
<input type="text" name="MASV" placeholder="Bạn có Mã SV?" class="form-control" required="" oninvalid="this.setCustomValidity('Nhập mã sinh viên')" oninput="setCustomValidity('')">
</div>
<div class="form-wrapper">
<label for="">Lớp</label>
<input type="text" name="LOP" placeholder="Bạn học lớp nào?" class="form-control">
</div>
</div>
<div class="form-wrapper">
<label for="">Họ Và Tên</label>
<input type="text" name="TEN" placeholder="Bạn là ai?" class="form-control" required="" oninvalid="this.setCustomValidity('Nhập họ tên')" oninput="setCustomValidity('')">
</div>
<div class="form-wrapper">
<label for="">Email</label>
<input type="email" name="EMAIL" placeholder="Địa chỉ thư điện tử?" class="form-control" required="" oninvalid="this.setCustomValidity('Nhập Email')" oninput="setCustomValidity('')">
</div>
<div class="form-wrapper">
<label for="">Điện Thoại</label>
<input type="text" name="DIENTHOAI" placeholder="Hãy giữ liên lạc?" class="form-control" required="" oninvalid="this.setCustomValidity('Nhập số điện thoại')" oninput="setCustomValidity('')">
</div>
<div class="form-wrapper">
<label for="">Câu Hỏi Cho Diễn Giả</label>
<input type="text" name="CAUHOI" class="form-control" placeholder="Bạn đang thắc mắc gì không?">
</div>
<button type="submit">ĐĂNG KÝ NGAY</button>
<h3></h3>
</form>
<div class="loading js-loading is-hidden">
<div class="loading-spinner">
<svg><circle cx="25" cy="25" r="20" fill="none" stroke-width="2" stroke-miterlimit="10"/></svg>
</div>
</div>
<p class="js-success-message is-hidden">ĐĂNG KÝ THÀNH CÔNG<br/>CẢM ƠN BẠN</p>
<p class="js-error-message is-hidden">AHAHA - LỖI RỒI</p>
</div>
</div>
<script>
const scriptURL = 'https://script.google.com/macros/s/AKfycbyGoi2l-pnU5x4pkLIaEjt2yPKgywd93DgrqkQQLQ/exec'
const form = document.forms['submit-to-google-sheet']
const loading = document.querySelector('.js-loading')
const successMessage = document.querySelector('.js-success-message')
const errorMessage = document.querySelector('.js-error-message')
form.addEventListener('submit', e => {
e.preventDefault()
showLoadingIndicator()
fetch(scriptURL, { method: 'POST', body: new FormData(form)})
.then(response => showSuccessMessage(response))
.catch(error => showErrorMessage(error))
})
function showLoadingIndicator () {
form.classList.add('is-hidden')
loading.classList.remove('is-hidden')
}
function showSuccessMessage (response) {
console.log('Success!', response)
setTimeout(() => {
successMessage.classList.remove('is-hidden')
loading.classList.add('is-hidden')
}, 500)
}
function showErrorMessage (error) {
console.error('Error!', error.message)
setTimeout(() => {
errorMessage.classList.remove('is-hidden')
loading.classList.add('is-hidden')
}, 500)
}
</script>
<script src="js/prefixfree.min.js"></script>
<script src="js/formdata-poly.js"></script>
<script src="js/promise-polyfill.js"></script>
<script src="js/whatwg-fetch.js"></script>
</body><!-- This templates was made by Colorlib (https://colorlib.com) -->
</html>