From 9553e77b2f59432ee468e092d58447b7ac8254d4 Mon Sep 17 00:00:00 2001 From: Andrew Simonson Date: Thu, 12 Feb 2026 18:46:00 -0600 Subject: [PATCH] summary --- src/static/js/idler.js | 21 +++++++++++++-------- src/templates/partials/socials.html | 1 - 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/static/js/idler.js b/src/static/js/idler.js index 721154c..5f9171b 100755 --- a/src/static/js/idler.js +++ b/src/static/js/idler.js @@ -74,35 +74,40 @@ function draw() { balls[i].update(); } - // Optimize line drawing with early distance checks + // Draw lines with additive blending so overlaps increase brightness + blendMode(ADD); + strokeWeight(2); + const maxDist = 150; - const maxDistSquared = maxDist * maxDist; // Avoid sqrt in distance calculation + const maxDistSquared = maxDist * maxDist; for (let i = 0; i < balls.length - 1; i++) { const ball1 = balls[i]; for (let j = i + 1; j < balls.length; j++) { const ball2 = balls[j]; - // Quick rejection test using squared distance (faster than sqrt) const dx = ball2.x - ball1.x; const dy = ball2.y - ball1.y; const distSquared = dx * dx + dy * dy; if (distSquared < maxDistSquared) { - const distance = Math.sqrt(distSquared); // Only calculate sqrt if needed + const distance = Math.sqrt(distSquared); - if (distance < 100) { - stroke(150); + if (distance < 75) { + stroke(255, 85); line(ball1.x, ball1.y, ball2.x, ball2.y); } else { - stroke(100); const chance = 0.3 ** (((random(0.2) + 0.8) * distance) / 150); if (chance < 0.5) { - stroke(50); + stroke(255, 40); + } else { + stroke(255, 75); } line(ball1.x, ball1.y, ball2.x, ball2.y); } } } } + + blendMode(BLEND); } diff --git a/src/templates/partials/socials.html b/src/templates/partials/socials.html index 367928b..b284f7a 100755 --- a/src/templates/partials/socials.html +++ b/src/templates/partials/socials.html @@ -1,6 +1,5 @@
Github - Instagram LinkedIn E-mail