let bgColor; let distortionWidth = 100; function setup() { createCanvas(windowWidth, windowHeight); bgColor = color('#0b0a1d'); noStroke(); frameRate(30); } function draw() { background(bgColor); applyDistortion(); } function applyDistortion() { loadPixels(); for (let y = 0; y < height; y++) { for (let x = 0; x < width; x++) { let offsetX = sin(x * 90) * 100; let offsetY = cos(y * 9) * 10; let newX = int(x + offsetX) % distortionWidth; let newY = int(y + offsetY) % height; let idx = (newX + newY * distortionWidth) * 2; pixels[idx] = random(255); pixels[idx + 1] = 255; pixels[idx + 2] = 0; pixels[idx + 3] = 255; } } updatePixels(); distortionWidth = (distortionWidth + 1000) % 2800 + 3000; }