let colors = ['#ed3441', '#ffd630', '#329fe3', '#08AC7E', '#DED9DF', '#FE4D03'];
minSide = min(width, height);
for (let i = 0; i < objs.length; i++) {
if (frameCount % (random([10, 60, 120])) == 0) {
let x = random(-0.1, 1.1) * width;
let y = random(-0.1, 1.1) * height;
for (let i = 0; i < 20; i++) {
objs.push(new Orb(x, y));
for (let i = 0; i < 50; i++) {
objs.push(new Sparkle(x, y));
for (let i = 0; i < 2; i++) {
objs.push(new Ripple(x, y));
for (let i = 0; i < 10; i++) {
objs.push(new Shapes(x, y));
function easeOutCirc(x) {
return Math.sqrt(1 - Math.pow(x - 1, 2));
this.maxRadius = minSide * 0.03;
this.maxCircleD = minSide * 0.005;
this.circleD = minSide * 0.005;
this.angStep = random([-1, 1]) * random(0.3, 0.1);
this.xStep = random([-1, 1]) * minSide * random(0.01) * random(random());
this.yStep = random([-1, 1]) * minSide * random(0.01) * random(random());
this.lifeSpan = int(random(50, 180));
this.col = random(colors);
this.pos.push(createVector(this.x, this.y));
this.xx = this.x + this.radius * cos(this.ang);
this.yy = this.y + this.radius * sin(this.ang);
strokeWeight(this.circleD);
for (let i = 0; i < this.pos.length; i++) {
vertex(this.pos[i].x, this.pos[i].y);
this.ang += this.angStep;
this.radius += this.rStep;
this.radius = constrain(this.radius, 0, this.maxRadius);
if (this.life > this.lifeSpan) {
this.circleD = map(this.life, 0, this.lifeSpan, this.maxCircleD, 1);
this.pos.push(createVector(this.xx, this.yy));
if (this.pos.length > this.followers) {
this.r = minSide * random(0.4);
this.targetX = x + this.r * cos(this.a);
this.targetY = y + this.r * sin(this.a);
this.lifeSpan = int(random(50, 280));
this.col = random(colors);
this.sw = minSide * random(0.01)
let nrm = norm(this.life, 0, this.lifeSpan);
this.x = lerp(this.x0, this.targetX, easeOutCirc(nrm));
this.y = lerp(this.y0, this.targetY, easeOutCirc(nrm));
if (this.life > this.lifeSpan) {
this.lifeSpan = int(random(50, 150));
this.col = random(colors);
this.maxSw = minSide * 0.005;
this.sw = minSide * 0.005;
this.maxD = minSide * random(0.1, 0.5);
circle(this.x, this.y, this.d);
if (this.life > this.lifeSpan) {
let nrm = norm(this.life, 0, this.lifeSpan);
this.sw = lerp(this.maxSw, 0.1, easeOutCirc(nrm));
this.d = lerp(0, this.maxD, easeOutCirc(nrm));
this.lifeSpan = int(random(50, 222));
this.col = random(colors);
this.sw = minSide * 0.005;
this.maxSw = minSide * 0.005;
this.w = minSide * random(0.05);
this.angStep = random([-1, 1]) * random(0.05);
this.shapeType = int(random(3));
this.r = minSide * random(0.4);
this.targetX = x + this.r * cos(this.a);
this.targetY = y + this.r * sin(this.a);
translate(this.x, this.y);
if (this.shapeType == 0) {
} else if (this.shapeType == 1) {
} else if (this.shapeType == 2) {
line(0, this.w / 2, 0, -this.w / 2);
line(this.w / 2, 0, -this.w / 2, 0);
if (this.life > this.lifeSpan) {
let nrm = norm(this.life, 0, this.lifeSpan);
this.x = lerp(this.x0, this.targetX, easeOutCirc(nrm));
this.y = lerp(this.y0, this.targetY, easeOutCirc(nrm));
this.sw = lerp(this.maxSw, 0.1, easeOutCirc(nrm));
this.ang += this.angStep;