Skip to content

Commit

Permalink
Added loading screen to home page
Browse files Browse the repository at this point in the history
There is now is a loading page when navigating to the home page. Prior to this you would watch the thumbnails load which didn't feel very polished.
  • Loading branch information
rstrom1763 committed Nov 24, 2023
1 parent d462f61 commit 6a84813
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 1 deletion.
35 changes: 35 additions & 0 deletions api/static/css/home.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
/* Start of loading screen stuff */
#loading-screen {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgb(80, 80, 80);
display: flex;
justify-content: center;
align-items: center;
z-index: 9999;
}

.loader {
border: 6px solid #f3f3f3;
border-top: 6px solid #3498db;
border-radius: 50%;
width: 50px;
height: 50px;
animation: spin 2s linear infinite;
}

@keyframes spin {
0% {
transform: rotate(0deg);
}

100% {
transform: rotate(360deg);
}
}

/* End of loading screen stuff */

.navbar {
z-index: 9999;
overflow: hidden;
Expand Down
4 changes: 4 additions & 0 deletions api/static/html/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
</head>
<body>

<div id="loading-screen">
<div class="loader"></div>
</div>

<div class="container">

{{range .}}
Expand Down
10 changes: 9 additions & 1 deletion api/static/js/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,12 @@ function goToShoot(passedDiv){
console.log(url)
window.location.href = url.join("/")

}
}

window.addEventListener("load", function () {

// Hide the loading screen once all images are loaded
const loadingScreen = document.getElementById("loading-screen");
loadingScreen.style.display = "none";

});

0 comments on commit 6a84813

Please sign in to comment.