Commit bd57c58 1 parent 4d8a1e3 commit bd57c58 Copy full SHA for bd57c58
File tree 9 files changed +79
-1
lines changed
9 files changed +79
-1
lines changed Original file line number Diff line number Diff line change
1
+ class Echo implements IEcho {
2
+ private defaultOptions : EchoDefaultOptions
3
+
4
+ constructor ( defaultOptions = { } ) {
5
+ this . defaultOptions = {
6
+ visualEffect : "wave" ,
7
+ sound : null ,
8
+ delay : 0 ,
9
+ duration : 500 ,
10
+ color : "#3498db" ,
11
+ size : 100 ,
12
+ ...defaultOptions ,
13
+ }
14
+ }
15
+
16
+ public trigger ( element : HTMLElement , options : TriggerOptions ) : void {
17
+
18
+ }
19
+ }
Original file line number Diff line number Diff line change
1
+ class EchoEffects implements IEchoEffect {
2
+ _createVisualEffect ( element : HTMLElement , config : VisualEffectConfig ) : void {
3
+
4
+ }
5
+ }
Original file line number Diff line number Diff line change
1
+ "use strict" ;
Original file line number Diff line number Diff line change
1
+ "use strict" ;
Original file line number Diff line number Diff line change
1
+ type VisualEffects = 'wave' | 'pulse' | 'flash'
2
+
3
+ interface VisualEffectConfig { }
4
+
5
+ interface IEchoEffect {
6
+ /**
7
+ * Создает визуальный эффект (например, волны)
8
+ * @param {HTMLElement } element
9
+ * @param {Object } config
10
+ */
11
+ _createVisualEffect ( element : HTMLElement , config : VisualEffectConfig ) : void ;
12
+ }
Original file line number Diff line number Diff line change
1
+ interface EchoDefaultOptions {
2
+ /**
3
+ * Визуальные эффекты,
4
+ * использует тип @type {VisualEffects}
5
+ */
6
+ visualEffect : VisualEffects ;
7
+ /**
8
+ * URL аудиофайла или null
9
+ */
10
+ sound : string | null ;
11
+ /**
12
+ * Задержка перед эффектом
13
+ */
14
+ delay : number ;
15
+ /**
16
+ * Длительность эффекта в мс
17
+ */
18
+ duration : number ;
19
+ /**
20
+ * Цвет эффекта
21
+ */
22
+ color : string ;
23
+ /**
24
+ * Размер эффекта в px
25
+ */
26
+ size : number ;
27
+ }
28
+
29
+ interface TriggerOptions { }
30
+
31
+ interface IEcho {
32
+ /**
33
+ * Триггерит эффект на указанном элементе
34
+ * @param {HTMLElement } element - элемент, на котором сработает эффект
35
+ * @param {TriggerOptions } options - настройки эффекта
36
+ */
37
+ trigger ( element : HTMLElement , options : TriggerOptions ) : void ;
38
+ }
Original file line number Diff line number Diff line change
1
+ "use strict"
Original file line number Diff line number Diff line change 15
15
"type" : " commonjs" ,
16
16
"main" : " index.js" ,
17
17
"scripts" : {
18
- "build" : " webpack"
18
+ "build:dev" : " webpack" ,
19
+ "build:prod" : " webpack"
19
20
},
20
21
"devDependencies" : {
21
22
"@eslint/js" : " ^9.19.0" ,
You can’t perform that action at this time.
0 commit comments