From 657256a099a601a0694d11d15c42ad76988efe8c Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Wed, 29 Jun 2022 12:34:37 +0200 Subject: [PATCH] Revert "DEV: Use `performance.timing` as a baseline for the splash (#17275)" (#17276) This reverts commit 6146da5eb71da2942fa3da9dfdd8a5cc5f3734d9. --- app/assets/javascripts/discourse/app/app.js | 9 +++ app/views/common/_discourse_splash.html.erb | 74 +++------------------ public/images/preloader.svg | 29 ++++---- 3 files changed, 31 insertions(+), 81 deletions(-) diff --git a/app/assets/javascripts/discourse/app/app.js b/app/assets/javascripts/discourse/app/app.js index 19da3d28362..be305596c42 100644 --- a/app/assets/javascripts/discourse/app/app.js +++ b/app/assets/javascripts/discourse/app/app.js @@ -81,6 +81,15 @@ const Discourse = Application.extend({ initialize: () => withPluginApi(cb.version, cb.code), }); }); + + window.addEventListener( + "load", + () => { + // The app booted. Remove the splash screen + document.querySelector("#d-splash")?.remove(); + }, + { once: true } + ); }, _registerPluginCode(version, code) { diff --git a/app/views/common/_discourse_splash.html.erb b/app/views/common/_discourse_splash.html.erb index 25f5a9dcd3e..08b92b65f53 100644 --- a/app/views/common/_discourse_splash.html.erb +++ b/app/views/common/_discourse_splash.html.erb @@ -9,14 +9,13 @@ display: grid; place-items: center; backface-visibility: hidden; - background: var(--secondary); position: absolute; left: 0; top: 0; height: 100%; width: 100%; - z-index: 1001; - --animation-state: paused; + z-index: 1001; /* above the header */ + background: var(--secondary); } #d-splash .preloader-image { @@ -26,26 +25,22 @@ #d-splash .preloader-text { padding-top: 4em; - position: absolute; - opacity: 0; - animation: fade-in 0.5s ease-in-out; - animation-delay: 1s; - animation-fill-mode: forwards; - animation-play-state: var(--animation-state); - color: var(--primary); + position: absolute; + opacity: 0; + animation: fade-in 0.5s ease-in-out; + animation-delay: 2.5s; + animation-fill-mode: forwards; + color: var(--primary); } #d-splash .preloader-text:after { animation: loading-text 3s infinite; content: ""; position: absolute; - top: 4em; margin: 0 0.1em; - left: 100%; } .rtl #d-splash .preloader-text:after { - left: 0; right: 100%; } @@ -76,7 +71,7 @@ <%=SiteSetting.title%> @@ -95,56 +90,5 @@ } - - <%- end %> diff --git a/public/images/preloader.svg b/public/images/preloader.svg index b2319c1b2fb..b4101b4d679 100644 --- a/public/images/preloader.svg +++ b/public/images/preloader.svg @@ -1,9 +1,6 @@ - + - - - - - + + + + +