diff options
Diffstat (limited to 'tools/makelayout.js')
-rw-r--r-- | tools/makelayout.js | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/tools/makelayout.js b/tools/makelayout.js new file mode 100644 index 0000000..c187254 --- /dev/null +++ b/tools/makelayout.js @@ -0,0 +1,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>') |