Skip to content

Commit 85cba54

Browse files
committed
preloader
1 parent 59fd823 commit 85cba54

File tree

3 files changed

+79
-76
lines changed

3 files changed

+79
-76
lines changed

_layouts/default.html

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,6 @@
2626
<link href="{{ site.baseurl }}/assets/css/style.css" rel="stylesheet">
2727

2828

29-
<script type="text/javascript" language="javascript">
30-
31-
$(document).ready(function () {
32-
setTimeout(function () {
33-
var imgs = document.getElementsByClassName("lazy-load");
34-
for (var i = 0; i < imgs.length; i++) {
35-
imgs[i].src = imgs[i].getAttribute("data-src");
36-
}
37-
}, 1000);
38-
});
39-
40-
</script>
41-
4229
</head>
4330

4431
{% capture layout %}{% if page.layout %}layout-{{ page.layout }}{% endif %}{% endcapture %}
@@ -47,15 +34,15 @@
4734
<!-- <div id="loader"></div> -->
4835
<!-- PRE LOADER -->
4936

50-
<div class="loader">
37+
<!-- <div class="loader">
5138
<div class="spinner">
5239
<div class="dot1"></div>
5340
<div class="dot2"></div>
5441
</div>
55-
</div>
56-
<!-- <div class="loader">
57-
<img src="/assets/images/Earth-loader.gif" alt="">
58-
</div> -->
42+
</div> -->
43+
44+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
45+
<div id="preloader"></div>
5946
<div id="page" class="site">
6047

6148
{% if page.url == "/" %}

_sass/_general.scss

Lines changed: 62 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -844,61 +844,70 @@ pre[class*="language-"] {
844844
/*---------------------------------------
845845
Preloader section
846846
-----------------------------------------*/
847-
848-
.loader {
849-
position: fixed;
850-
top: 0;
851-
left: 0;
852-
width: 100%;
853-
height: 100%;
854-
z-index: 99999;
855-
display: flex;
856-
flex-flow: row nowrap;
857-
justify-content: center;
858-
align-items: center;
859-
background: none repeat scroll 0 0 #ffffff;
860-
}
847+
#preloader {
848+
position: fixed;
849+
left: 0;
850+
top: 0;
851+
z-index: 99999;
852+
width: 100%;
853+
height: 100%;
854+
overflow: visible;
855+
background: rgb(255, 255, 255) url('/assets/images/Earth-loader.gif') no-repeat center center;
856+
}
857+
// .loader {
858+
// position: fixed;
859+
// top: 0;
860+
// left: 0;
861+
// width: 100%;
862+
// height: 100%;
863+
// z-index: 99999;
864+
// display: flex;
865+
// flex-flow: row nowrap;
866+
// justify-content: center;
867+
// align-items: center;
868+
// background: none repeat scroll 0 0 #ffffff;
869+
// }
861870

862-
.spinner {
863-
margin: 100px auto;
864-
width: 40px;
865-
height: 40px;
866-
position: relative;
867-
text-align: center;
868-
}
871+
// .spinner {
872+
// margin: 100px auto;
873+
// width: 40px;
874+
// height: 40px;
875+
// position: relative;
876+
// text-align: center;
877+
// }
869878

870-
.dot1 {
871-
width: 100%;
872-
height: 100%;
873-
margin-left: -20px;
874-
display: inline-block;
875-
position: absolute;
876-
top: 0;
877-
background-color: rgb(201, 57, 102);
878-
border-radius: 100%;
879-
z-index: 1;
880-
}
879+
// .dot1 {
880+
// width: 100%;
881+
// height: 100%;
882+
// margin-left: -20px;
883+
// display: inline-block;
884+
// position: absolute;
885+
// top: 0;
886+
// background-color: rgb(201, 57, 102);
887+
// border-radius: 100%;
888+
// z-index: 1;
889+
// }
881890

882-
.dot2 {
883-
display: inline-block;
884-
position: absolute;
885-
background-color: rgb(221, 124, 191);
886-
border-radius: 100%;
887-
width: 40%;
888-
height: 40%;
889-
margin-left: -20px;
890-
top: 30px;
891-
left: 0px;
892-
z-index: 2;
893-
-webkit-animation: sk-orbit 0.75s infinite linear;
894-
animation: sk-orbit 0.75s infinite linear;
895-
}
891+
// .dot2 {
892+
// display: inline-block;
893+
// position: absolute;
894+
// background-color: rgb(221, 124, 191);
895+
// border-radius: 100%;
896+
// width: 40%;
897+
// height: 40%;
898+
// margin-left: -20px;
899+
// top: 30px;
900+
// left: 0px;
901+
// z-index: 2;
902+
// -webkit-animation: sk-orbit 0.75s infinite linear;
903+
// animation: sk-orbit 0.75s infinite linear;
904+
// }
896905

897-
@keyframes sk-orbit {
898-
0% { z-index: 2; transform: translate(0%, 0%); }
899-
49% { z-index: 2; transform: translate(400%, -200%); }
900-
50% { z-index: 0; transform: translate(400%, -200%); }
901-
99% { z-index: 0; transform: translate(0%, 0%); }
902-
100% { z-index: 2; transform: translate(0%, 0%); }
903-
}
906+
// @keyframes sk-orbit {
907+
// 0% { z-index: 2; transform: translate(0%, 0%); }
908+
// 49% { z-index: 2; transform: translate(400%, -200%); }
909+
// 50% { z-index: 0; transform: translate(400%, -200%); }
910+
// 99% { z-index: 0; transform: translate(0%, 0%); }
911+
// 100% { z-index: 2; transform: translate(0%, 0%); }
912+
// }
904913

assets/js/loader.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,17 @@
22
PRE LOADER
33
-------------------------------------------------------------------------------*/
44

5-
$(window).load(function() {
6-
$('.loader').fadeOut(1000); // set duration in brackets
7-
});
5+
// $(window).load(function() {
6+
// $('.loader').fadeOut(1000); // set duration in brackets
7+
// });
88

9-
$(document).ready(function() {
10-
$('[data-toggle="tooltip"]').tooltip({boundary: 'window'});
9+
// $(document).ready(function() {
10+
// $('[data-toggle="tooltip"]').tooltip({boundary: 'window'});
11+
// });
12+
$(function() {
13+
$(window).on("load", function() {
14+
$('#preloader').fadeOut('slow', function() {
15+
$(this).remove();
16+
});
17+
});
1118
});

0 commit comments

Comments
 (0)