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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="ar" dir="rtl">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>NANO BOT - إنشاء حساب</title>
|
7 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
|
8 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.0.1/socket.io.js"></script>
|
9 |
+
<style>
|
10 |
+
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800&display=swap');
|
11 |
+
|
12 |
+
:root {
|
13 |
+
--primary: #4361ee;
|
14 |
+
--primary-dark: #3a56d4;
|
15 |
+
--secondary: #7209b7;
|
16 |
+
--accent: #4cc9f0;
|
17 |
+
--dark: #2b2d42;
|
18 |
+
--light: #f8f9fa;
|
19 |
+
--gray-100: #f1f3f5;
|
20 |
+
--gray-200: #e9ecef;
|
21 |
+
--gray-300: #dee2e6;
|
22 |
+
--success: #38b000;
|
23 |
+
--warning: #ffaa00;
|
24 |
+
--danger: #e63946;
|
25 |
+
--info: #3a86ff;
|
26 |
+
}
|
27 |
+
|
28 |
+
* {
|
29 |
+
margin: 0;
|
30 |
+
padding: 0;
|
31 |
+
box-sizing: border-box;
|
32 |
+
font-family: 'Tajawal', sans-serif;
|
33 |
+
}
|
34 |
+
|
35 |
+
body {
|
36 |
+
background: #f5f7ff;
|
37 |
+
min-height: 100vh;
|
38 |
+
display: flex;
|
39 |
+
justify-content: center;
|
40 |
+
align-items: center;
|
41 |
+
padding: 15px;
|
42 |
+
direction: rtl;
|
43 |
+
}
|
44 |
+
|
45 |
+
.app-container {
|
46 |
+
width: 100%;
|
47 |
+
max-width: 480px;
|
48 |
+
background: linear-gradient(145deg, #ffffff, #f8f9ff);
|
49 |
+
border-radius: 24px;
|
50 |
+
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
|
51 |
+
overflow: hidden;
|
52 |
+
position: relative;
|
53 |
+
}
|
54 |
+
|
55 |
+
.header {
|
56 |
+
padding: 30px 25px 0;
|
57 |
+
position: relative;
|
58 |
+
z-index: 1;
|
59 |
+
}
|
60 |
+
|
61 |
+
.header::before {
|
62 |
+
content: '';
|
63 |
+
position: absolute;
|
64 |
+
top: -100px;
|
65 |
+
right: -100px;
|
66 |
+
width: 250px;
|
67 |
+
height: 250px;
|
68 |
+
background: linear-gradient(135deg, var(--primary), var(--secondary));
|
69 |
+
border-radius: 50%;
|
70 |
+
opacity: 0.1;
|
71 |
+
z-index: -1;
|
72 |
+
}
|
73 |
+
|
74 |
+
.header::after {
|
75 |
+
content: '';
|
76 |
+
position: absolute;
|
77 |
+
bottom: -50px;
|
78 |
+
left: -50px;
|
79 |
+
width: 150px;
|
80 |
+
height: 150px;
|
81 |
+
background: linear-gradient(135deg, var(--accent), var(--primary));
|
82 |
+
border-radius: 50%;
|
83 |
+
opacity: 0.1;
|
84 |
+
z-index: -1;
|
85 |
+
}
|
86 |
+
|
87 |
+
.logo-container {
|
88 |
+
display: flex;
|
89 |
+
align-items: center;
|
90 |
+
margin-bottom: 25px;
|
91 |
+
}
|
92 |
+
|
93 |
+
.logo-icon {
|
94 |
+
width: 60px;
|
95 |
+
height: 60px;
|
96 |
+
background: linear-gradient(135deg, var(--primary), var(--secondary));
|
97 |
+
border-radius: 18px;
|
98 |
+
display: flex;
|
99 |
+
align-items: center;
|
100 |
+
justify-content: center;
|
101 |
+
box-shadow: 0 10px 20px rgba(67, 97, 238, 0.2);
|
102 |
+
position: relative;
|
103 |
+
overflow: hidden;
|
104 |
+
}
|
105 |
+
|
106 |
+
.logo-icon::before {
|
107 |
+
content: '';
|
108 |
+
position: absolute;
|
109 |
+
top: -10px;
|
110 |
+
left: -10px;
|
111 |
+
right: -10px;
|
112 |
+
bottom: -10px;
|
113 |
+
background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0));
|
114 |
+
transform: rotate(35deg);
|
115 |
+
}
|
116 |
+
|
117 |
+
.logo-icon i {
|
118 |
+
color: white;
|
119 |
+
font-size: 28px;
|
120 |
+
position: relative;
|
121 |
+
z-index: 2;
|
122 |
+
}
|
123 |
+
|
124 |
+
.logo-text {
|
125 |
+
margin-right: 15px;
|
126 |
+
}
|
127 |
+
|
128 |
+
.logo-text h1 {
|
129 |
+
font-size: 24px;
|
130 |
+
font-weight: 800;
|
131 |
+
color: var(--dark);
|
132 |
+
margin: 0;
|
133 |
+
letter-spacing: -0.5px;
|
134 |
+
}
|
135 |
+
|
136 |
+
.logo-text p {
|
137 |
+
font-size: 14px;
|
138 |
+
color: #6c757d;
|
139 |
+
margin: 0;
|
140 |
+
}
|
141 |
+
|
142 |
+
.main-content {
|
143 |
+
padding: 0 25px 30px;
|
144 |
+
}
|
145 |
+
|
146 |
+
.success-card {
|
147 |
+
background: linear-gradient(145deg, #ecfdf5, #d1fae5);
|
148 |
+
border-radius: 16px;
|
149 |
+
padding: 20px;
|
150 |
+
margin-bottom: 25px;
|
151 |
+
position: relative;
|
152 |
+
overflow: hidden;
|
153 |
+
box-shadow: 0 4px 15px rgba(16, 185, 129, 0.1);
|
154 |
+
border-right: 4px solid var(--success);
|
155 |
+
}
|
156 |
+
|
157 |
+
.success-card::before {
|
158 |
+
content: '';
|
159 |
+
position: absolute;
|
160 |
+
top: 0;
|
161 |
+
right: 0;
|
162 |
+
width: 60px;
|
163 |
+
height: 60px;
|
164 |
+
background: var(--success);
|
165 |
+
opacity: 0.1;
|
166 |
+
border-radius: 0 0 0 60px;
|
167 |
+
}
|
168 |
+
|
169 |
+
.success-card h3 {
|
170 |
+
color: #065f46;
|
171 |
+
font-size: 18px;
|
172 |
+
font-weight: 700;
|
173 |
+
margin-bottom: 10px;
|
174 |
+
display: flex;
|
175 |
+
align-items: center;
|
176 |
+
}
|
177 |
+
|
178 |
+
.success-card h3 i {
|
179 |
+
margin-left: 8px;
|
180 |
+
color: var(--success);
|
181 |
+
}
|
182 |
+
|
183 |
+
.success-card p {
|
184 |
+
color: #047857;
|
185 |
+
margin: 0;
|
186 |
+
font-size: 15px;
|
187 |
+
line-height: 1.5;
|
188 |
+
}
|
189 |
+
|
190 |
+
.success-card .page-name {
|
191 |
+
font-weight: 700;
|
192 |
+
color: #065f46;
|
193 |
+
}
|
194 |
+
|
195 |
+
.form-intro {
|
196 |
+
text-align: right;
|
197 |
+
margin-bottom: 25px;
|
198 |
+
}
|
199 |
+
|
200 |
+
.form-intro p {
|
201 |
+
color: #4b5563;
|
202 |
+
font-size: 16px;
|
203 |
+
line-height: 1.6;
|
204 |
+
}
|
205 |
+
|
206 |
+
.form-group {
|
207 |
+
margin-bottom: 20px;
|
208 |
+
position: relative;
|
209 |
+
}
|
210 |
+
|
211 |
+
.form-group label {
|
212 |
+
display: block;
|
213 |
+
margin-bottom: 8px;
|
214 |
+
color: var(--dark);
|
215 |
+
font-weight: 600;
|
216 |
+
font-size: 15px;
|
217 |
+
}
|
218 |
+
|
219 |
+
.form-group input {
|
220 |
+
width: 100%;
|
221 |
+
padding: 15px;
|
222 |
+
background: white;
|
223 |
+
border: 1px solid var(--gray-300);
|
224 |
+
border-radius: 12px;
|
225 |
+
font-size: 15px;
|
226 |
+
transition: all 0.3s ease;
|
227 |
+
color: var(--dark);
|
228 |
+
}
|
229 |
+
|
230 |
+
.form-group input:focus {
|
231 |
+
border-color: var(--primary);
|
232 |
+
box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
|
233 |
+
outline: none;
|
234 |
+
}
|
235 |
+
|
236 |
+
.password-requirements {
|
237 |
+
margin-top: 8px;
|
238 |
+
font-size: 13px;
|
239 |
+
color: #6c757d;
|
240 |
+
line-height: 1.5;
|
241 |
+
}
|
242 |
+
|
243 |
+
.submit-btn {
|
244 |
+
width: 100%;
|
245 |
+
padding: 16px;
|
246 |
+
background: linear-gradient(135deg, var(--primary), var(--primary-dark));
|
247 |
+
color: white;
|
248 |
+
border: none;
|
249 |
+
border-radius: 14px;
|
250 |
+
font-size: 16px;
|
251 |
+
font-weight: 700;
|
252 |
+
cursor: pointer;
|
253 |
+
transition: all 0.3s ease;
|
254 |
+
position: relative;
|
255 |
+
overflow: hidden;
|
256 |
+
box-shadow: 0 8px 20px rgba(67, 97, 238, 0.25);
|
257 |
+
margin-top: 10px;
|
258 |
+
}
|
259 |
+
|
260 |
+
.submit-btn::before {
|
261 |
+
content: '';
|
262 |
+
position: absolute;
|
263 |
+
top: 0;
|
264 |
+
left: -100%;
|
265 |
+
width: 100%;
|
266 |
+
height: 100%;
|
267 |
+
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
|
268 |
+
transition: 0.5s;
|
269 |
+
}
|
270 |
+
|
271 |
+
.submit-btn:hover::before {
|
272 |
+
left: 100%;
|
273 |
+
}
|
274 |
+
|
275 |
+
.submit-btn:hover {
|
276 |
+
transform: translateY(-3px);
|
277 |
+
box-shadow: 0 12px 25px rgba(67, 97, 238, 0.35);
|
278 |
+
}
|
279 |
+
|
280 |
+
.submit-btn:active {
|
281 |
+
transform: translateY(0);
|
282 |
+
}
|
283 |
+
|
284 |
+
.spinner {
|
285 |
+
display: none;
|
286 |
+
width: 20px;
|
287 |
+
height: 20px;
|
288 |
+
border: 2px solid rgba(255, 255, 255, 0.3);
|
289 |
+
border-radius: 50%;
|
290 |
+
border-top-color: white;
|
291 |
+
animation: spin 0.8s linear infinite;
|
292 |
+
position: absolute;
|
293 |
+
left: 50%;
|
294 |
+
top: 50%;
|
295 |
+
transform: translate(-50%, -50%);
|
296 |
+
}
|
297 |
+
|
298 |
+
@keyframes spin {
|
299 |
+
to { transform: translate(-50%, -50%) rotate(360deg); }
|
300 |
+
}
|
301 |
+
|
302 |
+
.button-text {
|
303 |
+
transition: opacity 0.3s ease;
|
304 |
+
}
|
305 |
+
|
306 |
+
.footer {
|
307 |
+
background: var(--gray-100);
|
308 |
+
padding: 20px;
|
309 |
+
text-align: center;
|
310 |
+
border-top: 1px solid var(--gray-200);
|
311 |
+
}
|
312 |
+
|
313 |
+
.footer-text {
|
314 |
+
font-size: 13px;
|
315 |
+
color: #6c757d;
|
316 |
+
margin-bottom: 10px;
|
317 |
+
}
|
318 |
+
|
319 |
+
.social-links {
|
320 |
+
display: flex;
|
321 |
+
justify-content: center;
|
322 |
+
gap: 15px;
|
323 |
+
}
|
324 |
+
|
325 |
+
.social-link {
|
326 |
+
width: 36px;
|
327 |
+
height: 36px;
|
328 |
+
border-radius: 50%;
|
329 |
+
background: white;
|
330 |
+
display: flex;
|
331 |
+
align-items: center;
|
332 |
+
justify-content: center;
|
333 |
+
color: var(--primary);
|
334 |
+
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
|
335 |
+
transition: all 0.3s ease;
|
336 |
+
}
|
337 |
+
|
338 |
+
.social-link:hover {
|
339 |
+
transform: translateY(-3px);
|
340 |
+
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
|
341 |
+
}
|
342 |
+
|
343 |
+
.notification {
|
344 |
+
position: fixed;
|
345 |
+
top: 20px;
|
346 |
+
left: 50%;
|
347 |
+
transform: translateX(-50%);
|
348 |
+
padding: 16px 25px;
|
349 |
+
border-radius: 12px;
|
350 |
+
color: white;
|
351 |
+
font-weight: 500;
|
352 |
+
display: none;
|
353 |
+
z-index: 1000;
|
354 |
+
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
|
355 |
+
text-align: center;
|
356 |
+
min-width: 300px;
|
357 |
+
max-width: 90%;
|
358 |
+
font-size: 15px;
|
359 |
+
transition: all 0.3s ease;
|
360 |
+
}
|
361 |
+
|
362 |
+
.success {
|
363 |
+
background: linear-gradient(135deg, #10b981, #059669);
|
364 |
+
}
|
365 |
+
|
366 |
+
.error {
|
367 |
+
background: linear-gradient(135deg, #ef4444, #dc2626);
|
368 |
+
}
|
369 |
+
|
370 |
+
/* Responsive adjustments */
|
371 |
+
@media (max-width: 480px) {
|
372 |
+
.app-container {
|
373 |
+
border-radius: 20px;
|
374 |
+
}
|
375 |
+
|
376 |
+
.header {
|
377 |
+
padding: 25px 20px 0;
|
378 |
+
}
|
379 |
+
|
380 |
+
.main-content {
|
381 |
+
padding: 0 20px 25px;
|
382 |
+
}
|
383 |
+
|
384 |
+
.logo-icon {
|
385 |
+
width: 50px;
|
386 |
+
height: 50px;
|
387 |
+
}
|
388 |
+
|
389 |
+
.logo-icon i {
|
390 |
+
font-size: 24px;
|
391 |
+
}
|
392 |
+
|
393 |
+
.logo-text h1 {
|
394 |
+
font-size: 22px;
|
395 |
+
}
|
396 |
+
|
397 |
+
.success-card {
|
398 |
+
padding: 15px;
|
399 |
+
}
|
400 |
+
|
401 |
+
.form-group input {
|
402 |
+
padding: 12px;
|
403 |
+
}
|
404 |
+
|
405 |
+
.submit-btn {
|
406 |
+
padding: 14px;
|
407 |
+
}
|
408 |
+
}
|
409 |
+
</style>
|
410 |
+
</head>
|
411 |
+
<body>
|
412 |
+
<div class="notification" id="notification"></div>
|
413 |
+
|
414 |
+
<div class="app-container">
|
415 |
+
<div class="header">
|
416 |
+
<div class="logo-container">
|
417 |
+
<div class="logo-icon">
|
418 |
+
<i class="fas fa-robot"></i>
|
419 |
+
</div>
|
420 |
+
<div class="logo-text">
|
421 |
+
<h1>NANO BOT</h1>
|
422 |
+
<p>الذكاء الاصطناعي لخدمة العملاء</p>
|
423 |
+
</div>
|
424 |
+
</div>
|
425 |
+
</div>
|
426 |
+
|
427 |
+
<div class="main-content">
|
428 |
+
<div class="success-card">
|
429 |
+
<h3><i class="fas fa-check-circle"></i> تم ربط الصفحة بنجاح</h3>
|
430 |
+
<p>تم ربط صفحة <span class="page-name" id="pageName">{{ page_name }}</span> بنجاح مع NANO BOT</p>
|
431 |
+
</div>
|
432 |
+
|
433 |
+
<div class="form-intro">
|
434 |
+
<p>أكمل إنشاء حسابك للاستفادة من خدمات الذكاء الاصطناعي المتقدمة للرد التلقائي على رسائل العملاء.</p>
|
435 |
+
</div>
|
436 |
+
|
437 |
+
<form id="registerForm">
|
438 |
+
<input type="hidden" id="pageToken" value="{{ page_token }}">
|
439 |
+
<input type="hidden" id="pageId" value="{{ page_id }}">
|
440 |
+
|
441 |
+
<div class="form-group">
|
442 |
+
<label for="username">اسم المستخدم</label>
|
443 |
+
<input type="text" id="username" name="username" value="{{ page_name }}" required>
|
444 |
+
</div>
|
445 |
+
|
446 |
+
<div class="form-group">
|
447 |
+
<label for="password">كلمة المرور</label>
|
448 |
+
<input type="password" id="password" name="password" required>
|
449 |
+
<div class="password-requirements">
|
450 |
+
يجب أن تحتوي كلمة المرور على 8 أحرف على الأقل، وحرف كبير، وحرف صغير، ورقم، ورمز خاص.
|
451 |
+
</div>
|
452 |
+
</div>
|
453 |
+
|
454 |
+
<div class="form-group">
|
455 |
+
<label for="confirmPassword">تأكيد كلمة المرور</label>
|
456 |
+
<input type="password" id="confirmPassword" name="confirmPassword" required>
|
457 |
+
</div>
|
458 |
+
|
459 |
+
<button type="submit" class="submit-btn" id="submitButton">
|
460 |
+
<span class="button-text">إنشاء الحساب</span>
|
461 |
+
<span class="spinner" id="loadingSpinner"></span>
|
462 |
+
</button>
|
463 |
+
</form>
|
464 |
+
</div>
|
465 |
+
|
466 |
+
<div class="footer">
|
467 |
+
<p class="footer-text">NANO BOT © 2023 - روبوت الذكاء الاصطناعي للتواصل مع العملاء</p>
|
468 |
+
<div class="social-links">
|
469 |
+
<a href="#" class="social-link"><i class="fab fa-facebook-f"></i></a>
|
470 |
+
<a href="#" class="social-link"><i class="fab fa-twitter"></i></a>
|
471 |
+
<a href="#" class="social-link"><i class="fab fa-instagram"></i></a>
|
472 |
+
<a href="#" class="social-link"><i class="fab fa-linkedin-in"></i></a>
|
473 |
+
</div>
|
474 |
+
</div>
|
475 |
+
</div>
|
476 |
+
|
477 |
+
<script>
|
478 |
+
const socket = io();
|
479 |
+
|
480 |
+
document.getElementById('registerForm').addEventListener('submit', function(e) {
|
481 |
+
e.preventDefault();
|
482 |
+
|
483 |
+
const username = document.getElementById('username').value;
|
484 |
+
const password = document.getElementById('password').value;
|
485 |
+
const confirmPassword = document.getElementById('confirmPassword').value;
|
486 |
+
const pageToken = document.getElementById('pageToken').value;
|
487 |
+
const pageId = document.getElementById('pageId').value;
|
488 |
+
const submitButton = document.getElementById('submitButton');
|
489 |
+
const buttonText = document.querySelector('.button-text');
|
490 |
+
const loadingSpinner = document.getElementById('loadingSpinner');
|
491 |
+
|
492 |
+
// Validate password
|
493 |
+
if (password.length < 8) {
|
494 |
+
showNotification('يجب أن تحتوي كلمة المرور على 8 أحرف على الأقل.', 'error');
|
495 |
+
return;
|
496 |
+
}
|
497 |
+
|
498 |
+
if (!/[A-Z]/.test(password)) {
|
499 |
+
showNotification('يجب أن تحتوي كلمة المرور على حرف كبير واحد على الأقل.', 'error');
|
500 |
+
return;
|
501 |
+
}
|
502 |
+
|
503 |
+
if (!/[a-z]/.test(password)) {
|
504 |
+
showNotification('يجب أن تحتوي كلمة المرور على حرف صغير واحد على الأقل.', 'error');
|
505 |
+
return;
|
506 |
+
}
|
507 |
+
|
508 |
+
if (!/[0-9]/.test(password)) {
|
509 |
+
showNotification('يجب أن تحتوي كلمة المرور على رقم واحد على الأقل.', 'error');
|
510 |
+
return;
|
511 |
+
}
|
512 |
+
|
513 |
+
if (!/[!@#$%^&*(),.?":{}|<>]/.test(password)) {
|
514 |
+
showNotification('يجب أن تحتوي كلمة المرور على رمز خاص واحد على الأقل.', 'error');
|
515 |
+
return;
|
516 |
+
}
|
517 |
+
|
518 |
+
if (password !== confirmPassword) {
|
519 |
+
showNotification('كلمات المرور غير متطابقة.', 'error');
|
520 |
+
return;
|
521 |
+
}
|
522 |
+
|
523 |
+
// Show loading state
|
524 |
+
buttonText.style.opacity = '0';
|
525 |
+
loadingSpinner.style.display = 'block';
|
526 |
+
submitButton.disabled = true;
|
527 |
+
|
528 |
+
// Send data to server via WebSocket
|
529 |
+
socket.emit('save_user_data', {
|
530 |
+
username: username,
|
531 |
+
password: password,
|
532 |
+
page_token: pageToken,
|
533 |
+
page_id: pageId,
|
534 |
+
page_name: document.getElementById('pageName').textContent // Add this line
|
535 |
+
});
|
536 |
+
});
|
537 |
+
|
538 |
+
socket.on('registration_response', function(data) {
|
539 |
+
const buttonText = document.querySelector('.button-text');
|
540 |
+
const loadingSpinner = document.getElementById('loadingSpinner');
|
541 |
+
const submitButton = document.getElementById('submitButton');
|
542 |
+
|
543 |
+
// Hide loading state
|
544 |
+
loadingSpinner.style.display = 'none';
|
545 |
+
buttonText.style.opacity = '1';
|
546 |
+
submitButton.disabled = false;
|
547 |
+
|
548 |
+
if (data.success) {
|
549 |
+
showNotification(data.message, 'success');
|
550 |
+
buttonText.innerHTML = '<i class="fas fa-check"></i> تم إنشاء الحساب بنجاح';
|
551 |
+
submitButton.style.background = 'linear-gradient(135deg, #10b981, #059669)';
|
552 |
+
|
553 |
+
setTimeout(function() {
|
554 |
+
window.location.href = 'http://127.0.0.1:5000/';
|
555 |
+
}, 2000);
|
556 |
+
} else {
|
557 |
+
showNotification(data.message, 'error');
|
558 |
+
}
|
559 |
+
});
|
560 |
+
|
561 |
+
function showNotification(message, type) {
|
562 |
+
const notification = document.getElementById('notification');
|
563 |
+
notification.textContent = message;
|
564 |
+
notification.className = 'notification ' + type;
|
565 |
+
notification.style.display = 'block';
|
566 |
+
|
567 |
+
setTimeout(function() {
|
568 |
+
notification.style.opacity = '0';
|
569 |
+
notification.style.transform = 'translateX(-50%) translateY(-20px)';
|
570 |
+
setTimeout(() => {
|
571 |
+
notification.style.display = 'none';
|
572 |
+
notification.style.opacity = '1';
|
573 |
+
notification.style.transform = 'translateX(-50%) translateY(0)';
|
574 |
+
}, 300);
|
575 |
+
}, 5000);
|
576 |
+
}
|
577 |
+
</script>
|
578 |
+
</body>
|
579 |
+
</html>
|