From 9da32e5d17ec88503d1fac5e61307c2157ee26df Mon Sep 17 00:00:00 2001 From: juergen Date: Wed, 12 Sep 2018 13:10:15 +0200 Subject: [PATCH] Neuter animation to prevent excessive power usage. --- js/eyecandy.js | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/js/eyecandy.js b/js/eyecandy.js index 9c61f90..2ea11bf 100644 --- a/js/eyecandy.js +++ b/js/eyecandy.js @@ -114,35 +114,19 @@ // animation function initAnimation() { animate(); - for(var i in points) { - shiftPoint(points[i]); - } } function animate() { if(animateHeader) { ctx.clearRect(0,0,width,height); for(var i in points) { - // detect points in range - if(Math.abs(getDistance(target, points[i])) < 4000) { - points[i].active = 0.3; - points[i].circle.active = 0.6; - } else if(Math.abs(getDistance(target, points[i])) < 20000) { - points[i].active = 0.1; - points[i].circle.active = 0.3; - } else if(Math.abs(getDistance(target, points[i])) < 40000) { - points[i].active = 0.02; - points[i].circle.active = 0.1; - } else { - points[i].active = 0; - points[i].circle.active = 0; - } + points[i].active = 0.3; + points[i].circle.active = 0.6; drawLines(points[i]); points[i].circle.draw(); } } - requestAnimationFrame(animate); } function shiftPoint(p) {