Skip to content

Commit

Permalink
feat: preloader
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Thulin committed Jan 9, 2024
1 parent 0a47cc8 commit b868e0e
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
21 changes: 21 additions & 0 deletions assets/css/animations.css
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,24 @@
opacity: 1;
}
}


/* HTML: <div class="loader"></div> */
.loader {
width: 50px;
margin-top: -25px;
margin-left: -25px;
aspect-ratio: 1;
border-radius: 50%;
border: 8px solid;
border-color: #00000047 #0000;
animation: l1 1s infinite;
top: 50%;
left: 50%;
position: absolute;
background: #eee;
outline: 5000px solid #eee;
z-index: 9999;
outline-offset: -1px;
}
@keyframes l1 {to{transform: rotate(.5turn)}}
6 changes: 6 additions & 0 deletions assets/js/FormNavigationManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ class FormNavigationManager {
FormNavigationStepChange.setupStepChange(formsApi);
FormNavigationSubmitted.setupSubmitted(formsApi);
FormNavigationButtons.setupCancelAndCloseButtons();

formsApi.onReady(function() {
setTimeout(function() {
document.querySelector(".loader").remove();
}, 1000);
});
}
}

Expand Down
2 changes: 1 addition & 1 deletion dist/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<link rel="stylesheet" type="text/css" href="assets/css/animations.css" media="all">
</head>
<body>
<div class="loader"></div>
<div id="app">

<div id="header" class="hidden-app">
<div id="app-banner" class="c-notice u-display--none" aria-hidden="true">
<span class="c-notice__text">
Expand Down

0 comments on commit b868e0e

Please sign in to comment.