-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloading.html
More file actions
65 lines (57 loc) · 1.51 KB
/
Copy pathloading.html
File metadata and controls
65 lines (57 loc) · 1.51 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Loading</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
width: 100vw;
height: 100svh;
}
.container {
height: 100vh;
width: 100vw;
background-image: url("./images/image2.jpg");
background-repeat: no-repeat;
background-size: cover;
filter: blur(100px);
}
.loader {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 1;
color: white;
font-size: 2rem;
}
</style>
</head>
<body>
<div class="container"></div>
<div class="loader"></div>
<script>
const loader = document.querySelector(".loader");
let load = 0;
const interval = setInterval(() => {
if (load < 100) {
load += 1;
}
document.querySelector(".container").style.filter = "blur(" + (100 - load) + "px)";
if (load >= 100) {
setTimeout(() => {
loader.style.display = "none";
clearInterval(interval);
}, 500);
}
loader.textContent = load + "%";
}, 50);
</script>
</body>
</html>