first commit

This commit is contained in:
shenjianZ committed 2025-05-24 22:25:49 +08:00
commit bcdeef8892
150 files changed
+9734

No files matched your search

@@ -0,0 +1 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[662],{2608:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>n});var a=s(5155),r=s(2115),l=s(5060);function n(){let[e,t]=(0,r.useState)(!1),[s,n]=(0,r.useState)(0),[d,i]=(0,r.useState)("用户"),[c,o]=(0,r.useState)(!1),[m,x]=(0,r.useState)(""),[h,g]=(0,r.useState)(!1),[u,j]=(0,r.useState)(!0);(0,r.useEffect)(()=>{let e=localStorage.getItem("theme"),s=window.matchMedia("(prefers-color-scheme: dark)").matches;"light"===e?(t(!1),document.documentElement.classList.remove("dark")):"dark"===e?(t(!0),document.documentElement.classList.add("dark")):(t(s),s?(document.documentElement.classList.add("dark"),localStorage.setItem("theme","dark")):(document.documentElement.classList.remove("dark"),localStorage.setItem("theme","light")));let a=localStorage.getItem("currentApiIndex");a&&n(parseInt(a,10));let r=localStorage.getItem("username");r&&i(r);let l=localStorage.getItem("playInNewTab");null!==l&&j("true"===l)},[]);let k=e=>{n(e),localStorage.setItem("currentApiIndex",e.toString())};return(0,a.jsxs)("div",{className:"flex h-full",children:[(0,a.jsx)(l.A,{darkMode:e,username:d,isOpen:h,onToggle:()=>g(!h)}),(0,a.jsxs)("div",{className:"flex-1 md:ml-64 bg-white dark:bg-black min-h-screen text-black dark:text-white transition-all duration-300 ".concat(h?"md:translate-x-0":"translate-x-0"),children:[(0,a.jsx)("nav",{className:"border-b border-gray-100 dark:border-gray-800",children:(0,a.jsxs)("div",{className:"max-w-5xl mx-auto px-4 py-4 flex items-center",children:[(0,a.jsx)("button",{className:"md:hidden mr-4 text-gray-600 dark:text-gray-400",onClick:()=>g(!h),"aria-label":"打开菜单",children:(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-6 h-6",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"})})}),(0,a.jsx)("h1",{className:"text-xl font-medium",children:"设置"})]})}),(0,a.jsx)("main",{className:"max-w-5xl mx-auto px-4 py-8",children:(0,a.jsxs)("div",{className:"space-y-8",children:[(0,a.jsxs)("section",{children:[(0,a.jsx)("h2",{className:"text-lg font-medium mb-4",children:"个人信息"}),(0,a.jsx)("div",{className:"bg-gray-50 dark:bg-gray-900 rounded-lg p-4",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"用户名"}),(0,a.jsx)("p",{className:"text-sm text-gray-500 dark:text-gray-400 mt-1",children:"修改您的显示名称"})]}),c?(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"text",value:m,onChange:e=>x(e.target.value),className:"px-2 py-1 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-800 text-black dark:text-white",maxLength:20}),(0,a.jsx)("button",{onClick:()=>{m.trim()&&(i(m.trim()),localStorage.setItem("username",m.trim())),o(!1)},className:"p-1 text-green-600 dark:text-green-400",title:"保存",children:(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-5 h-5",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})})}),(0,a.jsx)("button",{onClick:()=>{o(!1)},className:"p-1 text-red-600 dark:text-red-400",title:"取消",children:(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-5 h-5",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}):(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:d}),(0,a.jsx)("button",{onClick:()=>{x(d),o(!0)},className:"p-1 text-gray-600 dark:text-gray-400 hover:text-black dark:hover:text-white",title:"编辑",children:(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-5 h-5",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10"})})})]})]})})]}),(0,a.jsxs)("section",{children:[(0,a.jsx)("h2",{className:"text-lg font-medium mb-4",children:"外观"}),(0,a.jsx)("div",{className:"bg-gray-50 dark:bg-gray-900 rounded-lg p-4",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"暗色模式"}),(0,a.jsx)("p",{className:"text-sm text-gray-500 dark:text-gray-400 mt-1",children:"切换界面暗色/亮色模式"})]}),(0,a.jsx)("button",{onClick:()=>{t(!e),e?(document.documentElement.classList.remove("dark"),lLine truncated