From 24af3c33ac4c0575f454493b73ca9b3c51fd5fcf Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Wed, 8 Apr 2020 05:12:44 -0600 Subject: [PATCH] add particle multiplier parameter --- js/particles.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/particles.js b/js/particles.js index 7911308..fb546c9 100644 --- a/js/particles.js +++ b/js/particles.js @@ -1,4 +1,4 @@ -function particles(avoidMouse = true, hover = true) { +function particles(avoidMouse = true, hover = true, particles = 2) { /* create particles animation based on the amazing tutorial by 'Franks Labratory' https://youtu.be/d620nV6bp0A @@ -91,7 +91,7 @@ function particles(avoidMouse = true, hover = true) { function init(){ particlesArray = []; let numberOfParticles = (canvas.height * canvas.width) / 9000; - for (let i = 0; i < numberOfParticles * 2; i++){ + for (let i = 0; i < numberOfParticles * particles; i++){ let size = (Math.random() * 5) + 1; let x = (Math.random() * ((innerWidth - size * 2) - (size * 2)) + size * 2); let y = (Math.random() * ((innerHeight - size * 2) - (size * 2)) + size * 2);