mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-20 18:22:25 +00:00
fix(cockpit): keep the phone Display/Radio row clear of the DEST cue
Above the compass block the centred row covered the DEST route-direction label and chevron at 320-390 px, and its fixed +182px offset pushed it off the top of short landscape screens. Place it between the roll scale and the reticle from a viewport-aware visor inset instead, keep it on screen below the vision controls on short landscape phones, and centre Cyber's expanded panel on the Reset/Exit axis. The unit test now asserts the pointer-events contract and Cyber centring; the browser QA adds the DEST cue to the clearance check, hit-tests each launcher glyph and covers 740x360 and 667x240.
This commit is contained in:
1 parent
1165286c7b
commit
4b8a407ba2
6 files changed
+87
-43
No files matched your search
@@ -1137,16 +1137,25 @@ test('mobile Cockpit prioritizes flight instruments and collision-safe controls'
|
||||
assert.match(mobileCockpit[1], /body\.cockpit-mode #intel-hud/);
|
||||
assert.match(mobileCockpit[1], /body\.cockpit-mode \.cockpit-context-window/);
|
||||
assert.match(mobileCockpit[1], /body\.cockpit-mode \.cockpit-signal-window/);
|
||||
// The collapsed Display/Radio row is centred on the Reset/Exit axis and
|
||||
// anchored above the compass block, not at a fixed offset that covered the
|
||||
// ground speed and altitude readouts; the compass reads the same anchor.
|
||||
assert.match(
|
||||
mobileCockpit[1],
|
||||
/body\.cockpit-mode \.cockpit-utility-controls \{[\s\S]*?bottom:\s*calc\(var\(--cockpit-compass-bottom\) \+ 182px\);[\s\S]*?left:\s*12px;[\s\S]*?justify-content:\s*center;/,
|
||||
/body\.cockpit-mode \.cockpit-utility-controls \{[^}]*?top:\s*clamp\(\s*72px,\s*calc\(46% - 68px\),\s*calc\(var\(--cockpit-visor-top\) \+ 108px\)\s*\);[^}]*?left:\s*12px;[^}]*?justify-content:\s*center;[^}]*?pointer-events:\s*none;/,
|
||||
);
|
||||
assert.match(
|
||||
mobileCockpit[1],
|
||||
/body\.cockpit-mode \.cockpit-utility-control \{\s*pointer-events:\s*auto;\s*\}/,
|
||||
);
|
||||
assert.doesNotMatch(mobileCockpit[1], /bottom:\s*152px;/);
|
||||
assert.match(css, /\.cockpit-compass \{[\s\S]*?bottom:\s*var\(--cockpit-compass-bottom\);/);
|
||||
assert.match(css, /--cockpit-compass-bottom:\s*clamp\(44px, 7vh, 72px\);/);
|
||||
assert.match(css, /--cockpit-visor-top:\s*clamp\(62px, 9vh, 90px\);/);
|
||||
assert.match(css, /\.cockpit-visor-shell \{[^}]*?inset:\s*var\(--cockpit-visor-top\)/);
|
||||
assert.match(
|
||||
css,
|
||||
/:root\[data-ui-theme='cyber'\] body\.cockpit-mode \.cockpit-utility-controls \{[^}]*?top:\s*92px !important;[^}]*?width:\s*auto;/,
|
||||
);
|
||||
assert.match(
|
||||
css,
|
||||
/:root\[data-ui-theme='cyber'\]\s+body\.cockpit-mode\s+\.cockpit-utility-control\.is-expanded \{\s*right:\s*auto;\s*\}/,
|
||||
);
|
||||
assert.match(
|
||||
mobileCockpit[1],
|
||||
/body\.cockpit-mode \.cockpit-utility-control\.is-expanded[\s\S]*?top:\s*96px;/,
|
||||
|
||||
@@ -48,9 +48,8 @@
|
||||
--cockpit-side-panel-width: min(340px, 28vw);
|
||||
/* HUD bottom offset + tallest scaled telemetry block + 20px clear border. */
|
||||
--cockpit-bottom-rail-safe: calc(clamp(84px, 11vh, 118px) + 100px);
|
||||
/* The compass block's bottom edge; the phone Display/Radio row sits above
|
||||
the telemetry it carries. */
|
||||
--cockpit-compass-bottom: clamp(44px, 7vh, 72px);
|
||||
/* The phone Display/Radio row shares the visor inset with the roll scale. */
|
||||
--cockpit-visor-top: clamp(62px, 9vh, 90px);
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 145;
|
||||
@@ -68,7 +67,7 @@
|
||||
}
|
||||
.cockpit-visor-shell {
|
||||
position: absolute;
|
||||
inset: clamp(62px, 9vh, 90px) clamp(18px, 3vw, 48px) clamp(38px, 5vh, 56px);
|
||||
inset: var(--cockpit-visor-top) clamp(18px, 3vw, 48px) clamp(38px, 5vh, 56px);
|
||||
transform-style: preserve-3d;
|
||||
perspective: 880px;
|
||||
}
|
||||
@@ -648,7 +647,7 @@ html:not([lang='en']) .cockpit-roll-token.is-separator {
|
||||
.cockpit-compass {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
bottom: var(--cockpit-compass-bottom);
|
||||
bottom: clamp(44px, 7vh, 72px);
|
||||
width: min(760px, 72vw);
|
||||
transform: translateX(-50%) rotateX(7deg) translateZ(18px);
|
||||
transform-style: preserve-3d;
|
||||
@@ -2079,17 +2078,14 @@ body.cockpit-mode #intel-hud .hud-right-edge {
|
||||
body.cockpit-mode #right-context-rail {
|
||||
display: none !important;
|
||||
}
|
||||
/* A centred row above the compass block: its ground speed and altitude
|
||||
telemetry tops out ~171px above the block's bottom edge on phones, so
|
||||
the row clears it by ~10px and stays on the same axis as RESET/EXIT.
|
||||
The row spans the width to centre its launchers; only they take input. */
|
||||
/* Place the row just below the roll arc (visor inset + 2px + 96px).
|
||||
On shorter screens, leave 8px between the 42px row and the reticle
|
||||
(46% - 18px), keeping the row below the vision controls at 72px. */
|
||||
body.cockpit-mode .cockpit-utility-controls {
|
||||
top: auto;
|
||||
top: clamp(72px, calc(46% - 68px), calc(var(--cockpit-visor-top) + 108px));
|
||||
right: 12px;
|
||||
bottom: calc(var(--cockpit-compass-bottom) + 182px);
|
||||
left: 12px;
|
||||
justify-content: center;
|
||||
max-width: none;
|
||||
pointer-events: none;
|
||||
}
|
||||
body.cockpit-mode .cockpit-utility-controls {
|
||||
|
||||
@@ -2892,16 +2892,20 @@
|
||||
max-height: min(48vh, 440px);
|
||||
}
|
||||
|
||||
/* Centred like the default theme's phone row; the desktop panel width
|
||||
would otherwise pin it left of the Reset/Exit axis. */
|
||||
/* Centred like the default theme's phone row. */
|
||||
:root[data-ui-theme='cyber'] body.cockpit-mode .cockpit-utility-controls {
|
||||
top: 92px !important;
|
||||
right: 12px;
|
||||
bottom: auto;
|
||||
left: 12px;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
:root[data-ui-theme='cyber']
|
||||
body.cockpit-mode
|
||||
.cockpit-utility-control.is-expanded {
|
||||
right: auto;
|
||||
}
|
||||
|
||||
:root[data-ui-theme='cyber']
|
||||
body.cockpit-mode
|
||||
.cockpit-utility-control:not(.is-expanded)
|
||||
|
||||
Reference in new issue
Block a user