From 2c8f9abc636374bcc15909e3707df4ef7542c959 Mon Sep 17 00:00:00 2001
From: Purp1e <47248616+Purple-CSGO@users.noreply.github.com>
Date: Fri, 21 Mar 2025 03:13:19 +0800
Subject: [PATCH] [feat] add init animation
---
src/app/page.tsx | 20 +++++++++++++++-----
src/components/cstb/Prepare.tsx | 13 +++++++------
2 files changed, 22 insertions(+), 11 deletions(-)
diff --git a/src/app/page.tsx b/src/app/page.tsx
index 72073f5..b27da4a 100644
--- a/src/app/page.tsx
+++ b/src/app/page.tsx
@@ -2,18 +2,28 @@
import Nav from "@/components/window/Nav"
import { Prepare } from "@/components/cstb/Prepare"
+import { motion, AnimatePresence } from "framer-motion"
const Home = () => {
-
return (
<>
-
- CS 工具箱
-
+
+
+
+ CS 工具箱
+
+
+
>
)
}
-export default Home
\ No newline at end of file
+export default Home
diff --git a/src/components/cstb/Prepare.tsx b/src/components/cstb/Prepare.tsx
index 641d634..dbea3a2 100644
--- a/src/components/cstb/Prepare.tsx
+++ b/src/components/cstb/Prepare.tsx
@@ -45,13 +45,14 @@ export function Prepare() {
setInited(steam.state.steamDirValid && steam.state.cs2DirValid)
// 逻辑有点问题,第一次启动时检查成功直接跳转,第一次检查失败不跳转,用户手动点击
if (allCheckPassed) {
- router.push("/home")
- return
+ setTimeout(() => {
+ router.push("/home")
+ }, 500)
+ } else {
+ setTimeout(() => {
+ setLoading(false)
+ }, 800)
}
-
- setTimeout(() => {
- setLoading(false)
- }, 300)
}
initValues()
})