Skip to content

Commit 59ae632

Browse files
committed
Added Preloader
1 parent fda85c4 commit 59ae632

File tree

4 files changed

+44
-0
lines changed

4 files changed

+44
-0
lines changed

Views/Shared/_Layout.cshtml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@
3232
</nav>
3333
</header>
3434
<div class="container">
35+
<div id="preloader">
36+
<img src="~/preloader.gif" alt="Loading..." />
37+
</div>
38+
<script>
39+
window.addEventListener('load', function() {
40+
setTimeout(function() {
41+
document.getElementById('preloader').style.display = 'none';
42+
}, 5000);
43+
});
44+
</script>
3545
<main role="main" class="pb-3">
3646
@RenderBody()
3747
</main>

Views/Shared/_Layout.cshtml.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,20 @@ button.accept-policy {
4646
white-space: nowrap;
4747
line-height: 60px;
4848
}
49+
#preloader {
50+
position: fixed;
51+
top: 0;
52+
left: 0;
53+
width: 100%;
54+
height: 100%;
55+
background-color: #fff;
56+
z-index: 9999;
57+
display: flex;
58+
justify-content: center;
59+
align-items: center;
60+
}
61+
62+
#preloader img {
63+
width: 100px;
64+
height: 100px;
65+
}

wwwroot/css/site.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,21 @@ html {
1919

2020
body {
2121
margin-bottom: 60px;
22+
}
23+
#preloader {
24+
position: fixed;
25+
top: 0;
26+
left: 0;
27+
width: 100%;
28+
height: 100%;
29+
background-color: #fff;
30+
z-index: 9999;
31+
display: flex;
32+
justify-content: center;
33+
align-items: center;
34+
}
35+
36+
#preloader img {
37+
width: 100px;
38+
height: 100px;
2239
}

wwwroot/preloader.gif

402 KB
Loading

0 commit comments

Comments
 (0)