function randomColor() {
const r = Math.floor(Math.random() * 256);
const g = Math.floor(Math.random() * 256);
const b = Math.floor(Math.random() * 256);
return rgb(${r}, ${g}, ${b});
}
function animate() { const vw = window.innerWidth; const vh = window.innerHeight; const lw = logo.offsetWidth; const lh = logo.offsetHeight;
x += dx; y += dy;
let collided = false;
if (x + lw >= vw || x <= 0) { dx = -dx; collided = true; } if (y + lh >= vh || y <= 0) { dy = -dy; collided = true; }
if (collided) { logo.style.backgroundColor = randomColor(); }
logo.style.left = ${x}px;
logo.style.top = ${y}px;
requestAnimationFrame(animate); }
animate(); </script>
</body> </html>*