-
Notifications
You must be signed in to change notification settings - Fork 13
/
canvas.html
35 lines (29 loc) · 736 Bytes
/
canvas.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!DOCTYPE html>
<html>
<body>
<canvas id="canvas" width="60" height="85" >
Your browser does not support the HTML5 canvas tag.</canvas>
<script>
var canvas = document.getElementById('canvas');
if (canvas.getContext) {
var ctx = canvas.getContext('2d');
ctx.beginPath();
ctx.arc(30, 30, 25, 25, Math.PI * 2, true); // Outer circle
ctx.moveTo(5, 35);
ctx.lineTo(30, 80);
ctx.lineTo(55, 35);
ctx.lineWidth = 3;
ctx.stroke();
ctx.fillStyle ="#E31013";
ctx.fill();
ctx.beginPath();
ctx.arc(30, 30, 10, 0, Math.PI * 2, true); // Outer circle
ctx.fillStyle ="#FFFFFF";
ctx.fill();
ctx.beginPath();
ctx.arc(30, 30, 30, 0, Math.PI * 2, true); // Outer circle
ctx.stroke();
}
</script>
</body>
</html>