<script>
let plane = document.getElementById("plane");
let n = 0;
function movePlane(){
if (true){
n = n + 1;
plane.style.transform="scale(-1,1)";
plane.style.left = n+"px";
console.lof(n+1)
}
setInterval(movePlane, 10);
if (false){
n=n-1;
plane.style.transform="scale(1,1)";
plane.style.left=n+"px";
console.lof(n-1)
}
setInterval(movePlane, 10);
}
</script>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<code lang="css">
<style>
img{
position:absolute;
width: 220px;
transform: scale(-1,1);
}
</style>
</code>
</head>
<body>
<img src="/img/самолет.png" id="plane" alt="">
<code lang="javascript">
<script>
let plane = document.getElementById("plane");
let n = 0;
function movePlane(){
n = n + 1;
plane.style.left = n+"px";
}
setInterval(movePlane, 10);
}else if
n=n-1;
plane.style.transform="scale(1,1)";
plane.style.left=n+"px";
}
setInterval(movePlane, 10);
</script>
</code>
</body>
</html>