Pessoal, boa tarde! Abaixo deixo minha resolução para o exercício das flores.
<!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">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
}
div {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
border: 3px double brown;
padding: 25px;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
}
div h1 {
margin-bottom: 5px;
color: brown;
}
canvas {
scale: (0.1);
animation: .8s ease-in-out 0s 1 normal both running aparecimento
}
@keyframes aparecimento {
from {
transform: scale(0.1);
}
to {
transform: scale(1.0);
}
}
</style>
<title>Flor</title>
</head>
<body>
<div>
<h1>Uma inofensiva flor...</h1>
<canvas width="600" height="400"></canvas>
</div>
<script>
function desenhaCirculo(x, y, raio, cor) {
pincel.beginPath();
pincel.fillStyle = cor;
pincel.arc(x, y, raio, 0, 2 * 3.14);
pincel.fill();
}
var tela = document.querySelector("canvas");
var pincel = tela.getContext("2d");
pincel.fillStyle = "lightgray";
pincel.fillRect(0, 0, 600, 400);
desenhaCirculo(260, 200, 20, "orange");
desenhaCirculo(300, 160, 20, "yellow");
desenhaCirculo(300, 200, 20, "red");
desenhaCirculo(300, 240, 20, "blue");
desenhaCirculo(340, 200, 20, "black");
</script>
</body>
</html>