Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions assets/js/loadingBar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const loadingBar = document.querySelector(".o-loading-bar");

document.addEventListener("click", (e) => {
const link = e.target.closest("a");
if (!link) return;
if (link.target === "_blank") return;
if (link.pathname === window.location.pathname) return;
if (e.metaKey || e.ctrlKey || e.shiftKey) return;
loadingBar.classList.add("o-loading-bar--active");
});
1 change: 1 addition & 0 deletions assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ import "./expander.js";
import "./dialog.js";
import "./fipValidityComparison.js";
import "./search.js";
import "./loadingBar.js";
14 changes: 14 additions & 0 deletions assets/sass/loadingBar.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.o-loading-bar {
position: absolute;
bottom: -0.3rem;
left: 0;
width: 0;
height: 0.3rem;
background-color: var(--link-default);
pointer-events: none;

&--active {
transition: width 8s cubic-bezier(0.1, 0.5, 0.2, 1);
width: 100%;
}
}
1 change: 1 addition & 0 deletions assets/sass/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@
@import "dialog.scss";
@import "fip-validity.scss";
@import "404.scss";
@import "loadingBar.scss";
1 change: 1 addition & 0 deletions layouts/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
{{ partial "navigation.html" . }}
</nav>
</div>
<div class="o-loading-bar" aria-hidden="true"></div>
</div>
<main
id="content"
Expand Down
Loading