Javascript Canvas: CanvasPractice
The code has been modified slightly and now uploaded to the site.
Source is unknown.
Believed to be arbitrarily made for practice.
CanvasPractice.html
<!DOCTYPE html>
<html lang="en">
<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">
<script src = "CanvasSandbox.js" defer></script>
<title>Document</title>
</head>
<body>
<h1>Canvas Practice</h1>
<canvas id = "myCanvas" width = "800" height = "500" style = "border-style: solid"></canvas>
</body>
</html>
CanvasSandbox.js
let canvas = document.getElementById("myCanvas");
let context = canvas.getContext("2d");
context.fillStyle = "blue";
context.fillRect(100, 100, 200, 200);
context.beginPath();
context.fillStyle = "red";
context.arc(canvas.width / 2, canvas.height / 2, 50, 0, 2 * Math.PI);
context.fill();
context.save();
context.beginPath();
context.fillStyle = "green";
context.translate(600, 200);
context.moveTo(-25, 25);
context.lineTo(0, -25);
context.lineTo(25, 25);
context.lineTo(-25, 25);
context.fill();
context.restore();