Skip to content

Commit cfa47da

Browse files
author
web3blind
committed
Compact bottom navigation tray
1 parent 9f7bc47 commit cfa47da

4 files changed

Lines changed: 29 additions & 15 deletions

File tree

app/css/main.css

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1451,7 +1451,7 @@ body,
14511451
overflow-x: hidden;
14521452
padding-left: max(12px, env(safe-area-inset-left));
14531453
padding-right: max(12px, env(safe-area-inset-right));
1454-
padding-bottom: calc(180px + env(safe-area-inset-bottom));
1454+
padding-bottom: calc(128px + env(safe-area-inset-bottom));
14551455
}
14561456

14571457
#bottom-nav.show {
@@ -1466,14 +1466,15 @@ body,
14661466
.nav-tab {
14671467
min-width: 0;
14681468
max-width: 100%;
1469-
padding: 6px 2px;
1470-
gap: 1px;
1471-
line-height: 1.05;
1469+
padding: 3px 2px;
1470+
gap: 0;
1471+
line-height: 1;
1472+
min-height: 38px;
14721473
}
14731474

14741475
.nav-icon {
1475-
font-size: 1.05rem;
1476-
margin-bottom: 1px;
1476+
font-size: 0.95rem;
1477+
margin-bottom: 0;
14771478
}
14781479

14791480
.nav-label {
@@ -1482,7 +1483,7 @@ body,
14821483
overflow: hidden;
14831484
text-overflow: ellipsis;
14841485
white-space: nowrap;
1485-
font-size: 0.62rem;
1486+
font-size: 0.56rem;
14861487
}
14871488

14881489
.chronicle-tabs,
@@ -1556,11 +1557,20 @@ body,
15561557
}
15571558

15581559
.screen {
1559-
padding-bottom: calc(260px + env(safe-area-inset-bottom));
1560+
padding-bottom: calc(150px + env(safe-area-inset-bottom));
1561+
}
1562+
1563+
.nav-tab {
1564+
padding: 2px 1px;
1565+
min-height: 34px;
1566+
}
1567+
1568+
.nav-icon {
1569+
font-size: 0.88rem;
15601570
}
15611571

15621572
.nav-label {
1563-
font-size: 0.58rem;
1573+
font-size: 0.52rem;
15641574
}
15651575
}
15661576

app/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<link rel="icon" type="image/png" sizes="192x192" href="assets/icons/viz-magic-192.png?v=20260712c">
1414
<link rel="icon" type="image/png" sizes="512x512" href="assets/icons/viz-magic-512.png?v=20260712c">
1515
<link rel="apple-touch-icon" href="assets/icons/viz-magic-192.png?v=20260712c">
16-
<link rel="stylesheet" href="css/main.css?v=20260712j">
16+
<link rel="stylesheet" href="css/main.css?v=20260712k">
1717
<link rel="stylesheet" href="css/themes.css">
1818
<link rel="stylesheet" href="css/accessibility.css">
1919
</head>

