Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stop preloader after all elements loaded on page(including images) + … #78

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,8 @@ $(function () {
$('html, body').animate({ scrollTop: $($(this).attr('href')).offset().top }, 500, 'linear');
});
});

// wait untill all elements load on page, then hide the preloader
$(window).on("load", function () {
$("#wrapper").hide();
});
21 changes: 16 additions & 5 deletions assets/styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,27 @@ html {
}
body {
font-family: 'Space Mono', monospace !important;
background: url(https://hacktoberfest.digitalocean.com/assets/bg-right-e498161aecb6d9b04889329f11ce0b4e09e562ead23fb12d05b7508d1dc0c85c.png),
url(https://hacktoberfest.digitalocean.com/assets/bg-left-6cede81e395aa4ed5f64010cba3cd32b0cd8b29934de8a75b93c40dc9941fdd5.png),
rgb(18, 33, 71);
background-blend-mode: normal;
background-size: cover;
background: rgb(18, 33, 71);
}

section {
display: list-item;
}
#section01{
position: relative;
}
#section01::after{
content: url('https://hacktoberfest.digitalocean.com/assets/bg-right-e498161aecb6d9b04889329f11ce0b4e09e562ead23fb12d05b7508d1dc0c85c.png');
position: absolute;
top: 80px;
right: 0;
}
#section01::before{
content: url('https://hacktoberfest.digitalocean.com/assets/bg-left-6cede81e395aa4ed5f64010cba3cd32b0cd8b29934de8a75b93c40dc9941fdd5.png');
position: absolute;
top: 0px;
left: 0;
}
#section02 {
min-height: 90vh;
}
Expand Down
17 changes: 3 additions & 14 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,8 @@
crossorigin="anonymous"
/>
<link rel="stylesheet" href="assets/styles/main.css" />
<script>
function removeloader() {
document.getElementById('wrapper').style.display = 'none';
}
</script>
</head>
<body onload="removeloader()">
<body>
<div id="wrapper">
<svg
width="65px"
Expand Down Expand Up @@ -145,11 +140,8 @@ <h3 class="time">
</footer>

<!--bootstrap libraries-->
<script
src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
crossorigin="anonymous"
></script>
<!--jquery library full-->
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1"
Expand All @@ -163,9 +155,6 @@ <h3 class="time">
<!--Vanilla tilt library-->
<script src="https://unpkg.com/[email protected]/dest/tilt.jquery.min.js"></script>

<!--jquery library full-->
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>

<!--main library-->
<script src="assets/js/main.js"></script>

Expand Down