Ezmary commited on
Commit
46d4f52
·
verified ·
1 Parent(s): eb0ac7f

Update src/components/icons.tsx

Browse files
Files changed (1) hide show
  1. src/components/icons.tsx +28 -8
src/components/icons.tsx CHANGED
@@ -2,24 +2,44 @@
2
 
3
  import React from 'react';
4
 
5
- // آیکون جدید با قابلیت انیمیشن موجی بر اساس حجم صدای کاربر
6
- export const PauseIconWithPulse = ({ userVolume = 0 }: { userVolume: number }) => {
7
- const barHeight = 24.2;
8
- const yBase = 6.4;
9
- const animatedHeight = Math.min(barHeight, 8 + userVolume * 50);
10
 
11
  return (
12
  <svg width="37" height="37" viewBox="0 0 37 37" fill="none" xmlns="http://www.w3.org/2000/svg">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  <path d="M15.9872 29.6198V8.28342C15.9872 6.25781 15.132 5.44757 12.9713 5.44757H7.52469C5.36404 5.44757 4.50879 6.25781 4.50879 8.28342V29.6198C4.50879 31.6454 5.36404 32.4556 7.52469 32.4556H12.9713C15.132 32.4556 15.9872 31.6454 15.9872 29.6198Z" fill="#BE123C"/>
14
  <path opacity="0.4" d="M31.5175 29.6198V8.28342C31.5175 6.25781 30.6622 5.44757 28.5016 5.44757H23.055C20.9093 5.44757 20.0391 6.25781 20.0391 8.28342V29.6198C20.0391 31.6454 20.8943 32.4556 23.055 32.4556H28.5016C30.6622 32.4556 31.5175 31.6454 31.5175 29.6198Z" fill="#BE123C"/>
15
- <rect x="4.5" y={yBase + (barHeight - animatedHeight)} width="11.5" height={animatedHeight} fill="#e11d48" style={{ transition: 'all 0.05s ease-out' }}/>
16
- <rect x="20" y={yBase + (barHeight - animatedHeight)} width="11.5" height={animatedHeight} fill="#f43f5e" style={{ transition: 'all 0.05s ease-out' }}/>
17
  </svg>
18
  );
19
  };
20
 
21
- export const pauseIcon = <PauseIconWithPulse userVolume={0} />;
 
 
 
 
 
 
 
22
 
 
23
  export const microphoneIcon = (
24
  <svg width="69" height="68" viewBox="0 0 69 68" fill="none" xmlns="http://www.w3.org/2000/svg">
25
  <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"/>
 
2
 
3
  import React from 'react';
4
 
5
+ // آیکون جدید Pause که انیمیشن موجی را در اطراف خطوط نمایش می‌دهد
6
+ export const PauseIconWithSurroundPulse = ({ userVolume = 0 }: { userVolume: number }) => {
7
+ // بر اساس حجم صدا، مقیاس و شفافیت امواج را تغییر می‌دهیم
8
+ const waveScale = 1 + userVolume * 2;
9
+ const waveOpacity = Math.min(1, userVolume * 5);
10
 
11
  return (
12
  <svg width="37" height="37" viewBox="0 0 37 37" fill="none" xmlns="http://www.w3.org/2000/svg">
13
+ {/* دایره موجی پس‌زمینه که با صدای کاربر بزرگ می‌شود */}
14
+ <circle
15
+ cx="18.5"
16
+ cy="18.5"
17
+ r="18"
18
+ fill="#fecdd3" // رنگ صورتی خیلی روشن برای موج
19
+ opacity={waveOpacity}
20
+ style={{
21
+ transformOrigin: 'center',
22
+ transform: `scale(${waveScale})`,
23
+ transition: 'transform 0.1s ease-out, opacity 0.1s ease-out'
24
+ }}
25
+ />
26
+ {/* خطوط ثابت pause در لایه رویی */}
27
  <path d="M15.9872 29.6198V8.28342C15.9872 6.25781 15.132 5.44757 12.9713 5.44757H7.52469C5.36404 5.44757 4.50879 6.25781 4.50879 8.28342V29.6198C4.50879 31.6454 5.36404 32.4556 7.52469 32.4556H12.9713C15.132 32.4556 15.9872 31.6454 15.9872 29.6198Z" fill="#BE123C"/>
28
  <path opacity="0.4" d="M31.5175 29.6198V8.28342C31.5175 6.25781 30.6622 5.44757 28.5016 5.44757H23.055C20.9093 5.44757 20.0391 6.25781 20.0391 8.28342V29.6198C20.0391 31.6454 20.8943 32.4556 23.055 32.4556H28.5016C30.6622 32.4556 31.5175 31.6454 31.5175 29.6198Z" fill="#BE123C"/>
 
 
29
  </svg>
30
  );
31
  };
32
 
33
+ // نسخه ثابت برای نمایش اولیه
34
+ export const pauseIcon = (
35
+ <svg width="37" height="37" viewBox="0 0 37 37" fill="none" xmlns="http://www.w3.org/2000/svg">
36
+ <path d="M15.9872 29.6198V8.28342C15.9872 6.25781 15.132 5.44757 12.9713 5.44757H7.52469C5.36404 5.44757 4.50879 6.25781 4.50879 8.28342V29.6198C4.50879 31.6454 5.36404 32.4556 7.52469 32.4556H12.9713C15.132 32.4556 15.9872 31.6454 15.9872 29.6198Z" fill="#BE123C"/>
37
+ <path opacity="0.4" d="M31.5175 29.6198V8.28342C31.5175 6.25781 30.6622 5.44757 28.5016 5.44757H23.055C20.9093 5.44757 20.0391 6.25781 20.0391 8.28342V29.6198C20.0391 31.6454 20.8943 32.4556 23.055 32.4556H28.5016C30.6622 32.4556 31.5175 31.6454 31.5175 29.6198Z" fill="#BE123C"/>
38
+ </svg>
39
+ );
40
+
41
 
42
+ // بقیه آیکون‌ها بدون تغییر باقی می‌مانند
43
  export const microphoneIcon = (
44
  <svg width="69" height="68" viewBox="0 0 69 68" fill="none" xmlns="http://www.w3.org/2000/svg">
45
  <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"/>