html
html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<!-- Created by David Mitterecker -->
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<!--- preloader animation --->
<div id="preloader">
<div class="loader"></div>
</div>
<!--- main content --->
<main>
<h4>Hello</h4>
</main>
</body>
</html>
Enter to Rename, Shift+Enter to Preview
css
css
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
body{
padding:0;
margin:0;
width:100vw;
height:100vh;
}
#preloader {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #142718;
display: flex;
justify-content: center;
align-items: center;
z-index: 999;
transform-origin:center;
}
.loader {
transform: scale(1);
transition: transform 2s ease-in;
width: 70px;
height: 70px;
border-radius: 50%;
border: 8px solid #444444;
border-top: 8px solid darkorange;
Enter to Rename, Shift+Enter to Preview
js
js
1
2
3
4
5
6
7
8
9
10
11
12
13
// Created by David Mitterecker
// In your theme's footer.php or create a new script file
document.addEventListener("DOMContentLoaded", function() {
//simulate slow loading
setTimeout(function () { //simulate loading...
// Hide the preloader when the page is loaded
document.getElementById("preloader").classList.add("okloaded");
}, 3000);
});
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run