simplify pageloader animation

This commit is contained in:
Mario
2023-03-04 17:03:37 +00:00
parent dc6075aa3f
commit 9f10e7e356
3 changed files with 22 additions and 9 deletions

View File

@@ -1717,3 +1717,20 @@ dl.bb-dl > dd > li {
.disable-transition {
transition: none !important;
}
.page-loader {
z-index: 10000;
width: 20vw;
height: 3px;
position: absolute;
animation: pageloader_move 2s ease-out infinite;
}
@keyframes pageloader_move {
0% {
transform: translateX(0px);
}
50% {
transform: translateX(80vw);
}
}

View File

@@ -26,14 +26,10 @@ $(document).ready(function() {
// provide a fake progress bar for pwa standalone mode
if (window.matchMedia('(display-mode: standalone)').matches) {
$(window).on('beforeunload', function(){
$('<div style="position:fixed; z-index:10000; height:2px;" class="bg-primary page-loader"></div>').prependTo('body');
let w = 10;
setInterval(function () {
$('.page-loader').css('width', w + 'vw');
if (w < 90) {
w = w+2;
}
}, 10);
if ($('.page-loader').length) {
return;
}
$('<div class="bg-primary page-loader"></div>').prependTo('body');
});
}