Skip to content

Commit f5b3a81

Browse files
committed
Blur DOM Loader files added with read.me
1 parent 4cd1ec4 commit f5b3a81

File tree

5 files changed

+84
-0
lines changed

5 files changed

+84
-0
lines changed

Blur Image Loader/1626442057935.jpg

3.31 MB
Loading

Blur Image Loader/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
# Blur DOM Loader
3+
CSS animation and JS power ...giving it an effect of blur fading when website is loaded
4+
## 🚀 About Me
5+
I'm a full stack developer...you can follow me here -https://github.com/RAHULBAWA777
6+
7+
8+
## Run Locally
9+
10+
Clone the project
11+
12+
13+
Start the live server
14+
15+
16+
## Used By
17+
18+
This project is used by the following companies:
19+
20+
- https://github.com/Dezenix/frontend-html-css-js

Blur Image Loader/index.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>Blur Loader</title>
8+
<link rel="stylesheet" href="style.css">
9+
</head>
10+
<body>
11+
<section class="image"></section>
12+
<div class="percentage">0%</div>
13+
<script src="script.js"></script>
14+
</body>
15+
</html>

Blur Image Loader/script.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
const percentage = document.querySelector('.percentage');
2+
const image = document.querySelector('.image');
3+
4+
let load = 0
5+
let int = setInterval(blurring, 30)
6+
7+
function blurring(){
8+
load ++
9+
10+
if (load >99){
11+
clearInterval(int)
12+
}
13+
percentage.innerText = `${load}`
14+
percentage.style.opacity = scale(load,0,100,1,0)
15+
image.style.filter = `blur(${scale(load,0,100,30,0)}px)`
16+
}
17+
18+
function scale (number, inMin, inMax, outMin, outMax) {
19+
return (number - inMin) * (outMax - outMin) / (inMax - inMin) + outMin;
20+
}

Blur Image Loader/style.css

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
*{
2+
box-sizing: border-box;
3+
}
4+
5+
body{
6+
display: flex;
7+
/* flex-direction: column; */
8+
align-items: center;
9+
justify-content: center;
10+
height: 100vh;
11+
overflow: hidden;
12+
margin: 0;
13+
}
14+
15+
.image{
16+
background:url('1626442057935.jpg') no-repeat center center/cover;
17+
position: absolute;
18+
top: -30px;
19+
left: -30px;
20+
width: calc(100vw + 60px);
21+
height: calc(100vh + 60px);
22+
z-index: -1;
23+
filter: blur(0px);
24+
}
25+
26+
.percentage{
27+
font-size: 50px;
28+
color: aliceblue;
29+
}

0 commit comments

Comments
 (0)