From 90c6a575b21ca325cd31ddb15d63ac481577b00d Mon Sep 17 00:00:00 2001 From: Mike Lynch Date: Thu, 9 Jan 2025 15:51:05 +1100 Subject: [PATCH] Noise fn --- src/components/dots.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/dots.js b/src/components/dots.js index 729a4da..bbf73f2 100644 --- a/src/components/dots.js +++ b/src/components/dots.js @@ -1,5 +1,6 @@ // calculate tiles + const RADIUS_OPTS = [ "const", "right", @@ -12,6 +13,7 @@ const RADIUS_OPTS = [ "left-down", "in", "out", + "noise", ]; function distance(dx, dy) { @@ -70,6 +72,8 @@ class DotMaker { return 2 * maxr * distance((d.x - this.cx), (d.y - this.cy)) / this.width; case "in": return 2 * maxr * (0.5 * this.width - distance((d.x - this.cx), (d.y - this.cy))) / this.width; + case "noise": + return maxr * Math.random(); default: return maxr; }