forked from soggybag/shared-canvas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Ernest.js
49 lines (41 loc) · 1.03 KB
/
Ernest.js
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import ctx, { size } from './main.js'
const canvas = document.querySelector("canvas");
const ctx = canvas.getContext("2d");
const size = 113;
const x = 0 * size;
const y = 0 * size;
ctx.beginPath();
ctx.scale(4, 4);
ctx.arc(30 + x, 21 + y, 10, 0, Math.PI * 2, false);
ctx.stroke();
ctx.fillStyle = "black";
ctx.strokeStyle = "white";
ctx.stroke();
ctx.fill();
ctx.closePath();
ctx.beginPath();
ctx.arc(30 + x, 21 + y, 10, 0, Math.PI * 2, false);
ctx.stroke();
ctx.fillStyle = "white";
ctx.closePath();
ctx.beginPath();
ctx.scale(0.5, 0.5);
ctx.arc(60 + x, 42 + y, 10, 0, Math.PI * 2, false);
ctx.fillStyle = "rgb(31, 31, 31)";
ctx.strokeStyle = "rgb(31, 31, 31)";
ctx.stroke();
ctx.fill();
ctx.beginPath();
ctx.scale(0.4, 0.4);
ctx.arc(150 + x, 105 + y, 10, 0, Math.PI * 2, false);
ctx.fillStyle = "red";
ctx.strokeStyle = "red";
ctx.stroke();
ctx.fill();
ctx.beginPath();
ctx.scale(0.2, 0.2);
ctx.arc(750 + x, 525 + y, 10, 0, Math.PI * 2, false);
ctx.fillStyle = "rgb(133, 9, 0)";
ctx.strokeStyle = "rgb(133, 9, 0)";
ctx.stroke();
ctx.fill();