Skip to content

Commit 6827a70

Browse files
committed
fix config dashboarrd
1 parent 2df88fa commit 6827a70

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

src/utils/generateStars.ts

+16-15
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,23 @@ export const generateStars = ({
2121
star.rotateSpeed = rotationSpeed;
2222
return star;
2323
});
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+
});
2440
}
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-
});
4041
return totalStars.map((star) => {
4142
star.rotateSpeed =
4243
rotationSpeed * 0.01 + Math.random() * rotationSpeed * 0.01;

0 commit comments

Comments
 (0)