summaryrefslogtreecommitdiff
path: root/tools/makelayout.js
blob: c1872543261606b70e1349eab1ac9a3d599e30a5 (plain)
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
const PROVINCES = [
    "Andhra",
    "Bengal",
    "Gondwana",
    "Gujarat",
    "Jaunpur",
    "Karnataka",
    "Madhyadesh",
    "Maharashtra",
    "Malwa",
    "Orissa",
    "Rajput Kingdoms",
    "Sindh",
    "Tamilakam",
    "Delhi",
    "Mountain Passes",
    "Punjab",
]

const print = console.log

print('<?xml version="1.0" encoding="UTF-8"?>')
print('<svg')
print('\txmlns="http://www.w3.org/2000/svg"')
print('\txmlns:xlink="http://www.w3.org/1999/xlink"')
print('\txmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"')
print('\txmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"')
print('\twidth="1275" height="1650">')
print('<image xlink:href="map75.jpg" x="0" y="0" width="1275" height="1650" image-rendering="pixelated" sodipodi:insensitive="true" />')

const COLORS = {
	DS: "black",
	BK: "cyan",
	VE: "yellow",
	mongols: "red",
}

let x = -700, y = 100

function advancex() {
	x += 150
}

function advancey() {
	x -= 150 * 4
	y += 100
}

for (let s of PROVINCES) {
	// faction holdings - 100x80 ellipse
	print(`<text x="${x-100}" y="${y}" text-anchor="end" font-size="40">${s}</text>`)
	for (let f of [ "DS", "BK", "VE", "mongols" ]) {
		print(`<ellipse inkscape:label="${s} ${f}" cx="${x}" cy="${y}" rx="40" ry="30" fill="${COLORS[f]}" fill-opacity="0.5" />`)
		advancex()
	}
	advancey()
}

print('</svg>')