xxxxxxxxxx
102
let x = 20;
let speed = 0.03;
let y = 0
let ac = 0.01;
let me = x;
let easing = 0.05;
let starX;
let starY;
let starSize;
function setup() {
createCanvas(400, 400);
//background(220);
pixelDensity(1)
}
function draw() {
stroke(200, 200, 200, 50)
strokeWeight(10)
fill(0 + x, 10 )
circle(width / 2, height / 2, x)
if (x >= 20 && x < 200) {
speed = speed
ac++
// ac = ac
} else {
speed = -speed
ac = -(ac++)
}
x = x + speed + ac
y = y + 0.9
let targetY = x; // breathing input // also circle
let dy = targetY - me;
me += dy * easing;
//me = map(me, 20, 50, 50,350) // max and min
noFill()
stroke(255, 255,255, 10)
strokeWeight(10)
point(0 + y, me);
// filter(BLUR, 1)
// x=x+0.3
// point(0+y, x)
// stroke(255)
// strokeWeight(3)
// point(0 + y, me);
let now = frameCount % 8
if (now == 0) {
drawStars();
} else {
}
}
function drawStars() {
starX = random(0,width);
starY = random(0,height);
starSize = random(0.1, 0.5);
starXa = random(0,width);
starYa = random(0,height);
starSizea = random(0.2, 0.8);
starXb = random(0,width);
starYb = random(0,height);
starSizeb = random(0, 0.45);
ellipse(starX, starY, starSize);
ellipse(starXa, starYa, starSizea);
ellipse(starXb, starYb, starSizeb);
}