From f6d98a97bc4332cddb37f9396ff518fe5b09c95c Mon Sep 17 00:00:00 2001 From: Robert Knight Date: Thu, 29 Apr 2021 08:31:51 +0100 Subject: [PATCH] Tweak the loading spinner animation - Wait for .5s before showing the spinner, to avoid an unnecessary flash if the content loads quickly - Fade the spinner in and out over 200ms to reduce the flicker effect - Change the class name from `js-loading-spinner` to a more generic `js-loading-indicator` in case we decide to change the indicator type in future (eg. from a spinner to a progress bar) --- via/templates/proxy.html.jinja2 | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/via/templates/proxy.html.jinja2 b/via/templates/proxy.html.jinja2 index fce1318d..b498dd59 100644 --- a/via/templates/proxy.html.jinja2 +++ b/via/templates/proxy.html.jinja2 @@ -68,6 +68,17 @@ transform: translate(-3px, -3px) rotate(359deg); } } + + .js-loading-indicator { + opacity: 0; + transition: opacity 0.2s; + } + .js-loading-indicator.is-loading { + opacity: 1.0; + } + .js-loading-indicator.is-done { + opacity: 0.0; + }