Skip to content

Commit

Permalink
Added Loading Screen
Browse files Browse the repository at this point in the history
Added loading screen by adding forgotten html and center the text by switching from block to flex
  • Loading branch information
TheManWhoLikesToCode committed Jan 22, 2024
1 parent 565c84b commit d36902a
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 25 deletions.
2 changes: 1 addition & 1 deletion frontend/static/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -10384,4 +10384,4 @@ footer h5 {
.switcher-wrap {
display: none;
}
}
}
4 changes: 1 addition & 3 deletions frontend/static/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const app = (() => {
const showLoadingScreen = () => {
const loadingScreen = document.getElementById("loading-screen");
if (loadingScreen) {
loadingScreen.style.display = "block";
loadingScreen.style.display = "flex";
}
};

Expand Down Expand Up @@ -128,8 +128,6 @@ const app = (() => {
const password = document.getElementById("password").value;
const responseContainer = document.getElementById("response-container");

showLoadingScreen();

try {
const response = await fetchWithErrorHandler(`${apiUrl}/login`, {
method: "POST",
Expand Down
52 changes: 31 additions & 21 deletions frontend/templates/userPage.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,31 +48,30 @@
</div>
</section>

<!-- Archive Section -->
<!-- Archive Section -->
<section class="py-7 py-md-0 bg-hero" id="archive">
<div class="container">
<div class="row vh-md-100 align-items-center">
<div class="col-md-8 col-sm-10 col-12 mx-auto">
<h1 class="heading-black text-capitalize text-center">
Archive with Archive-Me
</h1>
<p class="lead py-3 text-center">
Utilize Archive-Me to manage and organize your digital resources effectively.
</p>
<!-- Archive Box -->
<div class="archive-box bg-dark p-4 rounded shadow text-white">
<h4 class="text-left">You are Logged In</h4>
<p class="text-left">Access and manage your archived courses and resources with ease.</p>
<div class="text-left">
<button type="button" class="btn btn-primary" id="archiveButton">Archive Courses</button>
<button type="button" class="btn btn-secondary" id="downloadButton">Download</button>
<!-- Archive Section -->
<section class="py-7 py-md-0 bg-hero" id="archive">
<div class="container">
<div class="row vh-md-100 align-items-center">
<div class="col-md-8 col-sm-10 col-12 mx-auto">
<h1 class="heading-black text-capitalize text-center">
Archive with Archive-Me
</h1>
<p class="lead py-3 text-center">
Utilize Archive-Me to manage and organize your digital resources effectively.
</p>
<!-- Archive Box -->
<div class="archive-box bg-dark p-4 rounded shadow text-white">
<h4 class="text-left">You are Logged In</h4>
<p class="text-left">Access and manage your archived courses and resources with ease.</p>
<div class="text-left">
<button type="button" class="btn btn-primary" id="archiveButton">Archive Courses</button>
<button type="button" class="btn btn-secondary" id="downloadButton">Download</button>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</section>



Expand Down Expand Up @@ -101,6 +100,17 @@ <h3>Directory Listing for <span id="path">/path/to/directory</span></h3>
</div>
</section>

<!-- Loading Screen -->
<div id="loading-screen"
style="display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255, 255, 255, 0.8); z-index: 1000; align-items: center; justify-content: center; display: flex;">
<div style="text-align: center;">
<div class="spinner-border text-primary" role="status" style="width: 3rem; height: 3rem;">
<span class="sr-only">Loading...</span>
</div>
<p style="color: black;">Loading, please wait...</p>
</div>
</div>

<!-- Footer -->
<footer class="py-6">
<!-- Existing Footer Content -->
Expand Down

0 comments on commit d36902a

Please sign in to comment.