From 5040da28e3561168ecd5c355091d707cf4115dee Mon Sep 17 00:00:00 2001 From: Natasha Moongrave Date: Sun, 22 Mar 2026 22:50:26 +0100 Subject: Moved the background JavaScript code from . to src/Background --- mountains.js | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 mountains.js (limited to 'mountains.js') diff --git a/mountains.js b/mountains.js deleted file mode 100644 index 27cea87..0000000 --- a/mountains.js +++ /dev/null @@ -1,40 +0,0 @@ -import * as THREE from 'https://unpkg.com/three@0.160.0/build/three.module.js'; - -export function createMountains() { - const mountainCount = 100; // number of peaks - const mountainWidth = 2; // horizontal spacing - const mountainHeight = 5; // max height of peaks - const baseHeight = 0; // ground level - const mountainDepth = -50; // far behind grid - - // Create a 2D shape for the mountain silhouette - const shape = new THREE.Shape(); - shape.moveTo(-mountainCount * mountainWidth / 2, baseHeight); - - for (let i = -mountainCount / 2; i <= mountainCount / 2; i++) { - const x = i * mountainWidth; - const y = Math.random() * mountainHeight + 5; // peak height - shape.lineTo(x, y); - } - - // Close shape at the far right base - shape.lineTo(mountainCount * mountainWidth / 2, baseHeight); - shape.lineTo(-mountainCount * mountainWidth / 2, baseHeight); - - // Convert shape to geometry - const geometry = new THREE.ShapeGeometry(shape); - - // Rotate so it lies in XZ plane - // geometry.rotateX(-Math.PI / 2); - geometry.translate(0, 0, mountainDepth); - - const material = new THREE.MeshBasicMaterial({ - color: 0xff0077, - side: THREE.DoubleSide, - transparent: true, - opacity: 1 - }); - - const mesh = new THREE.Mesh(geometry, material); - return mesh; -} -- cgit v1.2.3