diff --git a/voicegardens/static/voicegardens.js b/voicegardens/static/voicegardens.js index 56c65ff..cca8b91 100644 --- a/voicegardens/static/voicegardens.js +++ b/voicegardens/static/voicegardens.js @@ -209,8 +209,10 @@ class GeneratedShape { // Number of edges of the shape this.edges = amplitude + 3; - // ??? - this.radius = random(120, 140); + // The distance between the xs and ys influencing the size of the shape. + // The randomXs, randomYs also influence the shape size as they are added + // when drawing the space between xs and ys. + this.radius = ceil(duration * 40); // ??? this.angle = radians(360 / this.edges); @@ -232,8 +234,11 @@ class GeneratedShape { this.ys[i] = 0; this.xs[i] = 0; this.angles[i] = 0; - this.randXs[i] = random(-77, 77); - this.randYs[i] = random(-77, 77); + + // this directly influences the shape of the size alongside the + // this.radius shape value + this.randXs[i] = ceil(duration * random(-30, 30)); + this.randYs[i] = ceil(duration * random(-30, 30)); } for (let i = 0; i < this.edges; i++) {