From 65f001b4b7dcf23ee80e137cfca64993a3da5318 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 2 Mar 2023 16:45:10 +0000 Subject: provide a fake progress bar for pwa standalone mode --- view/theme/redbasic/js/redbasic.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'view/theme') 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(){ + $('
').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'); -- cgit v1.2.3