Add independent amoeba number visibility toggle
This commit is contained in:
parent
cc91a4adee
commit
99434917b9
23 changed files with 153 additions and 26 deletions
|
|
@ -64,10 +64,24 @@ try {
|
|||
await page.locator(".phase-instruction").textContent(),
|
||||
"Replay",
|
||||
);
|
||||
await page.locator('[data-ui="numbers-view"]').click();
|
||||
assert.equal(
|
||||
await page.locator(".organisms .amoeba-number:visible").count(),
|
||||
0,
|
||||
);
|
||||
assert.ok(await page.locator(".amoeba-button").first().isVisible());
|
||||
await page.locator('[data-ui="food-view"]').click();
|
||||
assert.equal(await page.locator(".amoeba-button:visible").count(), 0);
|
||||
assert.ok(await page.locator(".nutrients").first().isVisible());
|
||||
await page.locator('[data-ui="food-view"]').click();
|
||||
assert.equal(
|
||||
await page.locator(".organisms .amoeba-number:visible").count(),
|
||||
0,
|
||||
);
|
||||
await page.locator('[data-ui="numbers-view"]').click();
|
||||
assert.ok(
|
||||
await page.locator(".organisms .amoeba-number").first().isVisible(),
|
||||
);
|
||||
await page.locator('.water-cell[data-cell="6"]').click({ force: true });
|
||||
await page.locator(".amoeba-button").first().click();
|
||||
await page.locator('[data-ui="genes"]').first().click();
|
||||
|
|
|
|||
|
|
@ -59,12 +59,54 @@ try {
|
|||
// Food inspection is local, persists across updates, and never submits a move.
|
||||
const crowded = structuredClone(s);
|
||||
crowded.amoebas.slice(1, 4).forEach((a) => (a.cell = 6));
|
||||
crowded.amoebas[0].hp = 1;
|
||||
crowded.amoebas[1].hp = 2;
|
||||
await show(crowded);
|
||||
const foodToggle = page.locator('[data-ui="food-view"]');
|
||||
const numbersToggle = page.locator('[data-ui="numbers-view"]');
|
||||
const foodBefore = await page.locator(".nutrients").allTextContents();
|
||||
await page
|
||||
.locator(".board-wrap")
|
||||
.screenshot({ path: `/tmp/soup-food-before-${width}.png` });
|
||||
const amoebaLabels = await page
|
||||
.locator(".organisms .amoeba-button")
|
||||
.evaluateAll((buttons) =>
|
||||
buttons.map((button) => button.getAttribute("aria-label")),
|
||||
);
|
||||
if (width <= 390) await numbersToggle.tap();
|
||||
else await numbersToggle.click();
|
||||
assert.equal(await numbersToggle.getAttribute("aria-pressed"), "true");
|
||||
assert.equal(
|
||||
await numbersToggle.getAttribute("aria-label"),
|
||||
"Show amoeba numbers",
|
||||
);
|
||||
assert.equal(
|
||||
await page.locator(".organisms .amoeba-number:visible").count(),
|
||||
0,
|
||||
);
|
||||
assert.equal(await page.locator(".organisms .injury:visible").count(), 2);
|
||||
assert.equal(
|
||||
await page.locator(".amoeba-button:visible").count(),
|
||||
crowded.amoebas.length,
|
||||
);
|
||||
assert.deepEqual(await page.evaluate(() => moves), []);
|
||||
await show(crowded);
|
||||
assert.equal(
|
||||
await page.locator(".organisms .amoeba-number:visible").count(),
|
||||
0,
|
||||
);
|
||||
assert.deepEqual(
|
||||
await page
|
||||
.locator(".organisms .amoeba-button")
|
||||
.evaluateAll((buttons) =>
|
||||
buttons.map((button) => button.getAttribute("aria-label")),
|
||||
),
|
||||
amoebaLabels,
|
||||
"Number hiding preserves accessible identities and injuries",
|
||||
);
|
||||
await page
|
||||
.locator(".board-wrap")
|
||||
.screenshot({ path: `/tmp/soup-injuries-${width}.png` });
|
||||
// Hold near the edge: a press animation must not move the target out
|
||||
// from under the pointer before release, cancelling the click.
|
||||
await foodToggle.scrollIntoViewIfNeeded();
|
||||
|
|
@ -97,6 +139,16 @@ try {
|
|||
await swim.click();
|
||||
assert.ok(await page.locator(".amoeba-button").first().isVisible());
|
||||
assert.equal(await foodToggle.getAttribute("aria-pressed"), "false");
|
||||
assert.equal(
|
||||
await page.locator(".organisms .amoeba-number:visible").count(),
|
||||
0,
|
||||
);
|
||||
assert.equal(await page.locator(".organisms .injury:visible").count(), 2);
|
||||
await numbersToggle.click();
|
||||
assert.equal(
|
||||
await page.locator(".organisms .amoeba-number:visible").count(),
|
||||
crowded.amoebas.length,
|
||||
);
|
||||
await show(s);
|
||||
assert.match(await swim.getAttribute("aria-label"), /1 biological point/);
|
||||
// A deterministic drift offers undo; cancelling uses the real protocol move.
|
||||
|
|
|
|||
|
|
@ -129,6 +129,7 @@ const iconPaths = {
|
|||
shield:
|
||||
'<path d="m12 2 9 4v7q-2 6-9 9-7-3-9-9V6Z"/><path d="m8 12 3 3 5-6"/>',
|
||||
food: '<rect x="3" y="5" width="7" height="7" rx="2"/><rect x="13" y="12" width="7" height="7" rx="2"/>',
|
||||
numbers: '<path d="M5 9h15M4 15h15M11 3 7 21M18 3l-4 18"/>',
|
||||
eye: '<path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7Z"/><circle cx="12" cy="12" r="3"/>',
|
||||
swap: '<path d="M3 7h17m-4-4 4 4-4 4M21 17H4m4-4-4 4 4 4"/>',
|
||||
link: '<path d="m10 8 3-3a4 4 0 0 1 6 6l-3 3m-2 2-3 3a4 4 0 0 1-6-6l3-3m1 5 6-6"/>',
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ registerViewer(
|
|||
ctx.target.querySelector(".board"),
|
||||
size,
|
||||
"#eef1e5",
|
||||
".pond-tools, .board-actions, .board-visibility",
|
||||
".pond-tools, .board-actions, .board-display-controls",
|
||||
);
|
||||
},
|
||||
async onPreferences(preferences) {
|
||||
|
|
|
|||
|
|
@ -1203,5 +1203,7 @@
|
|||
"Population Explosion · Free placement until you have {p0} amoebas.": "Befolkningseksplosion · Gratis placering indtil du har {p0} amøber.",
|
||||
"Show amoebas": "Vis amøber",
|
||||
"Tap a highlighted space to place an amoeba · {p0}.": "Tryk på et fremhævet felt for at placere en amøbe · {p0}.",
|
||||
"You may create as many amoebas as you can afford, up to seven. Choose Finish division to keep your remaining 2 BP.": "Du kan skabe så mange amøber, som du har råd til, op til syv. Afslut med Afslut deling for at beholde dine resterende 2 BP."
|
||||
"You may create as many amoebas as you can afford, up to seven. Choose Finish division to keep your remaining 2 BP.": "Du kan skabe så mange amøber, som du har råd til, op til syv. Afslut med Afslut deling for at beholde dine resterende 2 BP.",
|
||||
"Hide amoeba numbers": "Skjul amøbernes numre",
|
||||
"Show amoeba numbers": "Vis amøbernes numre"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1203,5 +1203,7 @@
|
|||
"Population Explosion · Free placement until you have {p0} amoebas.": "Populationsexplosion · Kostenlose Platzierung, bis du {p0} Amöben hast.",
|
||||
"Show amoebas": "Amöben anzeigen",
|
||||
"Tap a highlighted space to place an amoeba · {p0}.": "Tippe auf ein markiertes Feld, um eine Amöbe zu platzieren · {p0}.",
|
||||
"You may create as many amoebas as you can afford, up to seven. Choose Finish division to keep your remaining 2 BP.": "Du darfst so viele Amöben erstellen, wie du dir leisten kannst, bis zu sieben. Schließe mit Teilung beenden ab, um deine restlichen 2 BP zu behalten."
|
||||
"You may create as many amoebas as you can afford, up to seven. Choose Finish division to keep your remaining 2 BP.": "Du darfst so viele Amöben erstellen, wie du dir leisten kannst, bis zu sieben. Schließe mit Teilung beenden ab, um deine restlichen 2 BP zu behalten.",
|
||||
"Hide amoeba numbers": "Amöbennummern ausblenden",
|
||||
"Show amoeba numbers": "Amöbennummern anzeigen"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1203,5 +1203,7 @@
|
|||
"Population Explosion · Free placement until you have {p0} amoebas.": "Πληθυσμιακή Έκρηξη · Δωρεάν τοποθέτηση μέχρι να έχεις {p0} αμοιβάδες.",
|
||||
"Show amoebas": "Εμφάνιση αμοιβάδων",
|
||||
"Tap a highlighted space to place an amoeba · {p0}.": "Πάτησε σε μια επισημασμένη θέση για να τοποθετήσεις μια αμοιβάδα · {p0}.",
|
||||
"You may create as many amoebas as you can afford, up to seven. Choose Finish division to keep your remaining 2 BP.": "Μπορείς να δημιουργήσεις όσες αμοιβάδες μπορείς να αντέξεις οικονομικά, έως επτά. Τελείωσε με Ολοκλήρωση διαίρεσης για να κρατήσεις τους υπόλοιπους 2 ΒΠ."
|
||||
"You may create as many amoebas as you can afford, up to seven. Choose Finish division to keep your remaining 2 BP.": "Μπορείς να δημιουργήσεις όσες αμοιβάδες μπορείς να αντέξεις οικονομικά, έως επτά. Τελείωσε με Ολοκλήρωση διαίρεσης για να κρατήσεις τους υπόλοιπους 2 ΒΠ.",
|
||||
"Hide amoeba numbers": "Απόκρυψη αριθμών αμοιβάδων",
|
||||
"Show amoeba numbers": "Εμφάνιση αριθμών αμοιβάδων"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1203,5 +1203,7 @@
|
|||
"Population Explosion · Free placement until you have {p0} amoebas.": "Population Explosion · Free placement until you have {p0} amoebas.",
|
||||
"Show amoebas": "Show amoebas",
|
||||
"Tap a highlighted space to place an amoeba · {p0}.": "Tap a highlighted space to place an amoeba · {p0}.",
|
||||
"You may create as many amoebas as you can afford, up to seven. Choose Finish division to keep your remaining 2 BP.": "You may create as many amoebas as you can afford, up to seven. Choose Finish division to keep your remaining 2 BP."
|
||||
"You may create as many amoebas as you can afford, up to seven. Choose Finish division to keep your remaining 2 BP.": "You may create as many amoebas as you can afford, up to seven. Choose Finish division to keep your remaining 2 BP.",
|
||||
"Hide amoeba numbers": "Hide amoeba numbers",
|
||||
"Show amoeba numbers": "Show amoeba numbers"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1203,5 +1203,7 @@
|
|||
"Population Explosion · Free placement until you have {p0} amoebas.": "انفجار جمعیت · جایگذاری رایگان تا {p0} آمیب.",
|
||||
"Show amoebas": "نمایش آمیبها",
|
||||
"Tap a highlighted space to place an amoeba · {p0}.": "برای قرار دادن آمیب، خانهٔ مشخصشده را لمس کنید · {p0}.",
|
||||
"You may create as many amoebas as you can afford, up to seven. Choose Finish division to keep your remaining 2 BP.": "تا جایی که پول دارید، حداکثر هفت آمیب بسازید. «پایان تقسیم» را بزنید تا ۲ امتیاز زیستی باقی بماند."
|
||||
"You may create as many amoebas as you can afford, up to seven. Choose Finish division to keep your remaining 2 BP.": "تا جایی که پول دارید، حداکثر هفت آمیب بسازید. «پایان تقسیم» را بزنید تا ۲ امتیاز زیستی باقی بماند.",
|
||||
"Hide amoeba numbers": "پنهان کردن شمارهٔ آمیبها",
|
||||
"Show amoeba numbers": "نمایش شمارهٔ آمیبها"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1203,5 +1203,7 @@
|
|||
"Population Explosion · Free placement until you have {p0} amoebas.": "Explosion démographique · Placement gratuit jusqu’à {p0} amibes.",
|
||||
"Show amoebas": "Afficher les amibes",
|
||||
"Tap a highlighted space to place an amoeba · {p0}.": "Touchez une case en surbrillance pour placer une amibe · {p0}.",
|
||||
"You may create as many amoebas as you can afford, up to seven. Choose Finish division to keep your remaining 2 BP.": "Tu peux créer autant d'amibes que tu peux te le permettre, jusqu'à sept. Termine avec Terminer la division pour conserver tes 2 PB restants."
|
||||
"You may create as many amoebas as you can afford, up to seven. Choose Finish division to keep your remaining 2 BP.": "Tu peux créer autant d'amibes que tu peux te le permettre, jusqu'à sept. Termine avec Terminer la division pour conserver tes 2 PB restants.",
|
||||
"Hide amoeba numbers": "Masquer les numéros des amibes",
|
||||
"Show amoeba numbers": "Afficher les numéros des amibes"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1203,5 +1203,7 @@
|
|||
"Population Explosion · Free placement until you have {p0} amoebas.": "जनसंख्या विस्फोट · मुफ़्त स्थापन जब तक तुम्हारे पास {p0} अमीबा न हों।",
|
||||
"Show amoebas": "अमीबा दिखाएँ",
|
||||
"Tap a highlighted space to place an amoeba · {p0}.": "अमीबा रखने के लिए हाइलाइट किए गए स्थान पर टैप करें · {p0}.",
|
||||
"You may create as many amoebas as you can afford, up to seven. Choose Finish division to keep your remaining 2 BP.": "आप जितने अमीबा खरीद सकते हैं उतने बना सकते हैं, अधिकतम सात तक। अपने बचे हुए 2 BP रखने के लिए विभाजन समाप्त करें के साथ समाप्त करें।"
|
||||
"You may create as many amoebas as you can afford, up to seven. Choose Finish division to keep your remaining 2 BP.": "आप जितने अमीबा खरीद सकते हैं उतने बना सकते हैं, अधिकतम सात तक। अपने बचे हुए 2 BP रखने के लिए विभाजन समाप्त करें के साथ समाप्त करें।",
|
||||
"Hide amoeba numbers": "अमीबा के नंबर छिपाएँ",
|
||||
"Show amoeba numbers": "अमीबा के नंबर दिखाएँ"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1203,5 +1203,7 @@
|
|||
"Population Explosion · Free placement until you have {p0} amoebas.": "Esplosione Demografica · Piazzamento gratuito finché non hai {p0} amebe.",
|
||||
"Show amoebas": "Mostra le amebe",
|
||||
"Tap a highlighted space to place an amoeba · {p0}.": "Tocca una casella evidenziata per posizionare un’ameba · {p0}.",
|
||||
"You may create as many amoebas as you can afford, up to seven. Choose Finish division to keep your remaining 2 BP.": "Puoi creare tutte le amebe che puoi permetterti, fino a sette. Concludi con Termina divisione per mantenere i tuoi 2 PB rimanenti."
|
||||
"You may create as many amoebas as you can afford, up to seven. Choose Finish division to keep your remaining 2 BP.": "Puoi creare tutte le amebe che puoi permetterti, fino a sette. Concludi con Termina divisione per mantenere i tuoi 2 PB rimanenti.",
|
||||
"Hide amoeba numbers": "Nascondi i numeri delle amebe",
|
||||
"Show amoeba numbers": "Mostra i numeri delle amebe"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1203,5 +1203,7 @@
|
|||
"Population Explosion · Free placement until you have {p0} amoebas.": "개체수 폭발 · 아메바 {p0}마리가 될 때까지 무료 배치.",
|
||||
"Show amoebas": "아메바 표시",
|
||||
"Tap a highlighted space to place an amoeba · {p0}.": "강조된 칸을 눌러 아메바를 배치하세요 · {p0}.",
|
||||
"You may create as many amoebas as you can afford, up to seven. Choose Finish division to keep your remaining 2 BP.": "감당할 수 있는 만큼 아메바를 최대 7개까지 만들 수 있습니다. 분열 종료를 눌러 남은 BP 2를 지키세요."
|
||||
"You may create as many amoebas as you can afford, up to seven. Choose Finish division to keep your remaining 2 BP.": "감당할 수 있는 만큼 아메바를 최대 7개까지 만들 수 있습니다. 분열 종료를 눌러 남은 BP 2를 지키세요.",
|
||||
"Hide amoeba numbers": "아메바 번호 숨기기",
|
||||
"Show amoeba numbers": "아메바 번호 표시"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1203,5 +1203,7 @@
|
|||
"Population Explosion · Free placement until you have {p0} amoebas.": "Populatie-explosie · Gratis plaatsen totdat je {p0} amoeben hebt.",
|
||||
"Show amoebas": "Amoeben tonen",
|
||||
"Tap a highlighted space to place an amoeba · {p0}.": "Tik op een gemarkeerd vak om een amoebe te plaatsen · {p0}.",
|
||||
"You may create as many amoebas as you can afford, up to seven. Choose Finish division to keep your remaining 2 BP.": "Je mag zoveel amoeben maken als je kunt betalen, tot zeven. Eindig met Deling beëindigen om je resterende 2 BP te behouden."
|
||||
"You may create as many amoebas as you can afford, up to seven. Choose Finish division to keep your remaining 2 BP.": "Je mag zoveel amoeben maken als je kunt betalen, tot zeven. Eindig met Deling beëindigen om je resterende 2 BP te behouden.",
|
||||
"Hide amoeba numbers": "Amoebenummers verbergen",
|
||||
"Show amoeba numbers": "Amoebenummers tonen"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1203,5 +1203,7 @@
|
|||
"Population Explosion · Free placement until you have {p0} amoebas.": "Eksplozja populacji · Darmowe umieszczanie, dopóki nie masz {p0} ameb.",
|
||||
"Show amoebas": "Pokaż ameby",
|
||||
"Tap a highlighted space to place an amoeba · {p0}.": "Dotknij podświetlonego pola, aby umieścić amebę · {p0}.",
|
||||
"You may create as many amoebas as you can afford, up to seven. Choose Finish division to keep your remaining 2 BP.": "Możesz stworzyć tyle ameb, na ile cię stać, maksymalnie siedem. Zakończ przyciskiem Zakończ podział, aby zachować pozostałe 2 PB."
|
||||
"You may create as many amoebas as you can afford, up to seven. Choose Finish division to keep your remaining 2 BP.": "Możesz stworzyć tyle ameb, na ile cię stać, maksymalnie siedem. Zakończ przyciskiem Zakończ podział, aby zachować pozostałe 2 PB.",
|
||||
"Hide amoeba numbers": "Ukryj numery ameb",
|
||||
"Show amoeba numbers": "Pokaż numery ameb"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1203,5 +1203,7 @@
|
|||
"Population Explosion · Free placement until you have {p0} amoebas.": "Explosão Populacional · Colocação grátis até você ter {p0} amebas.",
|
||||
"Show amoebas": "Mostrar amebas",
|
||||
"Tap a highlighted space to place an amoeba · {p0}.": "Toque em um espaço destacado para colocar uma ameba · {p0}.",
|
||||
"You may create as many amoebas as you can afford, up to seven. Choose Finish division to keep your remaining 2 BP.": "Você pode criar quantas amebas puder pagar, até sete. Termine com Encerrar divisão para manter seus 2 PB restantes."
|
||||
"You may create as many amoebas as you can afford, up to seven. Choose Finish division to keep your remaining 2 BP.": "Você pode criar quantas amebas puder pagar, até sete. Termine com Encerrar divisão para manter seus 2 PB restantes.",
|
||||
"Hide amoeba numbers": "Ocultar números das amebas",
|
||||
"Show amoeba numbers": "Mostrar números das amebas"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1203,5 +1203,7 @@
|
|||
"Population Explosion · Free placement until you have {p0} amoebas.": "Explozie demografică · Plasare gratuită până când ai {p0} amibe.",
|
||||
"Show amoebas": "Arată amibele",
|
||||
"Tap a highlighted space to place an amoeba · {p0}.": "Atinge un spațiu evidențiat pentru a plasa o amibă · {p0}.",
|
||||
"You may create as many amoebas as you can afford, up to seven. Choose Finish division to keep your remaining 2 BP.": "Poți crea atâtea amibe câte îți permiți, până la șapte. Termină cu Încheie diviziunea pentru a-ți păstra restul de 2 PB."
|
||||
"You may create as many amoebas as you can afford, up to seven. Choose Finish division to keep your remaining 2 BP.": "Poți crea atâtea amibe câte îți permiți, până la șapte. Termină cu Încheie diviziunea pentru a-ți păstra restul de 2 PB.",
|
||||
"Hide amoeba numbers": "Ascunde numerele amibelor",
|
||||
"Show amoeba numbers": "Arată numerele amibelor"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1203,5 +1203,7 @@
|
|||
"Population Explosion · Free placement until you have {p0} amoebas.": "Демографический взрыв · Бесплатное размещение, пока у тебя не будет {p0} амёб.",
|
||||
"Show amoebas": "Показать амёб",
|
||||
"Tap a highlighted space to place an amoeba · {p0}.": "Нажмите на подсвеченную клетку, чтобы разместить амёбу · {p0}.",
|
||||
"You may create as many amoebas as you can afford, up to seven. Choose Finish division to keep your remaining 2 BP.": "Ты можешь создать столько амёб, сколько можешь себе позволить, до семи. Заверши ход кнопкой «Завершить деление», чтобы сохранить оставшиеся 2 БО."
|
||||
"You may create as many amoebas as you can afford, up to seven. Choose Finish division to keep your remaining 2 BP.": "Ты можешь создать столько амёб, сколько можешь себе позволить, до семи. Заверши ход кнопкой «Завершить деление», чтобы сохранить оставшиеся 2 БО.",
|
||||
"Hide amoeba numbers": "Скрыть номера амёб",
|
||||
"Show amoeba numbers": "Показать номера амёб"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1203,5 +1203,7 @@
|
|||
"Population Explosion · Free placement until you have {p0} amoebas.": "Bùng nổ dân số · Đặt miễn phí cho đến khi bạn có {p0} amip.",
|
||||
"Show amoebas": "Hiện amip",
|
||||
"Tap a highlighted space to place an amoeba · {p0}.": "Chạm vào ô được đánh dấu để đặt một amip · {p0}.",
|
||||
"You may create as many amoebas as you can afford, up to seven. Choose Finish division to keep your remaining 2 BP.": "Bạn có thể tạo bao nhiêu amip tùy khả năng chi trả, tối đa bảy con. Kết thúc bằng Kết thúc phân chia để giữ 2 BP còn lại."
|
||||
"You may create as many amoebas as you can afford, up to seven. Choose Finish division to keep your remaining 2 BP.": "Bạn có thể tạo bao nhiêu amip tùy khả năng chi trả, tối đa bảy con. Kết thúc bằng Kết thúc phân chia để giữ 2 BP còn lại.",
|
||||
"Hide amoeba numbers": "Ẩn số của amip",
|
||||
"Show amoeba numbers": "Hiện số của amip"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1203,5 +1203,7 @@
|
|||
"Population Explosion · Free placement until you have {p0} amoebas.": "种群爆发 · 免费放置,直到你拥有 {p0} 只变形虫。",
|
||||
"Show amoebas": "显示变形虫",
|
||||
"Tap a highlighted space to place an amoeba · {p0}.": "点击高亮格子放置一只变形虫 · {p0}。",
|
||||
"You may create as many amoebas as you can afford, up to seven. Choose Finish division to keep your remaining 2 BP.": "只要生物点数足够,你就可以创建变形虫,最多七只。选择“结束分裂”以保留剩余的 2 BP。"
|
||||
"You may create as many amoebas as you can afford, up to seven. Choose Finish division to keep your remaining 2 BP.": "只要生物点数足够,你就可以创建变形虫,最多七只。选择“结束分裂”以保留剩余的 2 BP。",
|
||||
"Hide amoeba numbers": "隐藏变形虫编号",
|
||||
"Show amoeba numbers": "显示变形虫编号"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1203,5 +1203,7 @@
|
|||
"Population Explosion · Free placement until you have {p0} amoebas.": "族群爆炸 · 免費放置直到你擁有 {p0} 隻變形蟲。",
|
||||
"Show amoebas": "顯示變形蟲",
|
||||
"Tap a highlighted space to place an amoeba · {p0}.": "點擊高亮格子放置變形蟲 · {p0}.",
|
||||
"You may create as many amoebas as you can afford, up to seven. Choose Finish division to keep your remaining 2 BP.": "你可以創造任意數量的變形蟲,最多七隻,只要點數足夠。完成後點擊「結束分裂」以保留剩餘的 2 點生物點數。"
|
||||
"You may create as many amoebas as you can afford, up to seven. Choose Finish division to keep your remaining 2 BP.": "你可以創造任意數量的變形蟲,最多七隻,只要點數足夠。完成後點擊「結束分裂」以保留剩餘的 2 點生物點數。",
|
||||
"Hide amoeba numbers": "隱藏變形蟲編號",
|
||||
"Show amoeba numbers": "顯示變形蟲編號"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -292,6 +292,9 @@
|
|||
border-color: var(--amoeba-ink);
|
||||
box-shadow: 0 1px 2px #24433a44;
|
||||
}
|
||||
.soup.numbers-hidden .organisms .amoeba-number {
|
||||
display: none;
|
||||
}
|
||||
.injury {
|
||||
position: absolute;
|
||||
display: flex;
|
||||
|
|
@ -485,15 +488,20 @@
|
|||
}
|
||||
.soup .pond-tools {
|
||||
position: absolute;
|
||||
top: calc(2% + 14px);
|
||||
right: calc(1% + 52px);
|
||||
top: calc(2% + 52px);
|
||||
right: 1%;
|
||||
z-index: 1;
|
||||
}
|
||||
.soup .board-visibility {
|
||||
.soup .board-display-controls {
|
||||
position: absolute;
|
||||
right: 1%;
|
||||
top: 2%;
|
||||
z-index: 2;
|
||||
display: flex;
|
||||
gap: 4px;
|
||||
}
|
||||
.soup .board-visibility {
|
||||
flex: none;
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
padding: 10px;
|
||||
|
|
@ -1440,11 +1448,14 @@
|
|||
|
||||
@media (max-width: 1000px) {
|
||||
.soup .board-wrap {
|
||||
padding-top: 28px;
|
||||
padding-top: 48px;
|
||||
}
|
||||
.soup .board-display-controls {
|
||||
top: -48px;
|
||||
}
|
||||
.soup .pond-tools {
|
||||
top: -24px;
|
||||
right: 1%;
|
||||
top: -34px;
|
||||
right: calc(1% + 100px);
|
||||
}
|
||||
.player-income .income-unit {
|
||||
display: none;
|
||||
|
|
|
|||
19
viewer/ui.js
19
viewer/ui.js
|
|
@ -248,7 +248,7 @@ export function mountGame(
|
|||
target.append(root);
|
||||
root.innerHTML = `<header class="topbar"><div class="brand"><span>${amoeba("green", 0)}</span><div><h1 translate="no">primordial soup<span class="title-dot">.</span></h1><span class="byline" translate="no">DORIS MATTHÄUS & FRANK NESTEL</span></div></div><nav class="utilities" aria-label="Game options"><button class="icon-button" data-ui="undo-move" aria-label="Undo my move" title="Undo my move" hidden>${icon("undo")}</button><button class="quiet-button" data-ui="genes" aria-label="Genes" title="Gene pool">${icon("gene")}<span class="utility-label">Genes</span></button><button class="icon-button" data-ui="colony-symbols" aria-label="Color-blind mode" aria-pressed="${colonySymbols}" title="Color-blind mode: match colonies by symbol">${icon("colony-symbols")}</button><button class="icon-button" data-ui="rules" aria-label="How to play">${icon("help")}</button><button class="icon-button" data-ui="fullscreen" aria-label="Fullscreen">${icon("expand")}</button></nav></header>
|
||||
<div class="tutorial-slot"></div><section class="players" aria-label="The colonies" data-tutorial="colonies"></section>
|
||||
<main class="play-area"><section class="pond-section" aria-label="Primordial soup board"><div class="board-wrap"><div class="board" data-tutorial="board"><div class="pond-tools">${chat ? `<button class="quiet-button" data-ui="chat">${icon("chat")} Chat</button>` : ""}<button class="quiet-button" data-ui="journal">${icon("history")} Journal</button></div><button class="icon-button board-visibility" data-ui="food-view" aria-pressed="false" aria-label="Hide amoebas" title="Hide amoebas">${icon("food")}</button><svg id="pond-art" viewBox="0 0 900 650" preserveAspectRatio="none" aria-hidden="true">${pondArt()}</svg><div class="cells"></div><div class="organisms"></div><div class="current-compass" data-tutorial="current"><div class="environment-current"><span>CURRENT</span><div class="compass-arrow">➜</div><b class="compass-label"></b></div><div class="environment-ozone" role="img" tabindex="0" title="${OZONE_HELP}"><span class="ozone-value">${icon("ozone")}<strong class="ozone"></strong></span></div></div></div><div class="board-actions" data-tutorial="movement" hidden></div><div class="board-reference"><div class="game-progress"></div><aside class="soup-board-key" data-tutorial="scoring" aria-label="Scoring reference"></aside></div></div><div class="private-forecast" hidden></div><div class="pond-bottom"><div class="last-move" aria-live="polite"></div><span class="food-reserve" title="Food cubes remaining in the common supply"></span></div></section><aside class="colony-panel" data-tutorial="colony"></aside></main>
|
||||
<main class="play-area"><section class="pond-section" aria-label="Primordial soup board"><div class="board-wrap"><div class="board" data-tutorial="board"><div class="pond-tools">${chat ? `<button class="quiet-button" data-ui="chat">${icon("chat")} Chat</button>` : ""}<button class="quiet-button" data-ui="journal">${icon("history")} Journal</button></div><div class="board-display-controls"><button class="icon-button board-visibility" data-ui="numbers-view" aria-pressed="false" aria-label="Hide amoeba numbers" title="Hide amoeba numbers">${icon("numbers")}</button><button class="icon-button board-visibility" data-ui="food-view" aria-pressed="false" aria-label="Hide amoebas" title="Hide amoebas">${icon("food")}</button></div><svg id="pond-art" viewBox="0 0 900 650" preserveAspectRatio="none" aria-hidden="true">${pondArt()}</svg><div class="cells"></div><div class="organisms"></div><div class="current-compass" data-tutorial="current"><div class="environment-current"><span>CURRENT</span><div class="compass-arrow">➜</div><b class="compass-label"></b></div><div class="environment-ozone" role="img" tabindex="0" title="${OZONE_HELP}"><span class="ozone-value">${icon("ozone")}<strong class="ozone"></strong></span></div></div></div><div class="board-actions" data-tutorial="movement" hidden></div><div class="board-reference"><div class="game-progress"></div><aside class="soup-board-key" data-tutorial="scoring" aria-label="Scoring reference"></aside></div></div><div class="private-forecast" hidden></div><div class="pond-bottom"><div class="last-move" aria-live="polite"></div><span class="food-reserve" title="Food cubes remaining in the common supply"></span></div></section><aside class="colony-panel" data-tutorial="colony"></aside></main>
|
||||
<footer class="turnbar" data-tutorial="actions"><div class="round"><span>ROUND</span><strong class="round-number"></strong></div><div class="turn-details"><div class="phase-label"></div><div class="phase-instruction" aria-live="polite"></div><ol class="phase-steps" aria-label="Round phases"></ol></div><div class="action-buttons"></div></footer><div class="game-message" role="alert"></div>
|
||||
<div class="activity-slot"></div><dialog><button class="close-modal icon-button" data-ui="close" aria-label="Close">×</button><div class="modal-content"></div></dialog>`;
|
||||
const $ = (q) => root.querySelector(q),
|
||||
|
|
@ -278,7 +278,8 @@ export function mountGame(
|
|||
placementNotice,
|
||||
mealSource,
|
||||
buyableOnly = false,
|
||||
foodView = false;
|
||||
foodView = false,
|
||||
numbersHidden = false;
|
||||
const dialog = $("dialog");
|
||||
const activity = mountActivity($(".activity-slot"), {
|
||||
chat,
|
||||
|
|
@ -414,6 +415,14 @@ export function mountGame(
|
|||
: "";
|
||||
return `<button class="water-cell ${move ? "valid" : ""} ${move?.type === "drift" ? "drift" : ""} ${last ? "last-cell" : ""}" data-cell="${cell}" data-destination="${esc(destination)}" aria-label="Space ${coordinate(cell)}${move ? " · " + esc(moveLabel(move, state)) : ""}" ${move ? "" : 'aria-disabled="true"'}>${move ? `<span class="cell-destination" aria-hidden="true">${richText(destination)}</span>` : ""}<span class="cell-coord">${coordinate(cell)}</span><span class="nutrients">${nutrients(state.food[cell])}</span>${state.toxins?.[cell] ? `<span class="toxin-marker" title="${state.toxins[cell]} toxic injuries for the next entrant">☣ ${state.toxins[cell]}</span>` : ""}</button>`;
|
||||
}).join("");
|
||||
root.classList.toggle("numbers-hidden", numbersHidden);
|
||||
const numbersToggle = $('[data-ui="numbers-view"]');
|
||||
numbersToggle.setAttribute("aria-pressed", String(numbersHidden));
|
||||
const numbersLabel = numbersHidden
|
||||
? "Show amoeba numbers"
|
||||
: "Hide amoeba numbers";
|
||||
numbersToggle.setAttribute("aria-label", numbersLabel);
|
||||
numbersToggle.title = numbersLabel;
|
||||
$(".organisms").hidden = foodView;
|
||||
$(".organisms").innerHTML = state.amoebas
|
||||
.map((a) => {
|
||||
|
|
@ -771,6 +780,12 @@ export function mountGame(
|
|||
dialog.close();
|
||||
return;
|
||||
}
|
||||
if (el.dataset.ui === "numbers-view") {
|
||||
numbersHidden = !numbersHidden;
|
||||
render();
|
||||
$('[data-ui="numbers-view"]').focus({ preventScroll: true });
|
||||
return;
|
||||
}
|
||||
if (el.dataset.ui === "food-view") {
|
||||
foodView = !foodView;
|
||||
render();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue