diff options
author | Mario <mario@mariovavti.com> | 2023-03-02 16:45:10 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2023-03-02 16:45:10 +0000 |
commit | 65f001b4b7dcf23ee80e137cfca64993a3da5318 (patch) | |
tree | 2a5c739bf8c06297c64776a0f83374f17b288c56 /view/theme/redbasic | |
parent | d81473487f8ef9b22aaa37b0da80265af5e72bc1 (diff) | |
download | volse-hubzilla-65f001b4b7dcf23ee80e137cfca64993a3da5318.tar.gz volse-hubzilla-65f001b4b7dcf23ee80e137cfca64993a3da5318.tar.bz2 volse-hubzilla-65f001b4b7dcf23ee80e137cfca64993a3da5318.zip |
provide a fake progress bar for pwa standalone mode
Diffstat (limited to 'view/theme/redbasic')
-rw-r--r-- | view/theme/redbasic/js/redbasic.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/view/theme/redbasic/js/redbasic.js b/view/theme/redbasic/js/redbasic.js index b7036262d..b502ad333 100644 --- a/view/theme/redbasic/js/redbasic.js +++ b/view/theme/redbasic/js/redbasic.js @@ -13,11 +13,29 @@ if (redbasic_dark_mode == 0) { } + + + if (redbasic_theme_color) { $('meta[name=theme-color]').attr('content', redbasic_theme_color); } + + $(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 (redbasic_dark_mode == 1) { $('#theme-switch-icon').removeClass('fa-moon-o').addClass('fa-sun-o'); |