Ezmary commited on
Commit
3c7ed54
·
verified ·
1 Parent(s): 142b779

Delete src/components/logo-animation/LogoAnimation.tsx

Browse files
src/components/logo-animation/LogoAnimation.tsx DELETED
@@ -1,106 +0,0 @@
1
- // src/components/logo-animation/LogoAnimation.tsx
2
- import React from 'react';
3
- import cn from 'classnames';
4
-
5
- // آیکون انسان
6
- const SvgHumanIcon = () => (
7
- <svg width="100%" height="100%" viewBox="0 0 88 89" fill="none" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid meet">
8
- <path d="M75.1481 81.6361H12.9259C9.66667 81.6361 7 78.9721 7 75.7161V58.5112C7 57.5862 7 57.1052 7.44444 56.2172C8.85185 52.9612 13 50.2232 19.4815 47.8922C24.1111 56.6982 33.3704 62.6921 44 62.6921C54.6296 62.6921 63.9259 56.6982 68.5185 47.8922C75 50.1862 79.1852 52.9982 80.5556 56.2172C81 56.6612 81 57.6232 81 58.5112V75.7161C81 78.9721 78.3333 81.6361 75.0741 81.6361H75.1481Z" stroke="#FFFFFF" strokeWidth="6.42146" strokeLinecap="round" strokeLinejoin="round"/>
9
- <path d="M44.0371 50.1862C33.8519 50.1862 25.5186 41.8612 25.5186 31.6863V26.1363C25.5186 15.9613 33.8519 7.63635 44.0371 7.63635C54.2223 7.63635 62.5556 15.9613 62.5556 26.1363V31.6863C62.5556 41.8612 54.2223 50.1862 44.0371 50.1862Z" stroke="#FFFFFF" strokeWidth="6.42146" strokeLinecap="round" strokeLinejoin="round"/>
10
- </svg>
11
- );
12
-
13
- // *** تعریف logoColorConfig باید در همین فایل و قبل از استفاده باشد ***
14
- const logoColorConfig = {
15
- blue: {
16
- ping: "bg-blue-200 dark:bg-blue-700",
17
- ring1: "bg-blue-200 dark:bg-blue-700",
18
- ring2: "bg-blue-300 dark:bg-blue-600",
19
- ring3: "bg-blue-400 dark:bg-blue-500",
20
- },
21
- green: {
22
- ping: "bg-green-200 dark:bg-green-700",
23
- ring1: "bg-green-200 dark:bg-green-700",
24
- ring2: "bg-green-300 dark:bg-green-600",
25
- ring3: "bg-green-400 dark:bg-green-500",
26
- },
27
- gray: { // <-- اطمینان از وجود کلید 'gray'
28
- ping: "bg-gray-200 dark:bg-gray-700",
29
- ring1: "bg-gray-200 dark:bg-gray-700",
30
- ring2: "bg-gray-300 dark:bg-gray-600",
31
- ring3: "bg-gray-400 dark:bg-gray-500",
32
- }
33
- };
34
-
35
- interface LogoAnimationProps {
36
- isMini: boolean;
37
- isActive: boolean;
38
- type?: 'human' | 'ai';
39
- forFooter?: boolean;
40
- }
41
-
42
- const LogoAnimation: React.FC<LogoAnimationProps> = ({
43
- isMini,
44
- isActive,
45
- type = 'human',
46
- forFooter = false,
47
- }) => {
48
- if (!isActive) return null;
49
-
50
- const colorKey = type === 'human' ? 'blue' : (type === 'ai' ? 'green' : 'gray');
51
- // اینجا TypeScript باید نوع logoColorConfig را بشناسد
52
- const currentColors = logoColorConfig[colorKey as keyof typeof logoColorConfig] || logoColorConfig.gray;
53
-
54
- const size = isMini ? 80 : 200;
55
- const iconDisplaySize = isMini ? 35 : 70;
56
- const iconInset = (size - iconDisplaySize) / 2;
57
-
58
- const insets = {
59
- ping: isMini ? "10px" : "40px",
60
- ring1: isMini ? "0px" : "0px",
61
- ring2: isMini ? "5px" : "20px",
62
- ring3: isMini ? "12px" : "50px",
63
- iconContainer: `${iconInset}px`
64
- };
65
-
66
- const IconComponent = type === 'human' ? SvgHumanIcon : null;
67
-
68
- return (
69
- <div
70
- className={cn("logo-animation-wrapper", { "for-footer": forFooter })}
71
- style={{ width: `${size}px`, height: `${size}px` }}
72
- >
73
- {/* div مخفی برای safelist کردن کلاس‌های Tailwind */}
74
- <div className="hidden bg-blue-200 bg-blue-300 bg-blue-400 bg-green-200 bg-green-300 bg-green-400 bg-gray-200 bg-gray-300 bg-gray-400 dark:bg-blue-700 dark:bg-blue-600 dark:bg-blue-500 dark:bg-green-700 dark:bg-green-600 dark:bg-green-500 dark:bg-gray-700 dark:bg-gray-600 dark:bg-gray-500"></div>
75
-
76
- <div
77
- className={`absolute rounded-full opacity-50 animate-ping ${currentColors.ping}`}
78
- style={{ inset: insets.ping }}
79
- ></div>
80
- <div
81
- className={`absolute rounded-full opacity-50 ${currentColors.ring1}`}
82
- style={{ inset: insets.ring1 }}
83
- ></div>
84
- <div
85
- className={`absolute rounded-full opacity-50 ${currentColors.ring2}`}
86
- style={{ inset: insets.ring2 }}
87
- ></div>
88
- <div
89
- className={`absolute rounded-full opacity-50 ${currentColors.ring3}`}
90
- style={{ inset: insets.ring3 }}
91
- ></div>
92
- <div
93
- className="z-10 absolute flex items-center justify-center"
94
- style={{
95
- inset: insets.iconContainer,
96
- width: `${iconDisplaySize}px`,
97
- height: `${iconDisplaySize}px`,
98
- }}
99
- >
100
- {IconComponent && <IconComponent />}
101
- </div>
102
- </div>
103
- );
104
- };
105
-
106
- export default LogoAnimation;