-
Notifications
You must be signed in to change notification settings - Fork 0
/
mondrian.no.2.js
60 lines (48 loc) · 1.62 KB
/
mondrian.no.2.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
59
60
var c2 = document.getElementById("no2");
var verticalOne = c2.getContext("2d");
var horizontalOne = c2.getContext("2d");
var horizontalTwo = c2.getContext("2d");
var horizontalThree = c2.getContext("2d");
var regionOne = c2.getContext("2d");
var regionTwo = c2.getContext("2d");
var regionThree = c2.getContext("2d");
var regionFour = c2.getContext("2d");
var regionFive = c2.getContext("2d");
var regionSix = c2.getContext("2d")
// Create the first vertial line from left to right
verticalOne.beginPath();
verticalOne.moveTo(140,0);
verticalOne.lineTo(140,200);
verticalOne.lineWidth=3; <!--to increase the width of the stroke-->
verticalOne.stroke();
// Create the first horizontal line from top to bottom
horizontalOne.moveTo(0,60);
horizontalOne.lineTo(200,60);
horizontalOne.stroke();
// Create the second horizontal line from top to bottom
horizontalTwo.moveTo(140,120);
horizontalTwo.lineTo(200,120);
horizontalTwo.stroke();
// Create the third horizontal line from top to bottom
horizontalThree.moveTo(0,199);
horizontalThree.lineTo(140,199);
horizontalThree.stroke();
regionOne.fillStyle = "#FF0000";
regionOne.fillRect(0,0,140,60);
regionTwo.fillStyle = "#FFFFFF";
regionTwo.fillRect(140,0,60,60);
regionThree.fillStyle = "#FFFFFF";
regionThree.fillRect(0,60,140,200);
regionFour.fillStyle = "#01579B";
regionFour.fillRect(140,60,60,60);
regionFive.fillStyle = "#FFFFFF";
regionFive.fillRect(140,120,60,80);
// Extra blank lines to deal with layering issues
var sLast = c2.getContext("2d");
sLast.moveTo(0,0);
sLast.lineTo(0,0);
sLast.stroke();
var lLast = c2.getContext("2d");
lLast.moveTo(0,0);
lLast.lineTo(0,0);
lLast.stroke();