[chore] update styles and remove path select tests at launch page

This commit is contained in:
Purp1e
2025-03-13 17:53:02 +08:00
parent b77cf75010
commit 9a87b24a14
5 changed files with 364 additions and 32 deletions

View File

@@ -11,6 +11,7 @@ body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
border-radius: 10px;
background: transparent;
}
a {

View File

@@ -15,7 +15,7 @@ export default function RootLayout({
}) {
return (
<html lang="en">
<body className="bg-[rgba(242, 241, 243, 0.65)] dark:bg-zinc-900">
<body className="bg-zinc-100 dark:bg-zinc-900">
<Providers>{children}</Providers>
</body>
</html>

View File

@@ -1,44 +1,46 @@
"use client"
import { open } from "@tauri-apps/plugin-dialog"
import { Button } from "@heroui/react"
// import { open } from "@tauri-apps/plugin-dialog"
import { useRouter } from "next/navigation"
import React from "react"
const Home = () => {
const router = useRouter()
const [file, setFile] = React.useState<string | null>("")
// const [file, setFile] = React.useState<string | null>("")
const openFile = async () => {
const filePath = await open({
multiple: true,
directory: false,
})
// const openFile = async () => {
// const filePath = await open({
// multiple: true,
// directory: false,
// })
setFile(filePath?.join("\n") || " ")
}
// setFile(filePath?.join("\n") || " ")
// }
return (
<main
className="flex flex-col items-center justify-center w-full h-screen gap-6"
data-tauri-drag-region
>
<h1 className="text-4xl font-bold tracking-wide text-zinc-800">
<h1 className="text-4xl font-bold tracking-wide">
CS
</h1>
<button
type="button"
onClick={() => router.push("/home")}
className="px-4 py-1 rounded bg-zinc-200"
<Button
onPress={() => router.push("/home")}
variant="solid"
color="primary"
size="sm"
>
</button>
<button
</Button>
{/* <button
type="button"
onClick={openFile}
className="px-4 py-1 text-white bg-blue-500 rounded"
>
选择文件
</button>
<p className="text-center bg-zinc-50">{file}</p>
<p className="text-center bg-zinc-50">{file}</p> */}
</main>
)
}

View File

@@ -5,11 +5,15 @@ interface RoundedButtonProps {
children?: React.ReactNode
}
const RoundedButton = ({ children }: RoundedButtonProps) => {
const RoundedButton = ({
children,
...props
}: RoundedButtonProps & React.ButtonHTMLAttributes<HTMLButtonElement>) => {
return (
<button
type="button"
className="flex items-center justify-center px-3 py-1 transition rounded-full select-none min-w-fit active:scale-95 hover:bg-black/10 text-zinc-700 dark:text-zinc-100 bg-black/5"
{...props}
>
{children}
</button>
@@ -26,13 +30,13 @@ const CommonDir = () => {
</CardHeader>
<CardBody>
<div className="flex gap-1.5">
<RoundedButton>Steam安装位置</RoundedButton>
<RoundedButton>CS2游戏目录</RoundedButton>
<RoundedButton></RoundedButton>
<RoundedButton>CFG目录</RoundedButton>
<RoundedButton>CFG目录</RoundedButton>
<RoundedButton></RoundedButton>
<RoundedButton>5E平台录像</RoundedButton>
<RoundedButton onClick={()=> {alert("hello")}}>Steam安装位置</RoundedButton>
<RoundedButton onClick={()=> {}}>CS2游戏目录</RoundedButton>
<RoundedButton onClick={()=> {}}></RoundedButton>
<RoundedButton onClick={()=> {}}>CFG目录</RoundedButton>
<RoundedButton onClick={()=> {}}>CFG目录</RoundedButton>
<RoundedButton onClick={()=> {}}></RoundedButton>
<RoundedButton onClick={()=> {}}>5E平台录像</RoundedButton>
</div>
</CardBody>
</Card>