From 8c7e0bc63a5b52d18d2dcc4276bf8920d55e344b Mon Sep 17 00:00:00 2001 From: szaimen Date: Wed, 30 Mar 2022 17:06:01 +0200 Subject: [PATCH] add before-unload animation Signed-off-by: szaimen --- php/public/automatic_reload.js | 4 ++++ php/public/before-unload.js | 3 +++ php/templates/containers.twig | 2 ++ 3 files changed, 9 insertions(+) create mode 100644 php/public/before-unload.js diff --git a/php/public/automatic_reload.js b/php/public/automatic_reload.js index 066a46c3..c8201c64 100644 --- a/php/public/automatic_reload.js +++ b/php/public/automatic_reload.js @@ -10,4 +10,8 @@ if (document.hasFocus()) { setTimeout(function(){ window.location.reload(1); }, 5000); +} else { + window.addEventListener("beforeunload", function() { + document.getElementById('overlay').classList.add('loading') + }); } \ No newline at end of file diff --git a/php/public/before-unload.js b/php/public/before-unload.js new file mode 100644 index 00000000..33c473bb --- /dev/null +++ b/php/public/before-unload.js @@ -0,0 +1,3 @@ +window.addEventListener("beforeunload", function() { + document.getElementById('overlay').classList.add('loading') +}); \ No newline at end of file diff --git a/php/templates/containers.twig b/php/templates/containers.twig index 3ca64948..9f189e52 100644 --- a/php/templates/containers.twig +++ b/php/templates/containers.twig @@ -406,6 +406,8 @@ {% if isApacheStarting == true or isBackupContainerRunning == true or isWatchtowerRunning == true %} + {% else %} + {% endif %}