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) {