Skip to content

Commit

Permalink
Merge pull request #21 from aviiciii/dev
Browse files Browse the repository at this point in the history
Preloader added
  • Loading branch information
aviiciii authored Jun 2, 2023
2 parents 413a35b + 225d03b commit ee6e08e
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
10 changes: 9 additions & 1 deletion assets/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,4 +193,12 @@ function light(){
// save preference
localStorage.setItem('dark-mode', 'false');

}
}


// preloader
window.addEventListener('load', function() {
document.body.style.opacity = '1';
document.body.style.visibility = 'visible';
document.querySelector('.preloader').style.display = 'none';
});
27 changes: 26 additions & 1 deletion assets/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@ body {
-khtml-user-drag: none;
-moz-user-drag: none;
-o-user-drag: none;
user-drag: none;

}

Expand Down Expand Up @@ -380,3 +379,29 @@ body {
}
}


/* preloader */

body {
opacity: 0;
visibility: hidden;
transition: opacity 0.8s ease-in;
}

.preloader {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #333;
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 9999;
}

.preloader-text {
color: #fff;
font-size: 24px;
}
4 changes: 4 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
</head>

<body>
<!-- preloader -->
<div class="preloader">
<span class="preloader-text">Loading...</span>
</div>

<!-- dark mode toggle -->
<div class="dark-mode-toggle">
Expand Down

0 comments on commit ee6e08e

Please sign in to comment.