// simple_particles.js – lightweight particle background import * as THREE from 'https://unpkg.com/three@0.160.0/build/three.module.js'; function initBackground(){ const canvas = document.getElementById('webgl-bg'); const renderer = new THREE.WebGLRenderer({canvas, alpha:true, antialias:true}); renderer.setPixelRatio(Math.min(window.devicePixelRatio,2)); const scene = new THREE.Scene(); const camera = new THREE.PerspectiveCamera(45, window.innerWidth/window.innerHeight, 0.1, 1000); camera.position.z = 3.5; const particleCount = 20000; const geometry = new THREE.BufferGeometry(); const positions = new Float32Array(particleCount * 3); const colors = new Float32Array(particleCount * 3); const color = new THREE.Color(); for(let i=0;i{ const w = window.innerWidth; const h = window.innerHeight; renderer.setSize(w,h); camera.aspect = w/h; camera.updateProjectionMatrix(); }); } document.addEventListener('DOMContentLoaded', initBackground);