Files
2026-11-12 06:29:38 +08:00

2 lines
3.3 KiB
JavaScript

import{R as c,j as t,r as b}from"./react-vendor-jWT2yUdV.js";import{a as T}from"./chunk-5PILOUBS-KHYNqMZE.js";import{c as l,a as W,$ as z}from"./index-DiaaLdUu.js";import{u as _}from"./chunk-EN4B57RQ-Ief8qCCd.js";import{M as B,S as F,G}from"./icons-C0t6aNgu.js";import{l as Q}from"./chunk-OPTZHMJX-CY9g90YL.js";import{t as A}from"./chunk-6LIX6LVT-B246pOuK.js";const Z=o=>{const{children:r,maxXRotation:n=5,maxYRotation:u=5,className:p,style:d,lightClassName:f,lightStyle:s}=o,e=c.useRef(null),a=c.useRef(null),[x,i]=c.useState(!1),[h,S]=c.useState({left:0,top:0});return t.jsxs(T,{...o,ref:e,className:l("relative overflow-hidden bg-opacity-50 backdrop-blur-lg",p),style:{willChange:"transform",transform:"perspective(1000px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)",...d},onMouseEnter:()=>{e.current&&(e.current.style.transition="transform 0.3s ease-out")},onMouseLeave:()=>{i(!1),e.current&&(e.current.style.transition="transform 0.5s",e.current.style.transform="perspective(1000px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)")},onMouseMove:R=>{var m,g;if(e.current){i(!0);const{x:I,y:C}=e.current.getBoundingClientRect(),{clientX:M,clientY:X}=R,j=M-I,w=X-C,Y=((m=s==null?void 0:s.width)==null?void 0:m.toString())||"100",E=((g=s==null?void 0:s.height)==null?void 0:g.toString())||"100",L=parseInt(Y),N=parseInt(E),P=j-L/2,$=w-N/2;S({left:P,top:$}),e.current.style.transition="transform 0.1s";const v=400/2,y=400/2,k=(w-y)/y*n,H=-1*((j-v)/v)*u;e.current.style.transform=`perspective(1000px) rotateX(${k}deg) rotateY(${H}deg)`}},children:[t.jsx("div",{ref:a,className:l(x?"opacity-100":"opacity-0","absolute rounded-full blur-[100px] filter transition-opacity duration-300 bg-gradient-to-r from-primary-400 to-secondary-400 w-[150px] h-[150px]",f),style:{...h}}),r]})},tt=({className:o,classNames:r})=>{const[n,u]=b.useState(!1),{theme:p,toggleTheme:d}=W(),f=d,{Component:s,slots:e,isSelected:a,getBaseProps:x,getInputProps:i,getWrapperProps:h}=_({isSelected:p==="light",onChange:f});return b.useEffect(()=>{u(!0)},[n]),n?t.jsxs(s,{"aria-label":a?"Switch to dark mode":"Switch to light mode",...x({className:l("px-px transition-opacity hover:opacity-80 cursor-pointer",o,r==null?void 0:r.base)}),children:[t.jsx(z,{children:t.jsx("input",{...i()})}),t.jsx("div",{...h(),className:e.wrapper({class:l(["w-auto h-auto","bg-transparent","rounded-lg","flex items-center justify-center","group-data-[selected=true]:bg-transparent","!text-default-500","pt-px","px-0","mx-0"],r==null?void 0:r.wrapper)}),children:a?t.jsx(B,{size:22}):t.jsx(F,{size:22})})]}):t.jsx("div",{className:"w-6 h-6"})};function et({children:o}){return t.jsxs("div",{className:"relative flex flex-col h-screen",children:[t.jsx("div",{className:"absolute right-0 top-0 p-3 z-10",children:t.jsx(A,{content:"查看 WebUI 源码",placement:"left",showArrow:!0,children:t.jsx(Q,{isExternal:!0,href:"https://github.com/DandanLLab/SnowCatQQ",children:t.jsx(G,{className:"text-default-400 hover:text-primary w-7 h-7 transition-all hover:-translate-y-0.5"})})})}),t.jsx("main",{className:"flex-grow w-full flex flex-col justify-center items-center px-3",children:o}),t.jsx("div",{className:"absolute bottom-0 inset-x-0 pb-4 text-center pointer-events-none",children:t.jsx("span",{className:"text-[10px] tracking-[0.3em] uppercase text-default-300 dark:text-default-600",children:"SnowCat · 雪猫控制台"})})]})}export{Z as H,et as P,tt as T};