aboutsummaryrefslogtreecommitdiff
path: root/src/Background/sun.js
diff options
context:
space:
mode:
authorNatasha Moongrave <natasha@256phi.eu>2026-03-22 22:50:26 +0100
committerNatasha Moongrave <natasha@256phi.eu>2026-03-22 22:50:26 +0100
commit5040da28e3561168ecd5c355091d707cf4115dee (patch)
treef475a2e570702e981fa67f6d7d96a2335df7a197 /src/Background/sun.js
parente84b5703544f8e0642f24e058b7b848c92b746dd (diff)
Moved the background JavaScript code from . to src/Background
Diffstat (limited to 'src/Background/sun.js')
-rw-r--r--src/Background/sun.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/Background/sun.js b/src/Background/sun.js
new file mode 100644
index 0000000..865cc09
--- /dev/null
+++ b/src/Background/sun.js
@@ -0,0 +1,29 @@
+// sun.js
+import * as THREE from 'https://unpkg.com/three@0.160.0/build/three.module.js';
+
+export function createSun() {
+ const sunRadius = 15;
+ const sunSegments = 64;
+
+ // Main sun mesh
+ const sunGeometry = new THREE.CircleGeometry(sunRadius, sunSegments);
+ const sunMaterial = new THREE.MeshBasicMaterial({
+ color: 0xf49922, // neon pink
+ transparent: false,
+ opacity: 1
+ });
+ const sun = new THREE.Mesh(sunGeometry, sunMaterial);
+ sun.position.set(0, 5, -51);
+
+ // Optional glow halo
+ const glowGeometry = new THREE.CircleGeometry(sunRadius * 1.4, sunSegments);
+ const glowMaterial = new THREE.MeshBasicMaterial({
+ color: 0xf49922,
+ transparent: true,
+ opacity: 0.1
+ });
+ const glow = new THREE.Mesh(glowGeometry, glowMaterial);
+ glow.position.copy(sun.position);
+
+ return { sun, glow };
+}