diff --git a/style.css b/style.css index c4e9dc8..865dba3 100644 --- a/style.css +++ b/style.css @@ -429,7 +429,12 @@ body.touch #quest-tracker .q-card ~ .q-card ~ .q-card { display: none; } @media (max-width: 860px) and (min-height: 521px) { #craft-done { position: sticky; bottom: -1px; z-index: 2; box-shadow: 0 -10px 14px 6px rgba(20, 24, 34, .95); } } +/* Recipe cards: the station badge goes under the ingredients, so long names never push the card wider. */ +.recipe { min-width: 0; grid-template-columns: 44px minmax(0, 1fr) auto; } @media (max-width: 480px) { + .recipe { grid-template-columns: 40px minmax(0, 1fr); row-gap: 4px; } + .recipe img.out { width: 36px; height: 36px; } + .recipe .badge { grid-column: 2; justify-self: start; } .slot-grid { gap: 3px; } #craft .slot-grid .slot .count { font-size: 11px; right: 2px; bottom: 0; } } diff --git a/sw.js b/sw.js index d33d721..e39b47b 100644 --- a/sw.js +++ b/sw.js @@ -1,6 +1,6 @@ // Service worker: caches the whole game so it works offline once loaded. // Bump VERSION whenever files change so players get the update. -const VERSION = 'minicrafter-v22'; +const VERSION = 'minicrafter-v23'; const CORE = [ './', './index.html', './style.css', './manifest.webmanifest', './site-config.json', './icons/icon-192.png', './icons/icon-512.png', './icons/icon-maskable-512.png', './icons/apple-touch-icon.png', './icons/favicon-32.png', diff --git a/tests/smoke.mjs b/tests/smoke.mjs index c9f3c87..c6d2bb2 100644 --- a/tests/smoke.mjs +++ b/tests/smoke.mjs @@ -257,16 +257,16 @@ try { }); ok(touch, 'touch controls appear in touch mode'); // Phones: turning the phone upright pauses and asks for sideways; turning it back carries on. - const shown = (id) => t.page.evaluate((i) => !document.getElementById(i).classList.contains('hidden'), id); + // (Waits for the change itself: CI runners render slowly, so a fixed pause isn't enough.) + const settle = (fn) => t.page.waitForFunction(fn, null, { timeout: 15000 }).then(() => true).catch(() => false); await t.page.setViewportSize({ width: 390, height: 844 }); - await t.page.waitForTimeout(300); - const askedUpright = (await shown('rotate')) && !(await shown('hud')); + const askedUpright = await settle(() => !document.getElementById('rotate').classList.contains('hidden') && document.getElementById('hud').classList.contains('hidden')); await t.page.setViewportSize({ width: 844, height: 390 }); - await t.page.waitForTimeout(300); - const resumed = !(await shown('rotate')) && (await shown('hud')); + const resumed = await settle(() => document.getElementById('rotate').classList.contains('hidden') && !document.getElementById('hud').classList.contains('hidden')); ok(askedUpright && resumed, 'phones: upright pauses and asks to turn sideways, sideways carries on'); - // Phones: the survival crafting panel fits an upright phone (its 9-slot rows used to push it sideways). - await t.page.setViewportSize({ width: 375, height: 667 }); + // Phones: the survival crafting panel fits an upright phone (its 9-slot rows used to push it + // sideways). 360px is a common Android width, and the narrowest that matters. + await t.page.setViewportSize({ width: 360, height: 740 }); const craftOverflow = await t.page.evaluate(async () => { const m = window.minicrafter; m.setMode('survival'); m.forcePlay(); m.openOverlay(); await new Promise((r) => setTimeout(r, 300));