-
Notifications
You must be signed in to change notification settings - Fork 28
/
chris.js
58 lines (49 loc) · 1.2 KB
/
chris.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
50
51
52
53
54
55
56
57
58
import ctx, {size} from "./main.js"
const x = 3 * size
const y = 1 * size
// draw a square
ctx.beginPath()
ctx.rect(x, y, size, size)
ctx.fillStyle = 'black'
ctx.fill()
// draw a circle
ctx.beginPath()
// draw a complete circle
ctx.arc(x + size / 2, y + size / 2, 50, 0, Math.PI * 2)
ctx.fillStyle = '#aaaaaa'
ctx.fill()
// draw a circle
ctx.beginPath()
// draw a complete circle
ctx.arc(x + size / 2, y + size / 2, 40, 0, Math.PI * 2)
ctx.fillStyle = '#bbbbbb'
ctx.fill()
// draw a circle
ctx.beginPath()
// draw a complete circle
ctx.arc(x + size / 2, y + size / 2, 30, 0, Math.PI * 2)
ctx.fillStyle = '#cccccc'
ctx.fill()
// draw a circle
ctx.beginPath()
// draw a complete circle
ctx.arc(x + size / 2, y + size / 2, 20, 0, Math.PI * 2)
ctx.fillStyle = '#dddddd'
ctx.fill()
// draw a circle
ctx.beginPath()
// draw a complete circle
ctx.arc(x + size / 2, y + size / 2, 10, 0, Math.PI * 2)
ctx.fillStyle = '#eeeeee'
ctx.fill()
// draw a circle
ctx.beginPath()
// draw a complete circle
ctx.arc(x + size / 2, y + size / 2, 5, 0, Math.PI * 2)
ctx.fillStyle = '#ffffff'
ctx.fill()
// Draw some text
ctx.beginPath()
ctx.font = '18px Helvetica'
ctx.fillStyle = 'white'
ctx.fillText('chris says hi', x + 8, y + 55)