Skip to content

Commit 626db4c

Browse files
committed
Update starfield.js
1 parent ce1eb31 commit 626db4c

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

great_docs/assets/starfield.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
const MOUSE_INFLUENCE = 0.12;
1515

1616
/* ── Dark-mode starfield constants ─────────────────────── */
17-
const STAR_COUNT = 340;
17+
const STAR_COUNT = 800;
1818
const SPEED = 0.40;
1919
const DEPTH = 950;
2020
const TWINKLE_SPEED = 0.035; // sine-wave twinkle rate
2121
const QUASAR_CHANCE = 0.07; // fraction of stars that glow
2222

2323
/* Nebula cloud count */
24-
const NEBULA_COUNT = 5;
24+
const NEBULA_COUNT = 12;
2525

2626
/* Star colour palette (dark mode) — cool whites, blues, warm hints */
2727
const STAR_COLORS = [
@@ -32,13 +32,16 @@
3232
[210, 180, 255], // soft lavender
3333
];
3434

35-
/* Nebula colour palette — magenta / purple / deep blue */
35+
/* Nebula colour palette — blues and purples */
3636
const NEBULA_COLORS = [
37-
[180, 50, 180], // magenta
37+
[ 80, 80, 255], // royal blue
38+
[100, 120, 255], // cornflower
3839
[140, 40, 200], // deep purple
3940
[100, 60, 220], // violet-blue
40-
[200, 60, 160], // hot magenta
41+
[ 60, 100, 240], // medium blue
42+
[160, 60, 240], // blue-violet
4143
[120, 30, 180], // dark purple
44+
[ 90, 140, 255], // soft blue
4245
];
4346

4447
/* ── Light-mode neon constants ───────────────────────────── */
@@ -148,7 +151,7 @@
148151

149152
// Pulsate opacity
150153
var pulse = 0.5 + 0.5 * Math.sin(frame * 0.012 + n.phase);
151-
var alpha = 0.025 + pulse * 0.04;
154+
var alpha = 0.04 + pulse * 0.06;
152155

153156
ctx.save();
154157
ctx.translate(n.x + ox, n.y + oy);
@@ -191,7 +194,7 @@
191194

192195
var t = 1 - s.z / DEPTH; // 0=far, 1=near
193196
var twinkle = 0.5 + 0.5 * Math.sin(frame * TWINKLE_SPEED + s.phase);
194-
var alpha = (0.15 + t * 0.75) * (0.55 + 0.45 * twinkle);
197+
var alpha = (0.30 + t * 0.65) * (0.65 + 0.35 * twinkle);
195198

196199
// Dramatic size curve: stars get BIG when very close
197200
// Cubic easing makes close stars grow fast

0 commit comments

Comments
 (0)