-
Notifications
You must be signed in to change notification settings - Fork 0
/
preloader.html
234 lines (200 loc) · 5.86 KB
/
preloader.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>PreLoader</title>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js'></script>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
background: #ddd;
height: 100%;
overflow-x: hidden;
}
.text {
color: brown;
font-size: 220px;
text-align: center;
}
/* Preloader */
.container-preloader {
align-items: center;
cursor: none;
display: flex;
height: 100%;
justify-content: center;
position: fixed;
left: 0;
top: 0;
width: 100%;
z-index: 900;
}
.container-preloader .animation-preloader {
position: absolute;
z-index: 100;
}
/* Spinner Loading */
.container-preloader .animation-preloader .spinner {
animation: spinner 1s infinite linear;
border-radius: 50%;
border: 10px solid rgba(0, 0, 0, 0.2);
border-top-color: green;
/* It is not in alphabetical order so that you do not overwrite it */
height: 9em;
margin: 0 auto 3.5em auto;
width: 9em;
}
/* Loading text */
.container-preloader .animation-preloader .txt-loading {
font: bold 5em 'Montserrat', sans-serif;
text-align: center;
user-select: none;
}
.container-preloader .animation-preloader .txt-loading .characters:before {
animation: characters 4s infinite;
color: orange;
content: attr(preloader-text);
left: 0;
opacity: 0;
position: absolute;
top: 0;
transform: rotateY(-90deg);
}
.container-preloader .animation-preloader .txt-loading .characters {
color: rgba(0, 0, 0, 0.2);
position: relative;
}
.container-preloader .animation-preloader .txt-loading .characters:nth-child(2):before {
animation-delay: 0.2s;
}
.container-preloader .animation-preloader .txt-loading .characters:nth-child(3):before {
animation-delay: 0.4s;
}
.container-preloader .animation-preloader .txt-loading .characters:nth-child(4):before {
animation-delay: 0.6s;
}
.container-preloader .animation-preloader .txt-loading .characters:nth-child(5):before {
animation-delay: 0.8s;
}
.container-preloader .animation-preloader .txt-loading .characters:nth-child(6):before {
animation-delay: 1s;
}
.container-preloader .animation-preloader .txt-loading .characters:nth-child(7):before {
animation-delay: 1.2s;
}
.container-preloader .loader-section {
background-color: #ffffff;
height: 100%;
position: fixed;
top: 0;
width: calc(50% + 1px);
}
.container-preloader .loader-section.section-left {
left: 0;
}
.container-preloader .loader-section.section-right {
right: 0;
}
/* Fade effect on loading animation */
.loaded .animation-preloader {
opacity: 0;
transition: 0.3s ease-out;
}
/* Curtain effect */
.loaded .loader-section.section-left {
transform: translateX(-101%);
transition: 0.7s 0.3s all cubic-bezier(0.1, 0.1, 0.1, 1.000);
}
.loaded .loader-section.section-right {
transform: translateX(101%);
transition: 0.7s 0.3s all cubic-bezier(0.1, 0.1, 0.1, 1.000);
}
/* Animation of the preloader */
@keyframes spinner {
to {
transform: rotateZ(360deg);
}
}
/* Animation of letters loading from the preloader */
@keyframes characters {
0%,
75%,
100% {
opacity: 0;
transform: rotateY(-90deg);
}
25%,
50% {
opacity: 1;
transform: rotateY(0deg);
}
}
/* Laptop size back (laptop, tablet, cell phone) */
@media screen and (max-width: 767px) {
/* Preloader */
/* Spinner Loading */
.container-preloader .animation-preloader .spinner {
height: 8em;
width: 8em;
}
/* Text Loading */
.container-preloader .animation-preloader .txt-loading {
font: bold 3.5em 'Montserrat', sans-serif;
}
}
@media screen and (max-width: 500px) {
/* Prelaoder */
/* Spinner Loading */
.container-preloader .animation-preloader .spinner {
height: 7em;
width: 7em;
}
/*Loading text */
.container-preloader .animation-preloader .txt-loading {
font: bold 2em 'Montserrat', sans-serif;
}
}
</style>
</head>
<body>
<!-- Preloader -->
<div id="preloader">
<div id="container" class="container-preloader">
<div class="animation-preloader">
<div class="spinner"></div>
<div class="txt-loading">
<span preloader-text="P" class="characters">P</span>
<span preloader-text="R" class="characters">R</span>
<span preloader-text="E" class="characters">E</span>
<span preloader-text="L" class="characters">L</span>
<span preloader-text="O" class="characters">O</span>
<span preloader-text="A" class="characters">A</span>
<span preloader-text="D" class="characters">D</span>
</div>
</div>
<div class="loader-section section-left"></div>
<div class="loader-section section-right"></div>
</div>
</div>
<h1 class="text">Welcome to the loaded Page</span></h1>
<script>
$(document).ready(function() {
setTimeout(function() {
$('#container').addClass('loaded');
// Once the container has finished, the scroll appears
if ($('#container').hasClass('loaded')) {
// It is so that once the container is gone, the entire preloader section is deleted
$('#preloader').delay(9000).queue(function() {
$(this).remove();
});
}
}, 3000);
});
</script>
</body>
</html>