Ezmary commited on
Commit
8b4e354
·
verified ·
1 Parent(s): 31a3bdf

Update src/App.tsx

Browse files
Files changed (1) hide show
  1. src/App.tsx +116 -44
src/App.tsx CHANGED
@@ -104,18 +104,17 @@ const initialAppConfig: LiveConfig = {
104
  },
105
  };
106
 
107
- // آیکون انسان (برای انیمیشن لوگو)
108
- const SvgHumanIconForLogo = () => ( // تغییر نام برای جلوگیری از تداخل احتمالی
109
- // استفاده از viewBox برای کنترل بهتر اندازه در createLogoFunction
110
- <svg viewBox="0 0 88 89" fill="none" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid meet" style={{width: "100%", height: "100%"}}>
111
  <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="currentColor" strokeWidth="6.42146" strokeLinecap="round" strokeLinejoin="round"/>
112
  <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="currentColor" strokeWidth="6.42146" strokeLinecap="round" strokeLinejoin="round"/>
113
  </svg>
114
  );
115
 
116
- // SVG آیکون میکروفون از HTML مرجع (برای دکمه میکروفون)
117
- const SvgReferenceMicIconForButton = () => ( // تغییر نام برای جلوگیری از تداخل
118
- <svg width="38" height="38" viewBox="0 0 69 68" fill="none" xmlns="http://www.w3.org/2000/svg" style={{transform: 'scale(0.55)'}}> {/* scale مستقیم اعمال شود */}
119
  <path opacity="0.4" d="M49.9479 27.1824C49.0803 27.1824 48.3907 27.872 48.3907 28.7396V32.2544C48.3907 40.1293 41.984 46.5361 34.109 46.5361C26.234 46.5361 19.8273 40.1293 19.8273 32.2544V28.7173C19.8273 27.8497 19.1377 27.1601 18.2701 27.1601C17.4025 27.1601 16.7129 27.8497 16.7129 28.7173V32.2321C16.7129 41.2861 23.6758 48.7384 32.5518 49.5393V54.2776C32.5518 55.1452 33.2414 55.8348 34.109 55.8348C34.9766 55.8348 35.6662 55.1452 35.6662 54.2776V49.5393C44.52 48.7607 51.5051 41.2861 51.5051 32.2321V28.7173C51.4829 27.872 50.7933 27.1824 49.9479 27.1824Z" fill="#BE123C"/>
120
  <path d="M34.1099 11.3434C28.682 11.3434 24.2773 15.7481 24.2773 21.176V32.5658C24.2773 37.9938 28.682 42.3984 34.1099 42.3984C39.5379 42.3984 43.9425 37.9938 43.9425 32.5658V21.176C43.9425 15.7481 39.5379 11.3434 34.1099 11.3434ZM37.0241 26.8042C36.8684 27.3826 36.3567 27.7608 35.7784 27.7608C35.6671 27.7608 35.5559 27.7385 35.4447 27.7163C34.5771 27.4716 33.665 27.4716 32.7974 27.7163C32.0856 27.9165 31.396 27.4938 31.218 26.8042C31.0178 26.1146 31.4404 25.4027 32.1301 25.2247C33.4426 24.8688 34.8218 24.8688 36.1343 25.2247C36.8017 25.4027 37.2021 26.1146 37.0241 26.8042ZM38.2031 22.4885C38.0029 23.0224 37.5135 23.3339 36.9796 23.3339C36.8239 23.3339 36.6904 23.3116 36.5347 23.2671C34.9775 22.6887 33.2423 22.6887 31.6852 23.2671C31.0178 23.5118 30.2614 23.1559 30.0167 22.4885C29.772 21.8212 30.128 21.0648 30.7953 20.8423C32.9309 20.0637 35.289 20.0637 37.4245 20.8423C38.0919 21.087 38.4478 21.8212 38.2031 22.4885Z" fill="#BE123C"/>
121
  </svg>
@@ -158,19 +157,39 @@ const AppInternalLogic: React.FC<{
158
  <div className="main-wrapper max-w-3xl w-full flex flex-col items-center justify-center h-full relative">
159
  <div className="header-controls">
160
  <div id="notification-trigger-container">
161
- <button ref={notificationButtonRef} id="notification-button" aria-label="Notifications" className="header-button" onClick={(e) => { e.stopPropagation(); setIsNotificationOpen(!isNotificationOpen);}}>
 
 
 
 
 
 
 
 
 
162
  <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="12"></line><line x1="12" y1="16" x2="12.01" y2="16"></line></svg>
163
  </button>
164
  </div>
165
  <div className="back-button-container">
166
- <button id="back-button" aria-label="Go back" className="header-button" onClick={() => alert('Back clicked (implement navigation)')}>
 
 
 
 
 
167
  <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="m15 18-6-6 6-6"></path></svg>
168
  </button>
169
  </div>
170
  </div>
171
 
172
  <div ref={notificationPopoverRef} id="notification-popover-wrapper" className="notification-popover-wrapper">
173
- <div id="notification-popover" className={cn("popover-content", {"open animate-popover-open-top-center": isNotificationOpen, "animate-popover-close-top-center": !isNotificationOpen && document.getElementById('notification-popover')?.classList.contains('open'),})}>
 
 
 
 
 
 
174
  <div className="notification-popover-text-content">
175
  مدل‌های هوش مصنوعی می‌توانند اشتباه کنند، صحت اطلاعات مهم را بررسی کنید و از وارد کردن اطلاعات حساس بپرهیزید.
176
  </div>
@@ -178,9 +197,22 @@ const AppInternalLogic: React.FC<{
178
  </div>
179
 
180
  <div className="media-area w-full flex flex-col items-center justify-center flex-grow relative">
181
- <video id="video-feed" ref={videoRef} autoPlay playsInline className={cn("absolute top-0 left-0 w-full h-full object-cover scale-x-[-1]", { "hidden": !isCamActive })} />
182
- {isMicActive && !isCamActive && ( // فقط آدمک و انیمیشن های دیگر اش
183
- <div id="large-logo-container" className="absolute top-0 left-0 w-full h-full flex items-center justify-center pointer-events-none"> {/* pointer-events-none اگر نباید روی کلیک اثر بگذارد */}
 
 
 
 
 
 
 
 
 
 
 
 
 
184
  {createLogoFunction(false, true, 'human', false)}
185
  </div>
186
  )}
@@ -195,90 +227,130 @@ const AppInternalLogic: React.FC<{
195
  isAppCamActive={isCamActive}
196
  onAppCamToggle={setIsCamActive}
197
  createLogoFunction={createLogoFunction}
198
- ReferenceMicrophoneIcon={SvgReferenceMicIconForButton} // پاس دادن آیکون صحیح
199
  />
200
  </div>
201
  </div>
202
  );
203
  }
204
 
205
- // کانفیگ رنگ‌های لوگو (برای سازگاری با Tailwind JIT)
206
  const logoColorConfig = {
207
- blue: { ping: "bg-blue-200 dark:bg-blue-700", outer: "bg-blue-200 dark:bg-blue-700", mid: "bg-blue-300 dark:bg-blue-600", inner: "bg-blue-400 dark:bg-blue-500", },
208
- green: { ping: "bg-green-200 dark:bg-green-700", outer: "bg-green-200 dark:bg-green-700", mid: "bg-green-300 dark:bg-green-600", inner: "bg-green-400 dark:bg-green-500", },
209
- gray: { ping: "bg-gray-200 dark:bg-gray-700", outer: "bg-gray-200 dark:bg-gray-700", mid: "bg-gray-300 dark:bg-gray-600", inner: "bg-gray-400 dark:bg-gray-500", }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
210
  };
211
 
212
  function App() {
213
  const videoRef = useRef<HTMLVideoElement>(null);
214
  const [showIOSModal, setShowIOSModal] = useState(false);
215
  const [isAllowedOrigin, setIsAllowedOrigin] = useState<boolean | null>(null);
 
216
  const [isMicActive, setIsMicActive] = useState(false);
217
  const [isCamActive, setIsCamActive] = useState(false);
218
  const [isNotificationOpen, setIsNotificationOpen] = useState(false);
 
219
  const notificationPopoverRef = useRef<HTMLDivElement>(null);
220
  const notificationButtonRef = useRef<HTMLButtonElement>(null);
221
 
222
  useEffect(() => {
223
- if (isIOS()) setShowIOSModal(true);
224
- const timer = setTimeout(() => setIsAllowedOrigin(true), 100);
 
 
 
 
225
  return () => clearTimeout(timer);
226
  }, []);
227
 
228
  useEffect(() => {
229
  const handleClickOutside = (event: MouseEvent) => {
230
- if (isNotificationOpen && notificationPopoverRef.current && !notificationPopoverRef.current.contains(event.target as Node) && notificationButtonRef.current && !notificationButtonRef.current.contains(event.target as Node)) {
 
 
 
 
 
 
231
  setIsNotificationOpen(false);
232
  }
233
  };
234
  document.addEventListener("mousedown", handleClickOutside);
235
- return () => document.removeEventListener("mousedown", handleClickOutside);
 
 
236
  }, [isNotificationOpen]);
237
 
238
- if (isAllowedOrigin === null) return <div style={{ padding: '20px', textAlign: 'center' }}>در حال بررسی دسترسی...</div>;
 
 
239
 
240
- // تابع ساخت لوگو با انیمیشن کامل (دایره‌ها و آدمک)
241
  const createLogoFunction = (isMini: boolean, isActive: boolean, type: 'human' | 'ai' = 'human', forFooter: boolean = false) => {
242
  if (!isActive) return null;
 
243
  const colorKey = type === 'human' ? 'blue' : (type === 'ai' ? 'green' : 'gray');
244
  const currentColors = logoColorConfig[colorKey as keyof typeof logoColorConfig] || logoColorConfig.gray;
245
- const size = isMini ? 80 : 200; // اندازه کلی انیمیشن لوگو
246
- const iconDisplaySize = isMini ? 35 : 70; // اندازه بصری آدمک داخل دایره‌ها
247
 
248
- // مقادیر inset از HTML مرجع شما برای حلقه‌های انیمیشن
249
- const insetValues = isMini
250
- ? { ping: 10, outer: 0, mid: 5, inner: 12 } // مقادیر برای لوگوی کوچک
251
- : { ping: 40, outer: 0, mid: 20, inner: 50 }; // مقادیر برای لوگوی بزرگ
252
 
253
- // محاسبه inset برای آیکون (آدمک) جهت مرکزیت دقیق
254
  const iconInset = (size - iconDisplaySize) / 2;
255
 
256
- const IconComponent = type === 'human' ? SvgHumanIconForLogo : null; // استفاده از SvgHumanIconForLogo
 
 
 
 
 
 
 
 
257
 
258
  return (
259
- <div className={cn("logo-animation-container", { "for-footer": forFooter })} style={{ width: `${size}px`, height: `${size}px` }}>
260
- {/* حلقه‌های انیمیشن دقیقاً مانند HTML مرجع */}
261
- <div className={`absolute rounded-full opacity-50 animate-ping ${currentColors.ping}`} style={{ inset: `${insetValues.ping}px` }}></div>
262
- <div className={`absolute rounded-full opacity-50 ${currentColors.outer}`} style={{ inset: `${insetValues.outer}px` }}></div> {/* inset-0 */}
263
- <div className={`absolute rounded-full opacity-50 ${currentColors.mid}`} style={{ inset: `${insetValues.mid}px` }}></div>
264
- <div className={`absolute rounded-full opacity-50 ${currentColors.inner}`} style={{ inset: `${insetValues.inner}px` }}></div>
265
- {/* کانتینر آدمک */}
266
- <div className="z-10 absolute flex items-center justify-center" style={{ inset: `${iconInset}px`, width: `${iconDisplaySize}px`, height: `${iconDisplaySize}px` }}>
267
  {IconComponent && <IconComponent />}
268
  </div>
269
  </div>
270
  );
271
  };
272
 
 
273
  return (
274
  <LiveAPIProvider initialConfig={initialAppConfig}>
275
  <AppInternalLogic
276
- isMicActive={isMicActive} setIsMicActive={setIsMicActive}
277
- isCamActive={isCamActive} setIsCamActive={setIsCamActive}
 
 
278
  createLogoFunction={createLogoFunction}
279
  videoRef={videoRef}
280
- notificationPopoverRef={notificationPopoverRef} notificationButtonRef={notificationButtonRef}
281
- isNotificationOpen={isNotificationOpen} setIsNotificationOpen={setIsNotificationOpen}
 
 
282
  />
283
  <IOSModal isOpen={showIOSModal} onClose={() => setShowIOSModal(false)} />
284
  </LiveAPIProvider>
 
104
  },
105
  };
106
 
107
+ // آیکون انسان (برای لوگوی بزرگ و کوچک) - با width و height 100% برای انعطاف پذیری
108
+ const SvgHumanIcon = () => (
109
+ <svg width="100%" height="100%" viewBox="0 0 88 89" fill="none" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid meet">
 
110
  <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="currentColor" strokeWidth="6.42146" strokeLinecap="round" strokeLinejoin="round"/>
111
  <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="currentColor" strokeWidth="6.42146" strokeLinecap="round" strokeLinejoin="round"/>
112
  </svg>
113
  );
114
 
115
+ // SVG آیکون میکروفون از HTML مرجع شما (با سه خط افقی)
116
+ const SvgReferenceMicrophoneIcon = () => (
117
+ <svg width="38" height="38" viewBox="0 0 69 68" fill="none" xmlns="http://www.w3.org/2000/svg" transform="scale(0.55)">
118
  <path opacity="0.4" d="M49.9479 27.1824C49.0803 27.1824 48.3907 27.872 48.3907 28.7396V32.2544C48.3907 40.1293 41.984 46.5361 34.109 46.5361C26.234 46.5361 19.8273 40.1293 19.8273 32.2544V28.7173C19.8273 27.8497 19.1377 27.1601 18.2701 27.1601C17.4025 27.1601 16.7129 27.8497 16.7129 28.7173V32.2321C16.7129 41.2861 23.6758 48.7384 32.5518 49.5393V54.2776C32.5518 55.1452 33.2414 55.8348 34.109 55.8348C34.9766 55.8348 35.6662 55.1452 35.6662 54.2776V49.5393C44.52 48.7607 51.5051 41.2861 51.5051 32.2321V28.7173C51.4829 27.872 50.7933 27.1824 49.9479 27.1824Z" fill="#BE123C"/>
119
  <path d="M34.1099 11.3434C28.682 11.3434 24.2773 15.7481 24.2773 21.176V32.5658C24.2773 37.9938 28.682 42.3984 34.1099 42.3984C39.5379 42.3984 43.9425 37.9938 43.9425 32.5658V21.176C43.9425 15.7481 39.5379 11.3434 34.1099 11.3434ZM37.0241 26.8042C36.8684 27.3826 36.3567 27.7608 35.7784 27.7608C35.6671 27.7608 35.5559 27.7385 35.4447 27.7163C34.5771 27.4716 33.665 27.4716 32.7974 27.7163C32.0856 27.9165 31.396 27.4938 31.218 26.8042C31.0178 26.1146 31.4404 25.4027 32.1301 25.2247C33.4426 24.8688 34.8218 24.8688 36.1343 25.2247C36.8017 25.4027 37.2021 26.1146 37.0241 26.8042ZM38.2031 22.4885C38.0029 23.0224 37.5135 23.3339 36.9796 23.3339C36.8239 23.3339 36.6904 23.3116 36.5347 23.2671C34.9775 22.6887 33.2423 22.6887 31.6852 23.2671C31.0178 23.5118 30.2614 23.1559 30.0167 22.4885C29.772 21.8212 30.128 21.0648 30.7953 20.8423C32.9309 20.0637 35.289 20.0637 37.4245 20.8423C38.0919 21.087 38.4478 21.8212 38.2031 22.4885Z" fill="#BE123C"/>
120
  </svg>
 
157
  <div className="main-wrapper max-w-3xl w-full flex flex-col items-center justify-center h-full relative">
158
  <div className="header-controls">
159
  <div id="notification-trigger-container">
160
+ <button
161
+ ref={notificationButtonRef}
162
+ id="notification-button"
163
+ aria-label="Notifications"
164
+ className="header-button"
165
+ onClick={(e) => {
166
+ e.stopPropagation();
167
+ setIsNotificationOpen(!isNotificationOpen);
168
+ }}
169
+ >
170
  <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="12"></line><line x1="12" y1="16" x2="12.01" y2="16"></line></svg>
171
  </button>
172
  </div>
173
  <div className="back-button-container">
174
+ <button
175
+ id="back-button"
176
+ aria-label="Go back"
177
+ className="header-button"
178
+ onClick={() => alert('Back clicked (implement navigation)')}
179
+ >
180
  <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="m15 18-6-6 6-6"></path></svg>
181
  </button>
182
  </div>
183
  </div>
184
 
185
  <div ref={notificationPopoverRef} id="notification-popover-wrapper" className="notification-popover-wrapper">
186
+ <div
187
+ id="notification-popover"
188
+ className={cn("popover-content", {
189
+ "open animate-popover-open-top-center": isNotificationOpen,
190
+ "animate-popover-close-top-center": !isNotificationOpen && document.getElementById('notification-popover')?.classList.contains('open'),
191
+ })}
192
+ >
193
  <div className="notification-popover-text-content">
194
  مدل‌های هوش مصنوعی می‌توانند اشتباه کنند، صحت اطلاعات مهم را بررسی کنید و از وارد کردن اطلاعات حساس بپرهیزید.
195
  </div>
 
197
  </div>
198
 
199
  <div className="media-area w-full flex flex-col items-center justify-center flex-grow relative">
200
+ <video
201
+ id="video-feed"
202
+ ref={videoRef}
203
+ autoPlay
204
+ playsInline
205
+ className={cn(
206
+ "absolute top-0 left-0 w-full h-full object-cover scale-x-[-1]",
207
+ { "hidden": !isCamActive }
208
+ )}
209
+ />
210
+ {/* نمایش لوگوی بزرگ فقط زمانی که میکروفون فعال است و دوربین غیرفعال */}
211
+ {isMicActive && !isCamActive && (
212
+ <div
213
+ id="large-logo-container" // ID از HTML برای لوگوی بزرگ وسط
214
+ className="absolute top-0 left-0 w-full h-full flex items-center justify-center pointer-events-none" // pointer-events-none برای اینکه روی ویدیو کلیک نشود
215
+ >
216
  {createLogoFunction(false, true, 'human', false)}
217
  </div>
218
  )}
 
227
  isAppCamActive={isCamActive}
228
  onAppCamToggle={setIsCamActive}
229
  createLogoFunction={createLogoFunction}
230
+ ReferenceMicrophoneIcon={SvgReferenceMicrophoneIcon}
231
  />
232
  </div>
233
  </div>
234
  );
235
  }
236
 
237
+ // پیکربندی رنگ‌های لوگو برای سازگاری با Tailwind JIT
238
  const logoColorConfig = {
239
+ blue: { // برای انسان
240
+ ping: "bg-blue-200 dark:bg-blue-700",
241
+ outer: "bg-blue-200 dark:bg-blue-700",
242
+ mid: "bg-blue-300 dark:bg-blue-600",
243
+ inner: "bg-blue-400 dark:bg-blue-500",
244
+ },
245
+ green: { // برای AI (اگر اضافه شود)
246
+ ping: "bg-green-200 dark:bg-green-700",
247
+ outer: "bg-green-200 dark:bg-green-700",
248
+ mid: "bg-green-300 dark:bg-green-600",
249
+ inner: "bg-green-400 dark:bg-green-500",
250
+ },
251
+ gray: { // پیش‌فرض
252
+ ping: "bg-gray-200 dark:bg-gray-700",
253
+ outer: "bg-gray-200 dark:bg-gray-700",
254
+ mid: "bg-gray-300 dark:bg-gray-600",
255
+ inner: "bg-gray-400 dark:bg-gray-500",
256
+ }
257
  };
258
 
259
  function App() {
260
  const videoRef = useRef<HTMLVideoElement>(null);
261
  const [showIOSModal, setShowIOSModal] = useState(false);
262
  const [isAllowedOrigin, setIsAllowedOrigin] = useState<boolean | null>(null);
263
+
264
  const [isMicActive, setIsMicActive] = useState(false);
265
  const [isCamActive, setIsCamActive] = useState(false);
266
  const [isNotificationOpen, setIsNotificationOpen] = useState(false);
267
+
268
  const notificationPopoverRef = useRef<HTMLDivElement>(null);
269
  const notificationButtonRef = useRef<HTMLButtonElement>(null);
270
 
271
  useEffect(() => {
272
+ if (isIOS()) {
273
+ setShowIOSModal(true);
274
+ }
275
+ const timer = setTimeout(() => {
276
+ setIsAllowedOrigin(true);
277
+ }, 100);
278
  return () => clearTimeout(timer);
279
  }, []);
280
 
281
  useEffect(() => {
282
  const handleClickOutside = (event: MouseEvent) => {
283
+ if (
284
+ isNotificationOpen &&
285
+ notificationPopoverRef.current &&
286
+ !notificationPopoverRef.current.contains(event.target as Node) &&
287
+ notificationButtonRef.current &&
288
+ !notificationButtonRef.current.contains(event.target as Node)
289
+ ) {
290
  setIsNotificationOpen(false);
291
  }
292
  };
293
  document.addEventListener("mousedown", handleClickOutside);
294
+ return () => {
295
+ document.removeEventListener("mousedown", handleClickOutside);
296
+ };
297
  }, [isNotificationOpen]);
298
 
299
+ if (isAllowedOrigin === null) {
300
+ return <div style={{ padding: '20px', textAlign: 'center' }}>در حال بررسی دسترسی...</div>;
301
+ }
302
 
 
303
  const createLogoFunction = (isMini: boolean, isActive: boolean, type: 'human' | 'ai' = 'human', forFooter: boolean = false) => {
304
  if (!isActive) return null;
305
+
306
  const colorKey = type === 'human' ? 'blue' : (type === 'ai' ? 'green' : 'gray');
307
  const currentColors = logoColorConfig[colorKey as keyof typeof logoColorConfig] || logoColorConfig.gray;
 
 
308
 
309
+ const size = isMini ? 80 : 200; // اندازه کلی انیمیشن لوگو
310
+ const iconDisplaySize = isMini ? 35 : 70; // اندازه بصری آیکون SVG داخل انیمیشن
 
 
311
 
312
+ // محاسبه دقیق inset برای وسط قرار گرفتن آیکون
313
  const iconInset = (size - iconDisplaySize) / 2;
314
 
315
+ const insetBase = {
316
+ ping: isMini ? 10 : 40, // این مقادیر از HTML مرجع شما برای حلقه‌ها هستند
317
+ outer: 0, // و باید ثابت بمانند
318
+ mid: isMini ? 5 : 20,
319
+ inner: isMini ? 12 : 50,
320
+ icon: iconInset // inset محاسبه شده برای آیکون
321
+ };
322
+
323
+ const IconComponent = type === 'human' ? SvgHumanIcon : null; // در صورت نیاز، آیکون AI را اینجا اضافه کنید
324
 
325
  return (
326
+ <div className={cn("logo-animation-wrapper", {"for-footer": forFooter})} style={{ width: `${size}px`, height: `${size}px` }}>
327
+ {/* حلقه‌های انیمیشن */}
328
+ <div className={`absolute rounded-full opacity-50 animate-ping ${currentColors.ping}`} style={{ inset: `${insetBase.ping}px` }}></div>
329
+ <div className={`absolute rounded-full opacity-50 ${currentColors.outer}`} style={{ inset: `${insetBase.outer}px` }}></div> {/* اصلاح شده: insetBase.outer */}
330
+ <div className={`absolute rounded-full opacity-50 ${currentColors.mid}`} style={{ inset: `${insetBase.mid}px` }}></div>
331
+ <div className={`absolute rounded-full opacity-50 ${currentColors.inner}`} style={{ inset: `${insetBase.inner}px` }}></div>
332
+ {/* کانتینر آیکون */}
333
+ <div className="z-10 absolute flex items-center justify-center" style={{ inset: `${insetBase.icon}px`, width: `${iconDisplaySize}px`, height: `${iconDisplaySize}px` }}>
334
  {IconComponent && <IconComponent />}
335
  </div>
336
  </div>
337
  );
338
  };
339
 
340
+
341
  return (
342
  <LiveAPIProvider initialConfig={initialAppConfig}>
343
  <AppInternalLogic
344
+ isMicActive={isMicActive}
345
+ setIsMicActive={setIsMicActive}
346
+ isCamActive={isCamActive}
347
+ setIsCamActive={setIsCamActive}
348
  createLogoFunction={createLogoFunction}
349
  videoRef={videoRef}
350
+ notificationPopoverRef={notificationPopoverRef}
351
+ notificationButtonRef={notificationButtonRef}
352
+ isNotificationOpen={isNotificationOpen}
353
+ setIsNotificationOpen={setIsNotificationOpen}
354
  />
355
  <IOSModal isOpen={showIOSModal} onClose={() => setShowIOSModal(false)} />
356
  </LiveAPIProvider>