xxxxxxxxxx
31
//neon waves
//Created by Mirette Dahab
//February 24th, 2025
//independant work
function setup() {
createCanvas(400, 400);
}
function draw() {
background(124, 230, 0, 50); // Semi-transparent background for fading effect
for (let i = -50; i < width + 10; i += 80) {
for (let j = -110; j < height + 80; j += 70) {
let d = dist(mouseX, mouseY, i, j); // Distance from mouse
let wave = sin(frameCount * 0.1 + i * 0.3 + j * 0.3) * 10; // Base wave motion
let influence = map(d, 0, width, 2, 0.1); // Mouse influence
let z = wave * influence;
strokeWeight(1 + abs(z));
stroke(lerpColor(color(255, 60, 100), color(100, 100, 255), mouseX / width)); // Dynamic color
line(i, j, i + 5 + z, j + z * 0.3);
}
}
}