app/sw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Viz Magic — Service Worker
2-
var CACHE_NAME = 'viz-magic-v45';
2+
var CACHE_NAME = 'viz-magic-v46';
33
var ASSETS = [
44
'/',
55
'/index.html',

tests/player-bug-regressions.test.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ test('high-traffic UI narration, screen announcements, and inventory stat labels
343343

344344
test('service worker updates quickly and keeps navigations network-first', function () {
345345
const swJs = read('app/sw.js');
346-
assert.ok(/viz-magic-v45/.test(swJs), 'service worker cache version should be bumped');
346+
assert.ok(/viz-magic-v46/.test(swJs), 'service worker cache version should be bumped');
347347
assert.ok(/self\.skipWaiting\(\)/.test(swJs), 'service worker should activate new cache without waiting for all tabs to close');
348348
assert.ok(/self\.clients\.claim\(\)/.test(swJs), 'service worker should claim clients after activation');
349349
assert.ok(/event\.request\.mode === 'navigate'[\s\S]*fetch\(event\.request\)/.test(swJs), 'navigation requests should prefer network to avoid stale cached index');
@@ -392,7 +392,7 @@ test('mobile entry helpers cover keyboard paste, home-screen shortcut, nav parit
392392
assert.ok(/SoundManager\.setVolume\(sfxVolume \/ 100\)/.test(read('app/js/ui/screens/settings.js')), 'settings should apply stored SFX volume on render');
393393
assert.ok(/localStorage\.setItem\(STORAGE_PREFIX \+ 'sfx_volume'/.test(read('app/js/ui/sound.js')), 'sound manager should persist SFX volume');
394394
assert.ok(/var volume = _getStoredNumber\('sfx_volume', 0\.5\)/.test(read('app/js/ui/sound.js')), 'sound manager should restore persisted SFX volume');
395-
assert.ok(/viz-magic-v45/.test(read('app/sw.js')), 'service worker cache should be bumped for UI changes');
395+
assert.ok(/viz-magic-v46/.test(read('app/sw.js')), 'service worker cache should be bumped for UI changes');
396396
});
397397

398398

@@ -427,10 +427,14 @@ test('Russian crafting naming is unified as Workshop/Masterская', function (
427427

428428

429429
test('mobile shell prevents tray and tab controls from overflowing the viewport', function () {
430-
assert.ok(/padding-bottom:\s*calc\(180px \+ env\(safe-area-inset-bottom\)\)/.test(mainCss), 'screens need enough bottom padding for the two-row mobile tray');
430+
assert.ok(/padding-bottom:\s*calc\(128px \+ env\(safe-area-inset-bottom\)\)/.test(mainCss), 'screens need compact bottom padding for the two-row mobile tray');
431431
assert.ok(/#bottom-nav\.show[\s\S]*display:\s*grid[\s\S]*repeat\(5, minmax\(0, 1fr\)\)/.test(mainCss), 'bottom nav should fit all tabs without horizontal overflow');
432432
assert.ok(/\.nav-tab[\s\S]*min-width:\s*0/.test(mainCss), 'nav tabs must be allowed to shrink inside viewport');
433433
assert.ok(/\.nav-label[\s\S]*text-overflow:\s*ellipsis/.test(mainCss), 'long nav labels should not push tabs off screen');
434+
assert.ok(/\.nav-tab[\s\S]*min-height:\s*38px/.test(mainCss), 'nav tray should be compact enough to preserve game viewport');
435+
assert.ok(/\.nav-icon[\s\S]*font-size:\s*0\.95rem/.test(mainCss), 'nav icons should be smaller but still visible');
436+
assert.ok(/@media \(max-width: 360px\)[\s\S]*grid-template-columns:\s*repeat\(3, minmax\(0, 1fr\)\)/.test(mainCss), 'narrow screens should cap the tray at three rows for nine tabs');
437+
assert.ok(/@media \(max-width: 360px\)[\s\S]*padding-bottom:\s*calc\(150px \+ env\(safe-area-inset-bottom\)\)/.test(mainCss), 'three-row tray should not steal excessive vertical space');
434438
assert.ok(/@media \(max-width: 480px\)[\s\S]*\.chronicle-tabs[\s\S]*grid-template-columns:\s*1fr/.test(mainCss), 'mobile chronicle tabs should stack instead of clipping');
435439
assert.ok(/@media \(max-width: 480px\)[\s\S]*\.craft-tabs[\s\S]*grid-template-columns:\s*1fr/.test(mainCss), 'mobile craft tabs should stack instead of clipping');
436440
assert.ok(/\.recipe-card[\s\S]*flex-wrap:\s*wrap/.test(mainCss), 'recipe cards should wrap on narrow screens');
@@ -457,7 +461,7 @@ test('magical weather is labelled and affects hunts', function () {
457461
assert.ok(/nav.js\?v=20260712b/.test(indexHtml), 'bottom tray nav must be cache-busted');
458462
assert.ok(/leaderboard.js\?v=20260712c/.test(indexHtml), 'leaderboard narrator fix must be cache-busted');
459463
assert.ok(/world-events.js\?v=20260712h/.test(indexHtml), 'world events forecast pool must be cache-busted');
460-
assert.ok(/main.css\?v=20260712j/.test(indexHtml), 'forecast grid CSS must be cache-busted');
464+
assert.ok(/main.css\?v=20260712k/.test(indexHtml), 'forecast grid CSS must be cache-busted');
461465
assert.ok(/season_effect_prefix/.test(homeJs + ruJs + enJs), 'home forecast should explain gameplay effect');
462466
assert.ok(/seasonBonuses\[spell\.school\]/.test(combatJs), 'season school bonus should affect spell attack');
463467
assert.ok(/creatureAttackMod/.test(combatJs), 'weather should affect creature danger in hunt combat');

0 commit comments

Comments
 (0)