parent
cd228d507d
commit
793785a5b0
@ -0,0 +1,15 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Blurry Loading</title>
|
||||||
|
<link rel="stylesheet" href="style.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<section class="bg"></section>
|
||||||
|
<div class="loading-text">0%</div>
|
||||||
|
<script src="script.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -1,19 +1,17 @@
|
|||||||
const loadText = document.querySelector('.loading-text')
|
const loadText = document.querySelector('.loading-text');
|
||||||
const bg = document.querySelector('.bg')
|
const bg = document.querySelector('.bg');
|
||||||
|
|
||||||
let load = 0
|
let load = 0;
|
||||||
|
let int = setInterval(blurring, 30);
|
||||||
let int = setInterval(blurring, 30)
|
|
||||||
|
|
||||||
function blurring() {
|
function blurring() {
|
||||||
load++
|
load++;
|
||||||
|
|
||||||
if(load > 99) {
|
if(load > 99) {
|
||||||
clearInterval(int)
|
clearInterval(int);
|
||||||
}
|
}
|
||||||
|
loadText.innerText = `${load}%`;
|
||||||
loadText.innerText = `${load}%`
|
loadText.style.opacity = scale(load, 0, 100, 1, 0);
|
||||||
loadText.style.opacity = scale(load, 0, 100, 1, 0)
|
|
||||||
bg.style.filter = `blur(${scale(load, 0, 100, 30, 0)}px)`
|
bg.style.filter = `blur(${scale(load, 0, 100, 30, 0)}px)`
|
||||||
}
|
}
|
||||||
|
|
@ -1,15 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
<link rel="stylesheet" href="style.css" />
|
|
||||||
<title>Blurry Loading</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<section class="bg"></section>
|
|
||||||
<div class="loading-text">0%</div>
|
|
||||||
|
|
||||||
<script src="script.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
Loading…
Reference in new issue