Did some arrows stuff

This commit is contained in:
2026-03-27 21:18:36 +01:00
parent 535a4584aa
commit a3707f25b3
2 changed files with 19 additions and 9 deletions

View File

@@ -3,9 +3,12 @@
// Arrows go from the bottom-center of the source
// to the top-center of the target.
const CONNECTIONS = [
['n0', 'n1'],
['n1', 'n2'],
['n2', 'n3'],
['proj', 'fich'],
['proj', 'hack'],
['fich', 'rust'],
['rust', 'alac'],
['hack', 'alac'],
['alac', 'mine'],
];
// ─── Setup ────────────────────────────────────────────────────
@@ -65,6 +68,13 @@ function redraw() {
};
pathEls[i].setAttribute('d', manhattanPath(r1, r2));
if (tgt.left > src.left) {
pathEls[i].style.stroke = "#008000";
} else if (tgt.left < src.left){
pathEls[i].style.stroke = "#ff0000";
} else {
pathEls[i].style.stroke = "#0000ff";
}
});
}