Skip to content

Commit

Permalink
random is changed
Browse files Browse the repository at this point in the history
  • Loading branch information
flodlc committed Feb 3, 2022
1 parent 26d1a05 commit dc9c3d7
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<meta charset="UTF-8" />
<title>Nebula</title>
<link rel="icon" type="image/png" href="/favicon.png" />
<meta name="description" content="Nebula is a lightweight JavaScript library for creating beautiful universe animations. Including configurable Stars, Nebulas, Comets, Planets and Suns.">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link href="https://fonts.googleapis.com/css2?family=Bowlby+One+SC&family=Staatliches&display=swap" rel="stylesheet">
Expand Down
Binary file added public/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion src/View/ReactNebula.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { useLayoutEffect, useRef } from "react";
import { SystemConfig } from "src/types";
import { fillConfig } from "src/DEFAULT_CONFIG";
import { Nebula } from "src/View/Nebula";

export const ReactNebula = ({ config = {} }: { config?: SystemConfig }) => {
Expand Down
4 changes: 2 additions & 2 deletions src/astres/NebulaColoration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Drawable } from "src/astres/Drawable";
import { parseColor } from "src/utils/parseColor";
import { Random } from "src/utils/random";

const INTENSITY_MULTIPLE = 0.032;
const INTENSITY_MULTIPLE = 0.025;
const ITERATION_PER_COLOR = 3;
const COLORS = ["rgb(6,2,122)", "rgb(6,66,18)", "#57046e"];

Expand Down Expand Up @@ -37,7 +37,7 @@ export class NebulaColoration extends Drawable {
},
rgb: parseColor(color),
ratio: Random.around(Math.PI / 4, 0.2),
width: Random.around(6, 1) * this.canvasMinSide * 0.08,
width: Random.between(5, 8) * this.canvasMinSide * 0.08,
};
});
});
Expand Down
2 changes: 1 addition & 1 deletion src/utils/generateStars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const generateStars = ({
() =>
new Star({
ctx,
width: Random.between(0, 0.1),
width: Random.between(0.03, 0.1),
distance: 120 * Math.pow(Math.random() * Math.random(), 1 / 2),
speed: Random.around(rotationSpeed * 0.015, 0.005),
rgb: parseColor(color),
Expand Down

0 comments on commit dc9c3d7

Please sign in to comment.