diff --git a/app/views/common/_discourse_splash.html.erb b/app/views/common/_discourse_splash.html.erb index 6c6dd1ad94b..8ec585593f1 100644 --- a/app/views/common/_discourse_splash.html.erb +++ b/app/views/common/_discourse_splash.html.erb @@ -1,5 +1,116 @@ <%- unless customization_disabled? %>
+ + <%=SiteSetting.title%> @@ -98,10 +218,19 @@ const DELAY_TARGET = 2000; const POLLING_INTERVAL = 50; + const splashSvgTemplate = document.querySelector(".splash-svg-template"); + const splashTemplateClone = splashSvgTemplate.content.cloneNode(true); + const svgElement = splashTemplateClone.querySelector("svg"); + + const svgString = new XMLSerializer().serializeToString(svgElement); + const encodedSvg = btoa(svgString); + const splashWrapper = document.querySelector("#d-splash"); const splashImage = splashWrapper?.querySelector(".preloader-image"); if (splashImage) { + splashImage.src = `data:image/svg+xml;base64,${encodedSvg}`; + const connectStart = performance?.timing?.connectStart || 0; const splashDelay = connectStart ? DELAY_TARGET : 0; const targetTime = connectStart + DELAY_TARGET; @@ -111,11 +240,12 @@ const swapSplash = () => { splashWrapper?.style.setProperty("--animation-state", "running"); + svgElement?.style.setProperty("--animation-state", "running"); - splashImage.src = splashImage.src.replace( - "--animation-state: paused;", - "--animation-state: running;" - ); + const newSvgString = new XMLSerializer().serializeToString(svgElement); + const newEncodedSvg = btoa(newSvgString); + + splashImage.src = `data:image/svg+xml;base64,${newEncodedSvg}`; performance.mark("discourse-splash-visible"); diff --git a/public/images/preloader.svg b/public/images/preloader.svg deleted file mode 100644 index b2319c1b2fb..00000000000 --- a/public/images/preloader.svg +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - -