From 16bb8510246f5cac7b8f494bd5942b4850880bfe Mon Sep 17 00:00:00 2001 From: Ben Burlingham Date: Sat, 11 Nov 2017 15:40:15 -0800 Subject: [PATCH] Stashing WIP. --- js/controls.js | 1 - js/particle.js | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/js/controls.js b/js/controls.js index 28eb235..f883466 100644 --- a/js/controls.js +++ b/js/controls.js @@ -99,7 +99,6 @@ function createCountControl(container, initialValue, max) { }); count$.subscribe((value) => { - console.warn('count changed! ', value) text.innerHTML = (value === 1) ? '1 particle' : `${value} particles`; }); diff --git a/js/particle.js b/js/particle.js index 12ab707..72ee3d0 100644 --- a/js/particle.js +++ b/js/particle.js @@ -157,8 +157,8 @@ Particle.prototype.updateLeader = function(particles) { return; } + // Head-to-head: particles see eachother but shouldn't both lead. if (this.leader === null && particles.length > 0) { - // Head-to-head: particles see eachother but shouldn't both lead. const candidates = particles .filter(v => v.leader ? (v.leader.id !== this.id) : true); @@ -301,6 +301,8 @@ function updateVisionGrid(arc, config, grids) { function repaintContainer(node, arc, leaderTime) { node.style.left = `${arc.endX}px`; node.style.top = `${arc.endY}px`; + + node.style.zIndex = (leaderTime > 0 ? 2000 : 2); } function repaintBody(node, arc, leaderTime) { @@ -309,6 +311,8 @@ function repaintBody(node, arc, leaderTime) { : RAD.t360 - arc.theta; node.style.transform = `rotate(${rad + RAD.t45}rad)`; + + node.style.border = (leaderTime > 0 ? '3px dotted #fff' : ''); } function repaintCircle(node, arc) {