From bbcc4798c959efe9a0056da85224409c418dec9d Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 30 Sep 2023 00:47:39 +0200 Subject: Add village names as HTML text. --- play.css | 90 ++-------------------------------- play.html | 150 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ play.js | 10 ++-- tools/labels.js | 31 ++++++++++++ 4 files changed, 189 insertions(+), 92 deletions(-) create mode 100644 tools/labels.js diff --git a/play.css b/play.css index cdf7f1e..a813b9f 100644 --- a/play.css +++ b/play.css @@ -84,76 +84,18 @@ main { position: absolute; text-align: center; font-family: "Source Serif SmText"; - //font-weight: bold; font-size: 10px; + width: 70px; line-height: 1em; color: black; - text-shadow: - -1px -1px 1px white, - 1px -1px 1px white, - 1px 1px 1px white, - -1px 1px 1px white, - 0 0 6px white - ; + text-shadow: 0 0 2px white; } -#label_3002, -#label_1217, -#label_1204, -#label_1737, -#label_3925, -#label_2911 -{ +.label.caps { font-size: 14px; font-variant: small-caps; } -#label_1015, -#label_1018, -#label_1021, -#label_1024, -#label_1100, -#label_1201, -#label_1239, -#label_1401, -#label_1407, -#label_1830, -#label_1928, -#label_2035, -#label_2123, -#label_2223, -#label_2327, -#label_2537, -#label_2715, -#label_3013, -#label_3031, -#label_3206, -#label_3226, -#label_3231, -#label_3233, -#label_3441, -#label_3719, -#label_3723, -#label_3803 -{ - margin-top: -10px -} - -#label_1800, -#label_2324, -#label_2500, -#label_3327, -#label_3708 -{ - margin-top: -30px; -} - -#label_1118 -{ - margin-top: -15px; - margin-left: 10px; -} - .hex { box-sizing: border-box; position: absolute; @@ -188,32 +130,6 @@ main { background-color: #f006; } -.hexside { - position: absolute; - display: none; - transform-origin: 0 0; - width: 58px; - height: 4px; -} - -.hexside.s1 { transform: rotate(-60deg) } -.hexside.s2 { transform: rotate(-120deg) } - -.hexside.road { - display: block; - background-color: brown; -} - -.hexside.river { - display: block; - background-color: blue; -} - -.hexside.road.river { - display: block; - background-color: green; -} - .large { position: absolute; background-size: 84px auto; diff --git a/play.html b/play.html index 01691a8..49ed1c0 100644 --- a/play.html +++ b/play.html @@ -58,6 +58,156 @@
+
+ +
Binche
+
Charleroi
+
Namur
+
Nivelles
+
Braine
le Comte
+
Wavre
+ +
Montigny
le Tilleul
+
Couillet
+
Bouffioulx
+
Marcinelle
+
Presles
+
Le Roux
+
Fosses
+
Floreffe
+
Malonne
+
Dave
+
Nanine
+
Marchienne
au Pont
+
Auveloix
+
Ham sur Sambre
+ +
Estinnes
au Mont
+
Estinnes
au Val
+
Fontaine l'Évêque
+
Anderlues
+
Haine St Pierre
+
Bray
+
Strépy
+
Trivières
+
Thieu
+
Mont Ste Aldegonde
+
Houdeng-Gœgnies
+
Rœulx
+
Chapelle
lez Herlaimont
+
Gouy lez Piéton
+ +
Montigny
sur Sambre
+
Châtelet
+
Farcienne
+
Jumet
+
Gosselies
+
Vieuville
+
Thuméon
+
Heppignies
+
Wangenies
+
Lambusart
+
Fleurus
+
Mellet
+
Velaine
+ +
Seneffe
+
Arquesnes
+
Marche
lez Écaussines
+
Écaussinnes
+
Naast
+
Virginal
+
Rebecq
+
Hennuières
+
Tubize
+
Ittre
+
Braine le Château
+
Saintes
+
Halle
+
Ophain
+
Braine l'Alleud
+ +
Lillois
+
Hougoumont
+
La Haye
Sainte
+
La Haye
+
Waterloo
+
Mont St Jean
+ +
Ligny
+
Bry
+
St Amand
+
Wagnelée
+
St Martin
+
Onoz
+
Spy
+
Jemeppe
+
Soye
+
Temploux
+
Sombreffe
+
Corroy le Château
+ +
Rèves
+
Frasnes
+
Villers
Perwin
+
Hautain
le Val
+
Quatre Bras
+ +
Ohain
+
Chapelle
St Lambert
+
Genval
+
Planchenoit
+
Maransart
+
Limal
+
Ottignies
+ +
Genappe
+
Beaulers
+
Bousseval
+ +
Rhisnes
+
Bossière
+
Gembloux
+
Sauvenière
+
St Denis
+
Warisoulx
+
Dhuy
+
Grand Leez
+
Liernu
+
Longchamps
+
Éghezée
+
Aische en Refail
+ +
Villers
la Ville
+
Melioreux
+
Tilly
+
Gentinnes
+
Courtil
+
Ernage
+
Marbais
+
Hévillers
+
Mont
St Guibert
+
Corbaix
+
Nil St Martin
+
Walhain
+
Sart lez Walhain
+
Tourinnes
+
Orbais
+
Thorembais
St Trond
+
Perwez
+
Mont St André
+
Foulz
+
Ramillies
+
Hottomont
+
Glimes
+
Jodoigne
+
Roux Miroir
+
Longueville
+
Chaumont
+
Dion le Mont
+
Corroy
le Grand
+ +
diff --git a/play.js b/play.js index 9a5b1c1..75e92d2 100644 --- a/play.js +++ b/play.js @@ -30,11 +30,11 @@ function find_piece(name) { for (let info of data.reinforcements) info.list = info.list.map(name => find_piece(name)) -let yoff = 1555 -let xoff = 36 -let hex_dx = 58.67 -let hex_dy = 68 -let hex_r = 56 >> 1 +const yoff = 1555 +const xoff = 36 +const hex_dx = 58.67 +const hex_dy = 68 +const hex_r = 56 >> 1 function set_has(set, item) { if (!set) diff --git a/tools/labels.js b/tools/labels.js new file mode 100644 index 0000000..c739825 --- /dev/null +++ b/tools/labels.js @@ -0,0 +1,31 @@ +const data = require('../data.js') + +const yoff = 1555 +const xoff = 36 +const hex_dx = 58.67 +const hex_dy = 68 +const hex_r = 56 >> 1 + +const CAPS = [ 1204, 1217, 1737, 2911, 3002, 3925 ] + +var hex_x = [] +var hex_y = [] + +for (let row = 0; row < data.map.rows; ++row) { + for (let col = 0; col < data.map.cols; ++col) { + let hex_id = 1000 + 100 * row + col + hex_x[hex_id] = Math.floor(xoff + hex_dx * (col + (row & 1) * 0.5 + 0.5)) + hex_y[hex_id] = Math.floor(yoff - hex_dy * 3 / 4 * row + hex_dy/2) + } +} + +for (let hex in data.map.names) { + hex = hex | 0 + let name = data.map.names[hex] + let x = hex_x[hex] - 35 + let y = hex_y[hex] + if (CAPS.includes(hex)) + console.log(`
${name}
`) + else + console.log(`
${name}
`) +} -- cgit v1.2.3