Skip to content

Commit

Permalink
Merge pull request #135 from HarryDulaney/jquery-impl-fix
Browse files Browse the repository at this point in the history
loader
  • Loading branch information
HarryDulaney authored Nov 5, 2023
2 parents 1658b2d + d3901b2 commit e15aafc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 19 deletions.
7 changes: 5 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,10 @@
<script src="./js/contact.js"></script>
<script src="./js/about.js"></script>
<script src="./js/download.js"></script>
<script src="./js/app.js"></script>
<script
defer
src="./js/app.js"
></script>
<!-- Google tag (gtag.js) -->
<script
async
Expand All @@ -188,7 +191,7 @@
gtag('config', 'G-8SEGDSK9CG');
</script>

<body onload="javascript:onBodyLoaded()">
<body>
<!----------------------------------------------- Loader overlay ---------------------------------------------------->
<div
id="loader-container"
Expand Down
23 changes: 6 additions & 17 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,27 +209,17 @@ function toggleLoader() {
}

function showLoader() {
if (isLoading) { return; } // Already shown
FOOTER_CONTAINER.classList.replace('show-footer', 'hide-footer');
NAV_BAR_CONTAINER.classList.replace('show-navbar', 'hide-navbar');
LOADER_CONTAINER.classList.replace('hide-loading', 'show-loading');
isLoading = true;
FOOTER_CONTAINER.classList.add('hide-footer');
NAV_BAR_CONTAINER.classList.add('hide-navbar');
FOOTER_CONTAINER.classList.remove('show-footer');
NAV_BAR_CONTAINER.classList.remove('show-navbar');
LOADER_CONTAINER.classList.add('show-loading');
LOADER_CONTAINER.classList.remove('hide-loading');

}

function hideLoader() {
if (!isLoading) { return; } // Already hidden
LOADER_CONTAINER.classList.replace('show-loading', 'hide-loading');
FOOTER_CONTAINER.classList.replace('hide-footer', 'show-footer');
NAV_BAR_CONTAINER.classList.replace('hide-navbar', 'show-navbar');
isLoading = false;
LOADER_CONTAINER.classList.remove('show-loading');
LOADER_CONTAINER.classList.add('hide-loading');
FOOTER_CONTAINER.classList.remove('hide-footer');
NAV_BAR_CONTAINER.classList.remove('hide-navbar');
FOOTER_CONTAINER.classList.add('show-footer');
NAV_BAR_CONTAINER.classList.add('show-navbar');

}


Expand Down Expand Up @@ -265,7 +255,6 @@ $(function () {
NAV_BAR_CONTAINER = document.querySelector('#nav-container');
LOADER_CONTAINER = document.querySelector('#loader-container');
IS_RELOADED = sessionStorage.getItem(PAGE_RELOADED_STORAGE_KEY, 'reloaded') !== null;
showLoader();
setNavMenuElementIds();
initializeTheme();
var initialScrollPos = window.scrollY;
Expand Down

0 comments on commit e15aafc

Please sign in to comment.