-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
357 lines (329 loc) · 10.5 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
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>KingBee</title>
<style>
/*
* Prefixed by https://autoprefixer.github.io
* PostCSS: v7.0.29,
* Autoprefixer: v9.7.6
* Browsers: last 4 version
*/
@charset "UTF-8";
:root {
--bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto,
"Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif,
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
"Noto Color Emoji";
--primary-color: #ffb347;
}
*,
*:before,
*:after {
-webkit-box-sizing: inherit;
box-sizing: inherit;
}
body {
min-height: 100vh;
margin: 0;
font-family: var(--bs-font-sans-serif);
font-size: 1rem;
font-weight: 400;
line-height: 1.5;
color: #212529;
-webkit-text-size-adjust: 100%;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
background-image: url(https://kingbee.vn/wp-content/uploads/2018/12/clien-banner.jpg?id=15889);
background-repeat: no-repeat;
background-position: bottom;
}
.form-container {
max-width: 430px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
background-color: var(--primary-color);
margin: 0 auto 20px;
border: 1px solid transparent;
border-radius: 4px;
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
padding: 20px;
}
.form-container label {
text-align: left;
width: 100%;
font-size: 12px;
font-weight: bold;
margin-bottom: 5px;
}
.my-input {
display: block;
width: 256px;
padding: 0.375rem 0.75rem;
margin-top: 20px;
font-size: 1rem;
font-weight: 400;
line-height: 1.5;
color: #212529;
background-color: #fff;
background-clip: padding-box;
border: 1px solid #ced4da;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
border-radius: 0.25rem;
-webkit-transition: border-color 0.15s ease-in-out,
-webkit-box-shadow 0.15s ease-in-out;
transition: border-color 0.15s ease-in-out,
-webkit-box-shadow 0.15s ease-in-out;
-o-transition: border-color 0.15s ease-in-out,
box-shadow 0.15s ease-in-out;
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out,
-webkit-box-shadow 0.15s ease-in-out;
}
.my-input:focus {
color: #212529;
background-color: #fff;
border-color: #f58220;
outline: 0;
-webkit-box-shadow: 0 0 0 0.25rem rgba(245, 130, 32, 0.25);
box-shadow: 0 0 0 0.25rem rgba(245, 130, 32, 0.25);
}
.my-input:disabled {
background-color: lightgray;
}
.logo-container {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
margin-bottom: 100px;
}
.logo-container img {
max-width: 150px;
}
button {
border: 1px solid #212529;
color: #212529;
background-color: transparent;
border-radius: 0;
text-transform: none;
cursor: pointer;
-webkit-appearance: button;
margin: 0;
font-family: inherit;
font-size: inherit;
line-height: inherit;
margin-top: 20px;
}
#reset-button {
margin-right: 20px;
}
button:focus {
outline: dotted 1px;
outline: -webkit-focus-ring-color auto 5px;
}
button:disabled {
border-color: gray;
color: gray;
}
@media only screen and (max-width: 1080px) {
.container {
width: 70%;
}
}
@media only screen and (max-width: 768px) {
.container {
width: 100%;
}
}
</style>
</head>
<body>
<div class="logo-container">
<a href="https://kingbee.vn">
<img src="https://kingbee.vn/wp-content/uploads/2019/01/Logo-New-e1548325443500.png"
alt="Effective Marketing Agency" />
</a>
<a href="https://kingbee.vn">
<img src="https://cdn.worldvectorlogo.com/logos/sapporo-logo-1.svg" alt="Effective Marketing Agency" />
</a>
</div>
<div class="form-container">
<input id="name" class="my-input" placeholder="Tên nhân viên" required />
<input id="personal-id" class="my-input" placeholder="CMND/CCCD nhân viên" required />
<input id="super-market" class="my-input" placeholder="Nơi làm việc" required list="superMarkets"
autocomplete="on" />
<datalist id="superMarkets">
<option>BigC Thang Long</option>
<option>Aeon Long Bien</option>
<option>Aeon Mall Ha Dong</option>
<option>Metro Thang Long</option>
<option>Vinmart Lieu Giai</option>
<option>Vinmart Xuan Dieu</option>
<option>Lotte Ba Dinh</option>
<option>Vinmart Hoai Duc</option>
<option>BigC Long Bien</option>
<option>BigC Hai Phong</option>
<option>Aeon Hai Phong</option>
<option>Mega Hai Phong</option>
<option>Emart</option>
<option>Mega An Phu</option>
<option>Coop Xtra Tan Phong</option>
<option>Vinmart HCM Landmark 81</option>
<option>BigC To Hien Thanh</option>
<option>Aeon Tan Phu</option>
<option>Aeon Binh Tan</option>
<option>BigC An Phu</option>
<option>Coop Nguyen Dinh Chieu</option>
<option>Aeon Binh Duong</option>
<option>BigC Binh Duong</option>
<option>Mega Binh Duong</option>
<option>BigC Di An</option>
<option>BigC Dong Nai</option>
<option>Mega Da Nang</option>
<option>BigC Da Nang</option>
<option>BigC Nha Trang</option>
<option>BigC Da Lat</option>
<option>Zamba Beer BBQ 2</option>
<option>Ham Bia La Vong</option>
<option>3ZAN BEER CLUB</option>
<option>Lasvegas Beer Club</option>
<option>Vitamin Beer</option>
<option>Republic</option>
<option>The Kneipe</option>
<option>Local Bar XD</option>
</datalist>
<div style="display: flex">
<button id="reset-button" disabled>Thay đổi thông tin</button>
<button id="submit-button" disabled>Chuyển đến trang Starguide</button>
</div>
</div>
<script>
const savedName = localStorage.getItem("name");
const savedPersonalId = localStorage.getItem("personalId");
const savedMarket = localStorage.getItem("market");
const button = document.getElementById("submit-button");
const resetButton = document.getElementById("reset-button");
const nameInput = document.getElementById("name");
const personalIdInput = document.getElementById("personal-id");
const superMarketInput = document.getElementById("super-market");
if (savedName && savedPersonalId && savedMarket) {
nameInput.value = savedName;
personalIdInput.value = savedPersonalId;
superMarketInput.value = savedMarket;
nameInput.disabled = true;
personalIdInput.disabled = true;
superMarketInput.disabled = true;
resetButton.disabled = false;
checkInput();
}
nameInput.addEventListener("focusout", () => {
checkInput();
});
personalIdInput.addEventListener("focusout", () => {
checkInput();
});
superMarketInput.addEventListener("focusout", () => {
checkInput();
});
function checkInput() {
if (
nameInput.value === "" ||
personalIdInput.value === "" ||
superMarketInput.value === ""
) {
button.disabled = true;
} else {
button.disabled = false;
}
}
function change_alias(alias) {
var str = alias;
str = str.toLowerCase();
str = str.replace(/à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ/g, "a");
str = str.replace(/è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ/g, "e");
str = str.replace(/ì|í|ị|ỉ|ĩ/g, "i");
str = str.replace(/ò|ó|ọ|ỏ|õ|ô|ồ|ố|ộ|ổ|ỗ|ơ|ờ|ớ|ợ|ở|ỡ/g, "o");
str = str.replace(/ù|ú|ụ|ủ|ũ|ư|ừ|ứ|ự|ử|ữ/g, "u");
str = str.replace(/ỳ|ý|ỵ|ỷ|ỹ/g, "y");
str = str.replace(/đ/g, "d");
str = str.replace(
/!|@|%|\^|\*|\(|\)|\+|\=|\<|\>|\?|\/|,|\.|\:|\;|\'|\"|\&|\#|\[|\]|~|\$|_|`|{|}|\||\\/g,
"-"
);
str = str.replace(/ + /g, "-");
str = str.replace(/ /g, "-");
str = str.trim();
return str;
}
resetButton.addEventListener("click", () => {
nameInput.disabled = false;
personalIdInput.disabled = false;
superMarketInput.disabled = false;
resetButton.disabled = true;
});
button.addEventListener("click", () => {
const name = change_alias(nameInput.value);
const personalId = change_alias(personalIdInput.value);
const superMarket = change_alias(superMarketInput.value);
localStorage.setItem("name", nameInput.value);
localStorage.setItem("personalId", personalIdInput.value);
localStorage.setItem("market", superMarketInput.value);
nameInput.disabled = true;
personalIdInput.disabled = true;
superMarketInput.disabled = true;
resetButton.disabled = false;
fetch('https://sapbe.ongdev.com/record', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({name, personalId, superMarket})
}).then((res) => {
if(res.ok) {
console.log('ok luôn')
}
}).catch((err) => {
console.log(err.message);
});
window.open(
`https://www.sapporo-starguide.com/vi_VN/account/register?redirect=http://starspin.sapporo-starguide.com/&utm_source=Kingbee&utm_medium=Offline&utm_campaign=${name}_${personalId}_${superMarket}`
);
});
</script>
</body>
</html>