xxxxxxxxxx
44
//Fluid Stains
//Created by Mirette Dahab
//January 4th, 2025
//independant work
//pink
let start = 0;
let inc = 3;
let gradientSpeed = 0.01; // Speed of gradient animation
let gradientOffset = 0; // Offset for scrolling the gradient
let rotationSpeed = 0.005; // Speed of line rotation
let rotationAngle = 0; // Initial rotation angle
function setup() {
createCanvas(410, 410);
}
function draw() {
//scroll the gradient smoothly
gradientOffset += gradientSpeed;
let t = noise(gradientOffset);
push();
translate(width / 2, height / 2); // Move to the center of the canvas
rotationAngle += rotationSpeed;
for (let i = 0; i < height; i++) {
let inter = map(i, 0, height, 0, 1);
let c = lerpColor(color('#AA336A'), color('#FF69B4'), (inter + t) % 1); // Wrap the gradient
push();
rotate(rotationAngle + map(i, 0, height, -PI/20 , PI / 20)); //different rotation for each line
stroke(c);
line(10, i - height / 4, width/128, i - height / 4); //line with rotation
pop();
}
pop();
//increment start for animation
start += inc;
}