Skip to content

Commit

Permalink
Ajout barre de chargement
Browse files Browse the repository at this point in the history
  • Loading branch information
MrSpaar committed Jan 28, 2024
1 parent 934102d commit 48bc76e
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions pages/Cartes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Pour tout ce qui est prise de décision et reconnaissance d'images, des Raspberr

![GPIO Raspberry Pi](/static/images/boards/GPIO.webp){: style="display: inline-block;"}
![Tailles Raspberry Pi](/static/images/boards/RPI.webp){: style="display: inline-block;"}
{: style="text-align: center;"}

Pour le reste, des NUCLEO-L432KC sont utilisées :
![NUCLEO-L432KC](/static/images/boards/L432KC.webp)
19 changes: 19 additions & 0 deletions scss/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,25 @@ header {

}

#loader.active {
top: 0;
width: 100%;
height: 2px;
position: fixed;
background-color: var(--accent-color);
animation: loader .8s forwards;

@keyframes loader {
0% { width: 0; }
99% { width: 100%; }
100% { opacity: 0; }
}

@media (max-width: $mobile-break) {
top: $nav-header-height;
}
}

.main {
margin-top: $space + $nav-header-height;

Expand Down
5 changes: 5 additions & 0 deletions static/script.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
function preFetch() {
loader.classList.add('active');
}

function updateWithJSON(json) {
document.title = "Wiki Robotech Nancy - " + json["title"];
document.querySelector('meta[name="description"]').content = json["description"];
Expand Down Expand Up @@ -30,4 +34,5 @@ function postFetch() {

window.scrollTo(0, 0);
document.body.classList.remove('nav-open');

}
2 changes: 2 additions & 0 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ <h1>
</nav>
</header>

<div id="loader" class="active"></div>

<section class="main">
<div class="page-header">
<h2>{% if uri %}{{ uri }}{% else %}Wiki Robotech Nancy{% endif %}</h2>
Expand Down

0 comments on commit 48bc76e

Please sign in to comment.