const maxDist = Math.sqrt((this.size.x - 1)** 2 + (this.size.y - 1) ** 2);
const multFact = (distance - 1) / (maxDist - 1); //1 == minDist
const duration = 0.2 + multFact * 0.3;
const maxDist = Math.sqrt((this.size.x - 1)** 2 + (this.size.y - 1) ** 2);
const multFact = (distance - 1) / (maxDist - 1); //1 == minDist
const duration = 0.2 + multFact * 0.3;
startPiece.style.transform =
`translate(${arrival[0] + rs[0]}px, ${arrival[1] + rs[1]}px)`;
startPiece.style.transitionDuration = duration + "s";
startPiece.style.transform =
`translate(${arrival[0] + rs[0]}px, ${arrival[1] + rs[1]}px)`;
startPiece.style.transitionDuration = duration + "s";