Puzzles on phones: fixed overlays that never scroll
A bar pinned at the top holds the puzzle's state (name, stars, money, undo, menu), the goal being worked on with Show me, and a chip per flow that opens its city. A city or a link opens a short card at the bottom, split into tabs (links, router, traffic; size, traffic, routing) that each fit on a 360 px phone, portrait or landscape. Architect runs get the same bar. Reset moves to the menu on phones. Desktop is unchanged. The old swipe-up sheet and its peek state are gone.
This commit is contained in:
parent
d7fb2a9617
commit
107b0b825a
10 changed files with 292 additions and 39 deletions
|
|
@ -54,17 +54,18 @@ test('delivered eyeballs are chips; Back to my network lives in the menu, not in
|
|||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('on a phone held upright the sheet starts as its status bar, and the bar opens it', () => {
|
||||
test('a phone gets the fixed bar (tests/puzzles-phone.test.js), a desktop the whole card', () => {
|
||||
const { ev, dom, errors } = load();
|
||||
ev("window.innerWidth=360;window.innerHeight=740;dispatchEvent(new Event('resize'))");
|
||||
begin(ev);
|
||||
assert.equal(box(dom).classList.contains('mini'), true, 'peek');
|
||||
assert.equal(box(dom).classList.contains('dock'), true, 'the bar');
|
||||
ev('ACT.pzRetry()');
|
||||
assert.equal(box(dom).classList.contains('mini'), true, 'a fresh try of the same puzzle keeps the sheet as the player left it');
|
||||
assert.equal(box(dom).classList.contains('dock'), true, 'a fresh try keeps it');
|
||||
const { ev: ev2, dom: dom2 } = load();
|
||||
ev2("window.innerWidth=1280;window.innerHeight=800;dispatchEvent(new Event('resize'))");
|
||||
begin(ev2);
|
||||
assert.equal(box(dom2).classList.contains('mini'), false, 'a desktop shows the whole card');
|
||||
assert.equal(box(dom2).classList.contains('dock'), false, 'a desktop shows the whole card');
|
||||
assert.ok(box(dom2).querySelector('.pztop .pzgoals'), 'with its three goals');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue