A town simulation in pale isometric line art, implemented with Ritmo ECS and PixiJs 3D
Founding screen: the game's name and its maker, cells on the map, figures in three columns, no line over the buttons
SandroMaglionebe2801843169
diff --git a/src/factory.css b/src/factory.cssindex 0487cb0..55257e8 100644--- a/src/factory.css+++ b/src/factory.css@@ -296,12 +296,18 @@ body { font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;.dialog .preview canvas { display: block; width: 100%; height: auto; aspect-ratio: 1; box-sizing: border-box; background: #e2e9e6; border: 1px solid #c9cec4; border-radius: 4px; image-rendering: pixelated; }.dialog .preview .reroll { position: absolute; right: 8px; bottom: 8px; background: rgba(247, 248, 244, 0.92); font-size: 12px; }.dialog .preview .reroll:hover { background: #f7f8f4; }-.dialog .actions .saved { flex-basis: 100%; min-width: 0; margin: 0 0 2px; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }-.dialog .actions .saved .icon { display: inline-block; margin-right: 6px; vertical-align: -2px; }-.dialog .actions .saved em { font-style: normal; font-weight: 400; color: #8a938c; }/* The charter's figures, in the chips the town's messages use. */.dialog .note { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 7px 0 0; font-size: 12px; color: #8a938c; }.dialog .note .ref { margin: 0; }+/* The game's name on the founding screen, and who made it, as a link. */+.dialog h2.title small { margin-left: 4px; font-size: 13px; font-weight: 400; color: #77817a; }+.dialog h2.title a { color: #2f5a9c; text-decoration: underline; text-decoration-color: #c9d6ee; text-underline-offset: 3px; text-decoration-thickness: 2px; }+.dialog h2.title a:hover { text-decoration-color: #3d6db5; }+.dialog .charter section { margin-top: 22px; }+.dialog .charter section:first-child { margin-top: 16px; }+.dialog .preview .cells { position: absolute; left: 8px; bottom: 8px; margin: 0; padding: 3px 7px 3px 5px; font-size: 12px; background: rgba(247, 248, 244, 0.92); border-color: #c9cec4; }+.dialog .note.facts { display: grid; grid-template-columns: repeat(3, 1fr); }+.dialog .note.facts .ref { text-align: center; }.dialog h3 .glyph { display: inline-flex; margin-right: 6px; vertical-align: -3px; }.dialog .preview .sub { font-size: 12px; }.dialog .facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin: 14px 0; }diff --git a/src/host.ts b/src/host.tsindex bc3def7..ffe3f8e 100644--- a/src/host.ts+++ b/src/host.ts@@ -1341,14 +1341,24 @@ export const createHost = async (ui.founding = truedialog.replaceChildren()const card = el("div", "sheet wide")- card.append(el("h2", "", "found a town"), el("p", "sub", "Pick the land, then grow the town to its goal before the term runs out."))+ const title = el("h2", "title", "Inkline Town ")+ const by = el("small", "by", "by ")+ const author = el("a", "", "Sandro Maglione") as HTMLAnchorElement+ author.href = "https://www.sandromaglione.com/"+ author.target = "_blank"+ author.rel = "noopener"+ by.append(author)+ title.append(by)+ card.append(title, el("p", "sub", "Pick the land, then grow the town to its goal before the term runs out."))const body = el("div", "charter")const options = el("div", "")const preview = el("div", "preview")const mapBox = el("div", "map")const map = document.createElement("canvas")mapBox.append(map)- const facts = el("p", "note")+ const facts = el("p", "note facts")+ const cells = el("span", "ref ware cells")+ mapBox.append(cells)preview.append(mapBox, facts)body.append(options, preview)/** A figure of the charter as the town's messages name things: an icon and a few words. */@@ -1427,10 +1437,8 @@ export const createHost = async (const land = drawLand(map)reroll.title = `Draw other land (this is seed ${choice.seed})`const rocks = land.rocks.filter((r) => !r.ore).length- setHtml(- facts,- chip("pave", `${land.cells} cells`) + chip("wood", `${land.trees.length} trees`) + chip("stone", `${rocks} stone`) + chip("ore", `${land.rocks.length - rocks} ore`)- )+ setHtml(cells, `${icon("pave", 13)}${land.cells} cells`)+ setHtml(facts, chip("wood", `${land.trees.length} trees`) + chip("stone", `${rocks} stone`) + chip("ore", `${land.rocks.length - rocks} ore`))}refresh()const actions = el("div", "actions")@@ -1451,7 +1459,7 @@ export const createHost = async (if (!cancellable && savedTown) {const saved = savedTownconst resume = el("button", "frame", "Continue saved")- resume.title = `Carry on with the town saved in this browser: ${saved.title}`+ resume.title = `Carry on with the town saved in this browser: ${saved.title}${saved.savedAt > 0 ? `, saved ${ago(saved.savedAt)}` : ""}`resume.onclick = () => {const said = persistence().load() ?? "Loaded"ui.toast(said)@@ -1463,9 +1471,6 @@ export const createHost = async (choose("select")setSpeed(1)}- const note = el("p", "saved")- note.innerHTML = `${icon("save", 13)}${escapeHtml(saved.title)}${saved.savedAt > 0 ? ` <em>· saved ${ago(saved.savedAt)}</em>` : ""}`- actions.prepend(note)actions.append(resume)}if (cancellable) {diff --git a/src/phone.css b/src/phone.cssindex 5ee3b47..91df10d 100644--- a/src/phone.css+++ b/src/phone.css@@ -153,6 +153,7 @@.dialog h2 { font-size: 17px; }.dialog .sub { font-size: 12px; }.dialog section { margin-top: 12px; }+ .dialog .charter section { margin-top: 18px; }.dialog .choices .frame { flex: 1; justify-content: center; padding: 8px 6px; }.dialog .chronicle { max-height: none; }}