-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
78 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,39 @@ | |
<!-- htmx --> | ||
<script src="https://unpkg.com/[email protected]" integrity="sha384-D1Kt99CQMDuVetoL1lrYwg5t+9QdHe7NLX/SoJYkXDFfX37iInKRy5xLSi8nO7UC" crossorigin="anonymous"></script> | ||
<style> | ||
#loader-wrapper { | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
background-color: rgba(255, 255, 255, 0.8); | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
z-index: 9999; | ||
} | ||
#loader { | ||
border: 8px solid #f3f3f3; | ||
border-top: 8px solid #3498db; | ||
border-radius: 50%; | ||
width: 50px; | ||
height: 50px; | ||
animation: spin 1s linear infinite; | ||
} | ||
@keyframes spin { | ||
0% { transform: rotate(0deg); } | ||
100% { transform: rotate(360deg); } | ||
} | ||
.tables { | ||
display: none; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
|
@@ -116,29 +149,27 @@ | |
</div> | ||
</header> | ||
<main> | ||
<div class="loaderDiv"> | ||
<p>0%</p> | ||
<div class="container"> | ||
<div class="loader"></div> | ||
<div id="loader-wrapper"> | ||
<div id="loader"></div> | ||
</div> | ||
<div class="tables"> | ||
<div hx-get="loaddata.php" hx-trigger="load delay:0.1s" hx-swap="outerHTML"> | ||
</div> | ||
<p>100%</p> | ||
</div> | ||
<script defer> | ||
document.addEventListener("DOMContentLoaded", function() { | ||
// Sélectionnez l'image loader GIF après que le DOM soit chargé | ||
var loader = document.querySelector('.loaderDiv'); | ||
<script> | ||
document.addEventListener("htmx:afterRequest", function () { | ||
// Hide the loader and show the content after each htmx request | ||
const loaderWrapper = document.getElementById("loader-wrapper"); | ||
const tables = document.querySelector(".tables"); | ||
// Définissez un délai de 10 secondes pour masquer le loader | ||
setTimeout(function() { | ||
loader.style.display = 'none'; | ||
}, 15000); | ||
loaderWrapper.style.display = "none"; | ||
tables.style.display = "block"; | ||
}); | ||
</script> | ||
<div hx-get="loaddata.php" hx-trigger="load delay:0.1s" hx-swap="outerHTML"> | ||
</div> | ||
</main> | ||
<footer> | ||
|
@@ -191,4 +222,4 @@ | |
</body> | ||
</html> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters