dev-prepare #2
@@ -2,18 +2,28 @@
|
|||||||
|
|
||||||
import Nav from "@/components/window/Nav"
|
import Nav from "@/components/window/Nav"
|
||||||
import { Prepare } from "@/components/cstb/Prepare"
|
import { Prepare } from "@/components/cstb/Prepare"
|
||||||
|
import { motion, AnimatePresence } from "framer-motion"
|
||||||
|
|
||||||
const Home = () => {
|
const Home = () => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Nav />
|
<Nav />
|
||||||
<main className="flex flex-col items-center justify-center w-full h-screen gap-6" data-tauri-drag-region>
|
<main className="flex flex-col justify-center w-full h-screen overflow-hidden" data-tauri-drag-region>
|
||||||
<h1 className="text-4xl font-bold tracking-wide">CS 工具箱</h1>
|
<AnimatePresence>
|
||||||
<Prepare />
|
<motion.div
|
||||||
|
initial={{ opacity: 0, y: 30 }}
|
||||||
|
animate={{ opacity: 1, y: 0 }}
|
||||||
|
exit={{ opacity: 0, y: -30 }}
|
||||||
|
transition={{ duration: 0.5 }}
|
||||||
|
className="flex flex-col items-center justify-center gap-6 "
|
||||||
|
>
|
||||||
|
<h1 className="text-4xl font-bold tracking-wide">CS 工具箱</h1>
|
||||||
|
<Prepare />
|
||||||
|
</motion.div>
|
||||||
|
</AnimatePresence>
|
||||||
</main>
|
</main>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Home
|
export default Home
|
||||||
|
|||||||
@@ -45,13 +45,14 @@ export function Prepare() {
|
|||||||
setInited(steam.state.steamDirValid && steam.state.cs2DirValid)
|
setInited(steam.state.steamDirValid && steam.state.cs2DirValid)
|
||||||
// 逻辑有点问题,第一次启动时检查成功直接跳转,第一次检查失败不跳转,用户手动点击
|
// 逻辑有点问题,第一次启动时检查成功直接跳转,第一次检查失败不跳转,用户手动点击
|
||||||
if (allCheckPassed) {
|
if (allCheckPassed) {
|
||||||
router.push("/home")
|
setTimeout(() => {
|
||||||
return
|
router.push("/home")
|
||||||
|
}, 500)
|
||||||
|
} else {
|
||||||
|
setTimeout(() => {
|
||||||
|
setLoading(false)
|
||||||
|
}, 800)
|
||||||
}
|
}
|
||||||
|
|
||||||
setTimeout(() => {
|
|
||||||
setLoading(false)
|
|
||||||
}, 300)
|
|
||||||
}
|
}
|
||||||
initValues()
|
initValues()
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user