Skip to content
This repository was archived by the owner on Sep 5, 2019. It is now read-only.

Commit 5ce199e

Browse files
committed
Update
1 parent 4dbfa02 commit 5ce199e

File tree

2 files changed

+50
-15
lines changed

2 files changed

+50
-15
lines changed

src/css/style.css

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,46 @@ body {
55
font-family: 'Open Sans', sans-serif;
66
}
77

8-
/* nanobar
8+
/* website loader
99
========================================================================== */
10-
.nanobar {
11-
height: 2px;
12-
top: 0;
10+
#webloader {
11+
background: #fff;
12+
height: 100vh;
13+
opacity: 1;
14+
position: fixed;
15+
visibility: visible;
16+
transition: all 0.3s ease-in-out;
1317
width: 100%;
14-
z-index: 9999;
18+
z-index: 999;
1519
}
1620

17-
.nanobar .bar {
18-
background: #acacac;
19-
height: 100%;
20-
transition: height .3s;
21-
width: 0;
21+
#webloader.out {
22+
opacity: 0;
23+
visibility: hidden;
2224
}
2325

26+
#spinner {
27+
width: 40px;
28+
height: 40px;
29+
margin: 100px auto;
30+
background: #333;
31+
position: relative;
32+
top: 35%;
33+
border-radius: 100%;
34+
animation: sk-scaleout 1.0s infinite ease-in-out;
35+
}
36+
37+
@-webkit-keyframes sk-scaleout {
38+
100% {
39+
opacity: 0;
40+
}
41+
}
42+
43+
@keyframes sk-scaleout {
44+
0% {
45+
transform: scale(0);
46+
} 100% {
47+
transform: scale(1.0);
48+
opacity: 0;
49+
}
50+
}

src/index.html

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@
2929
<link rel="stylesheet" href="css/style.css">
3030
</head>
3131
<body>
32+
<!-- website loader -->
33+
<div id="webloader">
34+
<div id="spinner"></div>
35+
</div>
36+
3237
<!-- navigation -->
3338
<div class="nav">
3439

@@ -168,18 +173,21 @@ <h4>Sample</h4>
168173

169174
<!-- javascript libraries and plugins -->
170175
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
171-
<script src="https://cdnjs.cloudflare.com/ajax/libs/nanobar/0.4.2/nanobar.min.js"></script>
172176
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.perfect-scrollbar/1.3.0/perfect-scrollbar.min.js"></script>
173177
<script>
174178
$(function() {
175179

180+
// website loader
181+
window.addEventListener('load', () => {
182+
const webloader = document.getElementById('webloader');
183+
setTimeout(() => {
184+
webloader.classList.add('out');
185+
}, 300);
186+
});
187+
176188
// perfect scrollbar
177189
const ps = new PerfectScrollbar('.scrollbar');
178190

179-
// nanobar
180-
var nanobar = new Nanobar();
181-
nanobar.go(100);
182-
183191
// responsive navigation
184192
$('.nav .click').on('click', function() {
185193
$('.nav .responsive').toggleClass('expandable');

0 commit comments

Comments
 (0)