From 7b98e9c6efd97470248fb244a20c3dacb2942cd1 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 17 Mar 2024 14:30:04 +0100 Subject: Add initial client. --- play.css | 80 +++++++++++++++++++++++++++++++++++++++++++++ play.html | 110 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ play.js | 19 +++++++++++ rules.js | 17 ++++++++++ 4 files changed, 226 insertions(+) create mode 100644 play.css create mode 100644 play.html create mode 100644 play.js diff --git a/play.css b/play.css new file mode 100644 index 0000000..72819b0 --- /dev/null +++ b/play.css @@ -0,0 +1,80 @@ + +#mapwrap { + width: 2485px; + height: 1654px; + margin-bottom: 30px; +} + +#map { + position: absolute; + width: 2485px; + height: 1654px; + background-size: cover; + background-image: url(Maria.Gameboard.075.jpg); + background-color: #ece1a9; +} + +#political_display { + position: relative; + margin: 0 auto; + width: 1169px; + height: 827px; + background-size: cover; + background-image: url(Maria.Political.Display.100.jpg); + background-color: #ece1a9; +} + +body { + background-color: slategray; +} + +.panel { + background-color: #444; + width: clamp(824px, calc(100% - 30px), 1636px); + margin: 12px auto 36px auto; + box-shadow: 1px 2px 6px #0004; + border: 1px solid #0008; +} + +.panel_header { + color: white; + font-weight: bold; + text-align: center; + padding: 3px 1em; + border-bottom: 1px solid #0008; +} + +.panel_body { + background-color: #555; + display: flex; + justify-content: start; + flex-wrap: wrap; + padding: 18px; + gap: 18px; + min-height: 350px; +} + +.city { + position: absolute; + width: 18px; + height: 18px; + border-radius: 100%; + background-color: green; +} + +.minor_fortress { + position: absolute; + width: 26px; + height: 26px; + border-radius: 0%; + background-color: green; +} + +.major_fortress { + position: absolute; + width: 26px; + height: 26px; + border-radius: 50%; + background-color: green; +} + diff --git a/play.html b/play.html new file mode 100644 index 0000000..84933cc --- /dev/null +++ b/play.html @@ -0,0 +1,110 @@ + + + + + + + +MARIA + + + + + + + + + + +
+
+
+ + +
  • Rules +
  • Cards +
  • +
    +
    +
    + + + +
    + +
    +
    +
    + + + +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    Defend
    +
    +
    +
    + +
    +
    Attack
    +
    +
    +
    + +
    +
    Prussia
    +
    +
    +
    + +
    +
    Bavaria
    +
    +
    +
    + +
    +
    France
    +
    +
    +
    + +
    +
    Saxony
    +
    +
    +
    + +
    +
    Pragmatic Army
    +
    +
    +
    + +
    +
    Austria
    +
    +
    +
    + +
    + + + + diff --git a/play.js b/play.js new file mode 100644 index 0000000..96a53b9 --- /dev/null +++ b/play.js @@ -0,0 +1,19 @@ +const cities = data.cities +const last_city = cities.name.length - 1 + +const ui = { + map_pieces: document.getElementById("pieces"), + cities: [], +} + +function on_init() { + for (let s = 0; s <= last_city; ++s) { + let e = ui.cities[s] = document.createElement("div") + e.className = "city" + e.style.left = (cities.x[s] - 9) + "px" + e.style.top = (cities.y[s] - 9) + "px" + map_pieces.appendChild(e) + } +} + +on_init() diff --git a/rules.js b/rules.js index 1c63a36..bd95570 100644 --- a/rules.js +++ b/rules.js @@ -1,2 +1,19 @@ exports.roles = [ "Maria Theresa", "Frederick", "Louis XV" ] exports.scenarios = [ "Standard", "Introductory" ] + +exports.setup = function (seed, scenario, options) { + return { + seed: seed, + log: [], + undo: [], + active: 0, // player + power: 0, // power + state: "setup", + } +} + +exports.view = function (state) { + return { + log: state.log + } +} -- cgit v1.2.3