diff --git a/client/index.html b/client/index.html index d4f7c83..6391821 100644 --- a/client/index.html +++ b/client/index.html @@ -2,7 +2,7 @@ - + 义工时长管理系统 diff --git a/client/src/components/Button.tsx b/client/src/components/Button.tsx index a90f06d..46f3522 100644 --- a/client/src/components/Button.tsx +++ b/client/src/components/Button.tsx @@ -1,19 +1,31 @@ import { ButtonHTMLAttributes, ReactNode } from 'react'; interface Props extends ButtonHTMLAttributes { - variant?: 'primary' | 'secondary' | 'danger' | 'ghost'; + variant?: 'primary' | 'secondary' | 'danger' | 'ghost' | 'amber'; size?: 'sm' | 'md' | 'lg'; children?: ReactNode; } export default function Button({ variant = 'primary', size = 'md', className = '', children, ...rest }: Props) { - const base = 'inline-flex items-center justify-center font-medium border-2 transition-colors disabled:opacity-50 disabled:cursor-not-allowed'; - const sizeCls = size === 'sm' ? 'px-3 py-1.5 text-sm' : size === 'lg' ? 'px-6 py-3 text-lg' : 'px-4 py-2 text-base'; + const base = + 'inline-flex items-center justify-center font-bold border-2 border-black transition-all duration-150 disabled:opacity-50 disabled:cursor-not-allowed active:translate-x-[2px] active:translate-y-[2px] active:shadow-none'; + const sizeCls = + size === 'sm' + ? 'px-3 py-1.5 text-sm shadow-sm' + : size === 'lg' + ? 'px-6 py-3 text-lg shadow' + : 'px-4 py-2 text-base shadow'; const variantCls = { - primary: 'bg-black text-white border-black hover:bg-gray-800 hover:border-gray-800', - secondary: 'bg-white text-black border-gray-300 hover:bg-gray-100 hover:border-gray-400', - danger: 'bg-red-500 text-white border-red-500 hover:bg-red-600 hover:border-red-600', - ghost: 'bg-transparent text-black border-transparent hover:bg-gray-100', + primary: + 'bg-blue-600 text-white hover:bg-blue-700 hover:border-blue-800 shadow', + secondary: + 'bg-white text-black hover:bg-gray-50 hover:border-gray-700 shadow-sm', + danger: + 'bg-red-500 text-white hover:bg-red-600 hover:border-red-700 shadow', + ghost: + 'bg-transparent text-black border-transparent hover:bg-gray-100 shadow-none active:translate-x-0 active:translate-y-0', + amber: + 'bg-amber-400 text-black hover:bg-amber-500 shadow-amber', }[variant]; return (