File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,10 @@ class Dancer {
22
22
}
23
23
24
24
dance ( type , className , ratio , options ) {
25
- const dance = this . dances [ type ] || this . dances [ 'size' ]
25
+ let dance = type
26
+ if ( typeof type === 'string' ) {
27
+ dance = this . dances [ type ] || this . dances [ 'pulse' ]
28
+ }
26
29
const elements = document . getElementsByClassName ( className )
27
30
Array . from ( elements ) . forEach ( elem => dance ( elem , ratio , options ) )
28
31
}
Original file line number Diff line number Diff line change @@ -10,9 +10,9 @@ export default class Rythm {
10
10
this . maxValueHistory = analyser . maxValueHistory
11
11
this . dancer = dancer
12
12
this . rythms = [ ]
13
- this . addRythm ( 'rythm-bass' , 'pulse' , 0 , 10 )
14
- this . addRythm ( 'rythm-medium' , 'pulse' , 150 , 40 )
15
- this . addRythm ( 'rythm-high' , 'pulse' , 400 , 200 )
13
+ this . addRythm ( 'rythm-bass' , 'pulse' , 0 , 10 )
14
+ this . addRythm ( 'rythm-medium' , 'pulse' , 150 , 40 )
15
+ this . addRythm ( 'rythm-high' , 'pulse' , 400 , 200 )
16
16
}
17
17
18
18
connectExternalAudioElement = ( audioElement ) => this . player . connectExternalAudioElement ( audioelement )
You can’t perform that action at this time.
0 commit comments