sig-select landscape: stage card now visible; gear/kit btns in right sidebar column
sizeSigModal() no longer uses tray bottomInset in landscape (was over-shrinking the modal, pushing the stage off-screen); fixed 60px kit-bag-handle clearance instead. Gear btn + kit btn shifted into the 4rem right sidebar strip (right: 0.5rem) and nudged down a quarter-rem so they clear the last card in the 9×2 grid. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -35,27 +35,38 @@
|
||||
var rightInset = 0;
|
||||
var bottomInset = 0;
|
||||
|
||||
// Tray handle: portrait → vertical strip on right; landscape → horizontal at bottom
|
||||
var isLandscape = vw > vh;
|
||||
|
||||
// Tray handle: portrait → vertical strip on right; landscape → tray is easily
|
||||
// dismissed, so skip the bottomInset calculation (would over-shrink the modal).
|
||||
var trayHandle = document.getElementById('id_tray_handle');
|
||||
if (trayHandle) {
|
||||
if (trayHandle && !isLandscape) {
|
||||
var hr = trayHandle.getBoundingClientRect();
|
||||
if (hr.width >= hr.height) {
|
||||
// Landscape: handle spans the bottom
|
||||
bottomInset = vh - hr.top;
|
||||
} else {
|
||||
if (hr.width < hr.height) {
|
||||
// Portrait: handle strips the right edge
|
||||
rightInset = vw - hr.left;
|
||||
}
|
||||
}
|
||||
|
||||
// Gear / kit buttons fixed at the right edge may protrude left of the tray handle
|
||||
// Gear / kit buttons: update right inset if near right edge.
|
||||
// In landscape they sit at bottom-right but are also dismissible — skip bottomInset.
|
||||
document.querySelectorAll('.room-page > .gear-btn').forEach(function (btn) {
|
||||
var br = btn.getBoundingClientRect();
|
||||
if (br.right > vw - 30) {
|
||||
rightInset = Math.max(rightInset, vw - br.left);
|
||||
}
|
||||
if (!isLandscape && br.bottom > vh - 30) {
|
||||
bottomInset = Math.max(bottomInset, vh - br.top);
|
||||
}
|
||||
});
|
||||
|
||||
// Landscape: right clears gear/kit buttons (~4rem); bottom is fixed 60px for
|
||||
// the kit-bag handle strip — tray is ignored so the stage has room to breathe.
|
||||
if (isLandscape) {
|
||||
rightInset = Math.max(rightInset, 64); // 4rem
|
||||
bottomInset = 60; // kit-bag handle
|
||||
}
|
||||
|
||||
overlay.style.paddingRight = rightInset + 'px';
|
||||
overlay.style.paddingBottom = bottomInset + 'px';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user