-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.html
74 lines (66 loc) · 2.26 KB
/
test.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://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<style>
#button {
display: block;
margin: 20px auto;
padding: 10px 30px;
background-color: #eee;
border: solid #ccc 1px;
cursor: pointer;
}
#overlay {
position: fixed;
top: 0;
z-index: 100;
width: 100%;
height: 100%;
display: none;
background: rgba(0, 0, 0, 0.6);
}
.cv-spinner {
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
.spinner {
width: 40px;
height: 40px;
border: 4px #ddd solid;
border-top: 4px #2e93e6 solid;
border-radius: 50%;
animation: sp-anime 0.8s infinite linear;
}
@keyframes sp-anime {
100% {
transform: rotate(360deg);
}
}
.is-hide {
display: none;
}
</style>
</head>
<body>
<button id="button" auto hidden></button>
<div id="overlay">
<div class="cv-spinner"><span class="spinner"></span></div>
</div>
<!-- <h1>Hello</h1> -->
<script>
window.onload = () => $('#button').click();
jQuery($ => {
$(document).ajaxSend(() => $("#overlay").fadeIn(300));
$('#button').click(() => $.ajax({ type: 'GET', success: data => console.log(data) }).done(() => setTimeout(() => $("#overlay").fadeOut(400), 500)));
});
</script>
</body>
</html>