function right2_m() {
const ml = document.getElementById("box")
let left = ml.style.transform
left = left.split(',', 2)
left[0] = Number(left[0].replace(/\D/g,''));
left[1] = Number(left[1].replace(/\D/g,''));
//console.log("вправо" + left[0] + " x " + left[1])
let new_x = left[0] + 30;
ml.style.transform = 'translate(' + new_x + 'px,' + left[1] + 'px)'
}
function bottom2_m() {
const m2 = document.getElementById("box")
let left2 = m2.style.transform
left2 = left2.split(',', 2)
left2[0] = Number(left2[0].replace(/\D/g,''));
left2[1] = Number(left2[1].replace(/\D/g,''));
//console.log("влево" + left2[0] + " x " + left2[1])
let new_y = left2[1] + 30;
m2.style.transform = 'translate(' + left2[1] + 'px,' + new_y + 'px)'
}
Весь код выложить не получилось, ссылка
https://disk.yandex.ru/d/QQ82r_r_VDCZnA