File tree 1 file changed +16
-15
lines changed
1 file changed +16
-15
lines changed Original file line number Diff line number Diff line change @@ -21,22 +21,23 @@ export const generateStars = ({
21
21
star . rotateSpeed = rotationSpeed ;
22
22
return star ;
23
23
} ) ;
24
+ } else {
25
+ const newStars = new Array ( missingStars ) . fill ( 0 ) . map (
26
+ ( ) =>
27
+ new Star ( {
28
+ ctx,
29
+ width : 0.1 * Math . random ( ) ,
30
+ distance : 120 * Math . pow ( Math . random ( ) * Math . random ( ) , 1 / 2 ) ,
31
+ rotateSpeed :
32
+ rotationSpeed * 0.01 + Math . random ( ) * rotationSpeed * 0.01 ,
33
+ rgb : parseColor ( color ) ,
34
+ } )
35
+ ) ;
36
+ totalStars = stars . concat ( newStars ) . map ( ( star ) => {
37
+ star . rotateSpeed = rotationSpeed ;
38
+ return star ;
39
+ } ) ;
24
40
}
25
- const newStars = new Array ( missingStars ) . fill ( 0 ) . map (
26
- ( ) =>
27
- new Star ( {
28
- ctx,
29
- width : 0.1 * Math . random ( ) ,
30
- distance : 120 * Math . pow ( Math . random ( ) * Math . random ( ) , 1 / 2 ) ,
31
- rotateSpeed :
32
- rotationSpeed * 0.01 + Math . random ( ) * rotationSpeed * 0.01 ,
33
- rgb : parseColor ( color ) ,
34
- } )
35
- ) ;
36
- totalStars = stars . concat ( newStars ) . map ( ( star ) => {
37
- star . rotateSpeed = rotationSpeed ;
38
- return star ;
39
- } ) ;
40
41
return totalStars . map ( ( star ) => {
41
42
star . rotateSpeed =
42
43
rotationSpeed * 0.01 + Math . random ( ) * rotationSpeed * 0.01 ;
You can’t perform that action at this time.
0 commit comments