Changed around line 1
+ // Initialize wallpaper animations
+ function initWallpapers() {
+ const wallpaper1 = document.getElementById('wallpaper1');
+ const wallpaper2 = document.getElementById('wallpaper2');
+ const wallpaper3 = document.getElementById('wallpaper3');
+
+ // Wallpaper 2: Particle System
+ const canvas = document.createElement('canvas');
+ canvas.width = wallpaper2.clientWidth;
+ canvas.height = wallpaper2.clientHeight;
+ wallpaper2.appendChild(canvas);
+ const ctx = canvas.getContext('2d');
+
+ class Particle {
+ constructor() {
+ this.x = Math.random() * canvas.width;
+ this.y = Math.random() * canvas.height;
+ this.size = Math.random() * 3 + 1;
+ this.speedX = Math.random() * 2 - 1;
+ this.speedY = Math.random() * 2 - 1;
+ }
+
+ update() {
+ this.x += this.speedX;
+ this.y += this.speedY;
+ if (this.size > 0.2) this.size -= 0.01;
+ }
+
+ draw() {
+ ctx.fillStyle = `rgba(255, 255, 255, ${this.size / 3})`;
+ ctx.beginPath();
+ ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2);
+ ctx.fill();
+ }
+ }
+
+ let particles = [];
+ function initParticles() {
+ particles = [];
+ for (let i = 0; i < 100; i++) {
+ particles.push(new Particle());
+ }
+ }
+
+ function animateParticles() {
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
+ particles.forEach(particle => {
+ particle.update();
+ particle.draw();
+ if (particle.size <= 0.2) {
+ const index = particles.indexOf(particle);
+ particles.splice(index, 1);
+ particles.push(new Particle());
+ }
+ });
+ requestAnimationFrame(animateParticles);
+ }
+
+ initParticles();
+ animateParticles();
+
+ // Wallpaper 3: Neon Waves
+ const waveCanvas = document.createElement('canvas');
+ waveCanvas.width = wallpaper3.clientWidth;
+ waveCanvas.height = wallpaper3.clientHeight;
+ wallpaper3.appendChild(waveCanvas);
+ const waveCtx = waveCanvas.getContext('2d');
+
+ let time = 0;
+ function drawWave() {
+ waveCtx.clearRect(0, 0, waveCanvas.width, waveCanvas.height);
+ waveCtx.beginPath();
+ waveCtx.moveTo(0, waveCanvas.height / 2);
+
+ for (let i = 0; i < waveCanvas.width; i++) {
+ const y = waveCanvas.height / 2 + Math.sin(i * 0.02 + time) * 30;
+ waveCtx.lineTo(i, y);
+ }
+
+ waveCtx.strokeStyle = `hsl(${time * 10}, 100%, 50%)`;
+ waveCtx.lineWidth = 2;
+ waveCtx.stroke();
+
+ time += 0.05;
+ requestAnimationFrame(drawWave);
+ }
+
+ drawWave();
+ }
+
+ // Initialize settings controls
+ function initSettings() {
+ const brightness = document.getElementById('brightness');
+ const speed = document.getElementById('speed');
+ const colorTheme = document.getElementById('colorTheme');
+
+ brightness.addEventListener('input', (e) => {
+ document.documentElement.style.setProperty('--brightness', `${e.target.value}%`);
+ });
+
+ speed.addEventListener('input', (e) => {
+ document.documentElement.style.setProperty('--animation-speed', `${e.target.value}s`);
+ });
+
+ colorTheme.addEventListener('change', (e) => {
+ document.body.classList.remove('light', 'dark', 'custom');
+ document.body.classList.add(e.target.value.toLowerCase());
+ });
+ }
+
+ // Initialize everything
+ document.addEventListener('DOMContentLoaded', () => {
+ initWallpapers();
+ initSettings();
+ });