HTMLcopy
1
<div id="container"></div>
CSScopy
6
1
html, body, #container {
2
width: 100%;
3
height: 100%;
4
margin: 0;
5
padding: 0;
6
}
JavaScriptcopy
x
1
// set stage
2
var stage = acgraph.create("container");
3
4
// draw a circle
5
stage.circle(200, 250, 100)
6
.stroke("red")
7
.zIndex(2)
8
.fill(["gold", "white"],30);
9
10
// create a square behind the Deathly Hallows symbol
11
stage.rect(25, 50, 350, 300)
12
.fill("grey 0.1");
13
14
// draw a triangle
15
stage.path().moveTo(25, 350)
16
.lineTo(200, 50)
17
.lineTo(375, 350)
18
.stroke("red")
19
.fill("navy")
20
.zIndex(1)
21
.close();
22
23
// draw a wand in the middle
24
stage.path().moveTo(200,50)
25
.lineTo(200,350)
26
.zIndex(3)
27
.stroke("red");