update dep + preference styles setup

This commit is contained in:
Purp1e
2024-10-28 10:42:42 +08:00
parent c0c34180ae
commit 3d027ec05f
13 changed files with 1737 additions and 1160 deletions

View File

@@ -1,12 +1,16 @@
"use client"
import useAppStore from "@/store/app"
export default function Page () {
const { version } = useAppStore()
export default function Page() {
const app = useAppStore()
return (
<div className="flex flex-col items-start gap-3">
<button>{version}</button>
<div className="flex flex-col items-start gap-3 pt-2 pb-1">
<p>{app.version}</p>
<p>{app.hasUpdate ? "有" : "无"}</p>
<p>{app.inited ? "是" : "否"}</p>
<p>{app.notice}</p>
<p>使{app.useMirror ? "是" : "否"}</p>
</div>
)
}
}

View File

@@ -1,23 +1,38 @@
"use client"
import { Card, CardHeader, CardIcon, CardTool, CardBody } from "@/components/window/Card"
import { ToolButton } from "@/components/window/ToolButton"
import { SettingConfig, UploadOne, HardDisk } from "@icon-park/react"
import { useRouter } from "next/navigation"
import { SettingConfig, UploadOne, HardDisk, AssemblyLine, Videocamera } from "@icon-park/react"
import clsx from "clsx"
import { usePathname, useRouter } from "next/navigation"
// import { platform } from "@tauri-apps/plugin-os"
export default function PreferenceLayout({ children }: { children: React.ReactNode }) {
const router = useRouter()
const pathname = usePathname()
return (
<Card className="max-w-full overflow-y-scroll">
<CardHeader>
<CardIcon onClick={() => router.push("/preference/general")}>
<CardIcon
type="menu"
onClick={() => router.push("/preference/general")}
className={clsx(pathname === "/preference/general" && "bg-white/60")}
>
<SettingConfig />
</CardIcon>
<CardIcon onClick={() => router.push("/preference/path")}>
<SettingConfig />
<CardIcon
type="menu"
onClick={() => router.push("/preference/path")}
className={clsx(pathname === "/preference/path" && "bg-white/60")}
>
<AssemblyLine />
</CardIcon>
<CardIcon onClick={() => router.push("/preference/replay")}>
<SettingConfig />
<CardIcon
type="menu"
onClick={() => router.push("/preference/replay")}
className={clsx(pathname === "/preference/replay" && "bg-white/60")}
>
<Videocamera />
</CardIcon>
<CardTool>

View File

@@ -1,4 +1,16 @@
"use client"
import SteamStore from "@/store/steam"
export default function Page() {
return <>Path</>
const steam = SteamStore()
return (
<div className="flex flex-col items-start gap-3 pt-2 pb-1">
<p>Steam路径{steam.dir}</p>
<p>{steam.csDir}</p>
<p>Steam路径有效{steam.isDirValid ? "是" : "否"}</p>
<p>{steam.isCsDirValid ? "是" : "否"}</p>
<p>Steam账号{steam.currentUser().accountName}</p>
</div>
)
}

View File

@@ -11,7 +11,7 @@ body {
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu,
Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
/* background: transparent; */
background: rgba(242, 241, 243, 0.3);
background: rgba(242, 241, 243, 0.5);
border-radius: 10px;
}

View File

@@ -1,8 +1,10 @@
import { ReactNode } from "react"
import clsx from "clsx"
interface CardProps {
children?: ReactNode
className?: string
type?: string
onClick?: () => void
}
@@ -18,12 +20,12 @@ const Card = ({ children }: CardProps) => {
}
const CardHeader = ({ children }: CardProps) => {
return <div className="flex items-center gap-2.5 tracking-wide">{children}</div>
return <div className="flex items-center gap-1.5 tracking-wide">{children}</div>
}
const CardIcon = ({ children, ...rest }: CardProps) => {
const CardIcon = ({ children, type, className, ...rest }: CardProps) => {
return (
<div className="flex gap-1.5 items-center font-semibold" {...rest}>
<div className={clsx("flex gap-1.5 items-center font-semibold", type === "menu" && "transition cursor-pointer hover:bg-white/60 px-2 py-1 rounded-md active:scale-95", className)} {...rest}>
{children}
</div>
)

View File

@@ -3,7 +3,7 @@ import { RocketOne, Minus, Close, Square } from "@icon-park/react"
import { /* relaunch, */ exit } from "@tauri-apps/plugin-process"
import { getCurrentWindow } from "@tauri-apps/api/window"
// import { platform } from "@tauri-apps/plugin-os"
import { useRouter } from "next/navigation"
import { useRouter, usePathname } from "next/navigation"
const Nav = () => {
const close = async () => {
@@ -32,12 +32,13 @@ const Nav = () => {
// await relaunch()
// }
const router = useRouter()
const pathname = usePathname()
return (
<nav className="absolute top-0 right-0 flex flex-row h-16 gap-0.5 p-4" data-tauri-drag-region>
<button
className="px-2 py-0 transition rounded hover:bg-zinc-200/80 active:scale-95"
onClick={() => router.push("/prepare")}
onClick={() => pathname !== "/prepare" ? router.push("/prepare") : router.back()}
>
<RocketOne size={16} />
</button>