diff --git a/components/NetField.tsx b/components/NetField.tsx index 19e1342..56fc021 100644 --- a/components/NetField.tsx +++ b/components/NetField.tsx @@ -174,23 +174,31 @@ export default function NetField() { // Zeiger: kurze Verbindungen zu nahen Punkten if (pointer) { + const reach = 170; + ctx.lineWidth = 1.75; + ctx.strokeStyle = orange; for (let i = 0; i < nodes.length; i++) { const d = Math.hypot(P[i][0] - pointer.x, P[i][1] - pointer.y); - if (d > 130) continue; - ctx.globalAlpha = (1 - d / 130) * 0.5; - ctx.strokeStyle = orange; + if (d > reach) continue; + ctx.globalAlpha = 0.25 + (1 - d / reach) * 0.7; ctx.beginPath(); ctx.moveTo(pointer.x, pointer.y); ctx.lineTo(P[i][0], P[i][1]); ctx.stroke(); } + ctx.globalAlpha = 1; + ctx.fillStyle = orange; + ctx.beginPath(); + ctx.arc(pointer.x, pointer.y, 3, 0, Math.PI * 2); + ctx.fill(); + ctx.lineWidth = 1; ctx.strokeStyle = blue; } // Punkte for (let i = 0; i < nodes.length; i++) { const n = nodes[i]; - const near = pointer ? Math.max(0, 1 - Math.hypot(P[i][0] - pointer.x, P[i][1] - pointer.y) / 130) : 0; + const near = pointer ? Math.max(0, 1 - Math.hypot(P[i][0] - pointer.x, P[i][1] - pointer.y) / 170) : 0; const r = n.r * (1 + near * 0.6); if (n.hub) { ctx.globalAlpha = 0.25 + 0.15 * Math.sin(t * 1.4 + n.ph);