SOURCE

console 命令行工具 X clear

                    
>
console
document.addEventListener('DOMContentLoaded',function(){
  document.oncontextmenu=function(){
			return false;
		};
	let canvas=document.getElementById('canvas');
	canvas.width=canvas.clientWidth;
	canvas.width=canvas.clientHeight;
  //代码区↓↓↓↓↓↓↓↓↓↓
  //1.每次右击,绘制一个随机颜色的50x50大小对的方块在位置上。
	//2,可以拖动方块改变其位置;
  //代码区↑↑↑↑↑↑↑↑↑↑
});
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
</head>
<body>
<canvas id="canvas"></canvas>
</body>
</html>
body{
  margin:0;
  position:absolute;
  width:100%;
  height:100%;
  overflow:hidden;
}
canvas{
  width:100%;
  height:100%;
  background:#e8e8e8;
}