From c303df5bd6fdde04cce4bdd8e84a554d2c630461 Mon Sep 17 00:00:00 2001 From: aliamanuba Date: Thu, 2 May 2024 19:24:35 +0800 Subject: Added Preload for Web - Bluesky logo in the center when a new visitor or shift+refresh by browser client --- src/App.web.tsx | 10 ++++++++-- web/index.html | 13 +++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/App.web.tsx b/src/App.web.tsx index bc9cd01f1..661cac72c 100644 --- a/src/App.web.tsx +++ b/src/App.web.tsx @@ -86,9 +86,15 @@ function InnerApp() { function App() { const [isReady, setReady] = useState(false) - + React.useEffect(() => { - initPersistedState().then(() => setReady(true)) + initPersistedState().then(() => { + setReady(true) + + const preloadElement = document.getElementById('preload'); + preloadElement.remove(); + }) + }, []) if (!isReady) { diff --git a/web/index.html b/web/index.html index b059e69e9..11d5b966e 100644 --- a/web/index.html +++ b/web/index.html @@ -51,6 +51,14 @@ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Liberation Sans", Helvetica, Arial, sans-serif; } + #preload { + width: 100px; + position: fixed; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + } + /* Buttons and inputs have a font set by UA, so we'll have to reset that */ button, input, textarea { font: inherit; @@ -301,6 +309,11 @@ +
+ + +
+
-- cgit 1.4.1