From 20d663d8cf540939df4a570e0e4b857206cf53c7 Mon Sep 17 00:00:00 2001 From: Haoyu Xu Date: Fri, 13 Oct 2023 22:47:17 -0400 Subject: [PATCH] feat(directory): added a loader before dom is loaded --- directory/index.html | 88 ++++++++++++++++++++++++++++++----- directory/src/routes/Root.jsx | 8 ++++ 2 files changed, 84 insertions(+), 12 deletions(-) diff --git a/directory/index.html b/directory/index.html index fcf2089..34f576c 100644 --- a/directory/index.html +++ b/directory/index.html @@ -1,14 +1,78 @@ - - - - aklive2d directory - - - -
- - - + + + + + aklive2d directory + + + + + +
+
+ +
+ + + + \ No newline at end of file diff --git a/directory/src/routes/Root.jsx b/directory/src/routes/Root.jsx index e5ac65f..39a8d80 100644 --- a/directory/src/routes/Root.jsx +++ b/directory/src/routes/Root.jsx @@ -75,6 +75,14 @@ export default function Root() { fetchOfficalUpdate() }, [fetchOfficalUpdate]) + useEffect(() => { + document.querySelector('.loader').classList.add('loaded') + setTimeout(() => { + document.querySelector('.loader').style.display = 'none' + }, 500) + } + , []) + return ( <>