feat(ui): add breathing animation to upload icon

This commit is contained in:
yiling
2026-05-27 10:19:42 +08:00
parent 331899f0e4
commit ebd32923b9
3 changed files with 52 additions and 21 deletions
+33 -15
View File
@@ -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 && (
<defs>
<linearGradient id="upload-gradient" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stopColor="#3b82f6">
<animate
attributeName="stop-color"
values="#3b82f6;#ec4899;#8b5cf6;#3b82f6"
dur="3s"
repeatCount="indefinite"
/>
</stop>
<stop offset="50%" stopColor="#8b5cf6">
<animate
attributeName="stop-color"
values="#8b5cf6;#3b82f6;#ec4899;#8b5cf6"
dur="3s"
repeatCount="indefinite"
/>
</stop>
<stop offset="100%" stopColor="#ec4899">
<animate
attributeName="stop-color"
values="#ec4899;#8b5cf6;#3b82f6;#ec4899"
dur="3s"
repeatCount="indefinite"
/>
</stop>
</linearGradient>
</defs>
)}
<path
d="M 44.1 75 H 30 A 15 15 0 0 1 30 45 A 20 20 0 0 1 70 45 A 15 15 0 0 1 70 75 H 55.9 V 60.2 H 61.9 L 50 45.3 L 38.1 60.2 H 44.1 Z"
fill="currentColor"
fill={uploading ? 'url(#upload-gradient)' : 'currentColor'}
/>
{uploading && (
<circle
cx="50"
cy="50"
r="48"
stroke="currentColor"
strokeWidth="2"
strokeDasharray="10 20"
fill="none"
className="animate-spin"
style={{ transformOrigin: 'center' }}
/>
)}
</svg>
)
}
+6 -6
View File
@@ -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'
+13
View File
@@ -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 {