<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bolinha</title>
</head>
<body>
<canvas width="600" height="400"></canvas>
<script>
var canvas = document.querySelector('canvas');
var context = canvas.getContext('2d');
context.fillStyle = 'grey';
context.fillRect(0, 0, 600, 400);
var raio = 10
function desenhaCirculo(evento) {
var x = evento.pageX - canvas.offsetLeft;
var y = evento.pageY - canvas.offsetTop;
if (evento.shiftKey)
if(raio <= 40)
raio+=20;
if(evento.altKey)
if(raio>10)
raio-=5;
context.fillStyle = 'blue';
context.beginPath();
context.arc(x, y, raio, 0, 2 * 3.14);
context.fill();
}
canvas.addEventListener('click', desenhaCirculo);
</script>
</body>
</html>