From ebd32923b95cb4d1b551343daf355fa98fc1a904 Mon Sep 17 00:00:00 2001 From: yiling Date: Wed, 27 May 2026 10:19:42 +0800 Subject: [PATCH] feat(ui): add breathing animation to upload icon --- src/ui/components/ui/icons.tsx | 48 ++++++++++++++++++++++----------- src/ui/components/user-menu.tsx | 12 ++++----- src/ui/globals.css | 13 +++++++++ 3 files changed, 52 insertions(+), 21 deletions(-) diff --git a/src/ui/components/ui/icons.tsx b/src/ui/components/ui/icons.tsx index 0d1df186..464eb822 100644 --- a/src/ui/components/ui/icons.tsx +++ b/src/ui/components/ui/icons.tsx @@ -177,28 +177,46 @@ export function UploadCloudIcon({ viewBox="15 15 70 70" width={30} height={30} - className={className} + className={`${className} ${uploading ? 'animate-upload-breathing' : ''}`} aria-hidden="true" focusable="false" + style={uploading ? { transformOrigin: 'center' } : undefined} {...props} > + {uploading && ( + + + + + + + + + + + + + + )} - {uploading && ( - - )} ) } diff --git a/src/ui/components/user-menu.tsx b/src/ui/components/user-menu.tsx index a93e36b5..efcaf384 100644 --- a/src/ui/components/user-menu.tsx +++ b/src/ui/components/user-menu.tsx @@ -1,12 +1,12 @@ import { client } from '@/ui/api/client' import { Avatar, AvatarFallback } from '@/ui/components/ui/avatar' import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuItem, - DropdownMenuLabel, - DropdownMenuSeparator, - DropdownMenuTrigger, + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuLabel, + DropdownMenuSeparator, + DropdownMenuTrigger, } from '@/ui/components/ui/dropdown-menu' import { useTeamId } from '@/ui/hooks/use-team-id' import { signOut } from '@/ui/lib/auth-client' diff --git a/src/ui/globals.css b/src/ui/globals.css index c1c950b6..d9ab40ca 100644 --- a/src/ui/globals.css +++ b/src/ui/globals.css @@ -98,6 +98,19 @@ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground); --color-sidebar-border: var(--sidebar-border); --color-sidebar-ring: var(--sidebar-ring); + + --animate-upload-breathing: upload-breathing 2s cubic-bezier(0.4, 0, 0.6, 1) infinite alternate; + + @keyframes upload-breathing { + 0% { + filter: drop-shadow(0 0 1px rgb(var(--primary))); + transform: scale(0.95); + } + 100% { + filter: drop-shadow(0 0 2px rgb(var(--primary))) drop-shadow(0 0 4px rgb(var(--primary))); + transform: scale(1.05); + } + } } @layer base {