xxxxxxxxxx
52
// vertical spacing determined by x and y mouse values
off = 0;
y1 = 30;
x1 = 20;
y2 = -20;
x2 = -190;
function setup() {
createCanvas(windowWidth, windowHeight);
background(237, 230, 216);
textFont('futura');
textStyle(BOLD);
textSize(12);
frameRate(3);
}
function draw() {
r = random(150, 250);
fill(237, 0, 115, r);
off = off + 0.3;
let nx = noise(off) * 10;
let ny = noise(off) * 2;
text("SMALL DOSES", x1 - nx, y1);
y1 = y1 + (mouseY / 20);
r = random(150, 250);
fill(237, 0, 115, r);
push();
rotate(PI);
text("SMALL DOSES", x2 - nx, y2);
pop();
y2 = y2 - (mouseX / 20);
if (y1 >= height - 20) {
x1 = x1 + 180;
y1 = 30;
}
if (y2 <= -height + 30) {
x2 = x2 - 180;
y2 = -20;
}
if (x1 > width && x2 > width ) {
noLoop();
}
}