From 5f52d9ec4d594b863adc9e772f9248fc8833f6cc Mon Sep 17 00:00:00 2001 From: Zakarya Date: Tue, 18 Mar 2025 17:24:24 -0700 Subject: [PATCH] BG: remove gradient breathing effect This was causing some rendering bugs, and I didn't want it anyways. --- src/component/bg.svelte | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/src/component/bg.svelte b/src/component/bg.svelte index 0a004ce..833a659 100644 --- a/src/component/bg.svelte +++ b/src/component/bg.svelte @@ -216,31 +216,14 @@ } class Gradient extends Entity { - originalRadius: number; radius: number; color: string; alpha: number; - dAlpha: number; constructor() { super(); - this.originalRadius = Math.random() * 500 + 300; - this.radius = this.originalRadius; + this.radius = Math.random() * 500 + 300; this.color = getRandomColor(); this.alpha = Math.random() * 0.5 + 0.5; // Initial alpha between 0.5 and 1 - this.dAlpha = (Math.random() - 0.5) * 0.01; - } - - update() { - super.update(); - - // Breathing effect: oscillate size - this.radius += this.growthSpeed * time_scale; - if ( - this.radius >= this.originalRadius * 1.1 || - this.radius <= this.originalRadius * 0.9 - ) { - this.growthSpeed = -this.growthSpeed; // Reverse growth direction - } } draw() { @@ -258,14 +241,13 @@ } else { gradient.addColorStop(1, `rgba(255, 255, 255, 0)`); } - ctx.save(); ctx.globalAlpha = this.alpha; ctx.fillStyle = gradient; ctx.beginPath(); ctx.arc(this.x, this.y, this.radius, 0, Math.PI * 2); ctx.closePath(); ctx.fill(); - ctx.restore(); + ctx.globalAlpha = 1.0; } }