feat: add iOS Safari safe area CSS support

Add CSS environment variables for safe-area-inset to prevent content
overlap with notch/home indicator on iOS devices.

Changes:
- expert.css: Add safe area support to body, scene container, and
  simple-quick-actions (hamburger menu) navigation
- quick-actions.css: Add safe area support to context menu and
  follow-mode-indicator
- panels.css: Add safe area support to toast-container
- troubleshoot.css: Add safe area support to spaxel-dismiss-all

The viewport-fit=cover meta tag was already present in index.html.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
jedarden 2026-04-11 03:06:59 -04:00
parent 01a36a1548
commit f7b9d4fde5
4 changed files with 56 additions and 0 deletions

View file

@ -273,6 +273,8 @@ body.simple-mode #scene-container {
display: block;
max-width: 100%;
max-height: 100%;
/* Fix iOS Safari passive event listener warnings */
touch-action: none;
}
/* Handle visual viewport resize events (iOS Safari keyboard, address bar) */
@ -312,6 +314,21 @@ body.simple-mode .simple-quick-actions {
z-index: 100;
}
/* Simple mode navigation bar safe area support */
@supports (padding: max(0px)) {
body.simple-mode .simple-quick-actions {
/* Add safe area inset for home indicator on iOS */
padding-bottom: env(safe-area-inset-bottom);
height: calc(56px + env(safe-area-inset-bottom));
}
body.simple-mode #scene-container {
/* Adjust height calculation to account for safe area bottom */
height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 56px);
height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 56px);
}
}
/* ===== Mode Toggle Bar ===== */
.mode-toggle-bar {
position: fixed;

View file

@ -272,6 +272,15 @@
pointer-events: none;
}
/* Safe area support for toast notifications */
@supports (padding: max(0px)) {
#toast-container {
/* Adjust bottom position to account for safe area */
bottom: calc(20px + env(safe-area-inset-bottom));
right: calc(20px + env(safe-area-inset-right));
}
}
.toast {
background: #2a2a4a;
border: 1px solid rgba(255, 255, 255, 0.15);

View file

@ -32,6 +32,28 @@
animation: fadeIn 0.15s ease-out;
}
/* ===== Safe Area Insets for iOS ===== */
@supports (padding: max(0px)) {
.context-menu {
/* Respect safe area insets for notched devices */
padding-top: env(safe-area-inset-top);
padding-bottom: env(safe-area-inset-bottom);
padding-left: env(safe-area-inset-left);
padding-right: env(safe-area-inset-right);
}
.follow-mode-indicator {
/* Adjust bottom position to account for safe area */
bottom: calc(80px + env(safe-area-inset-bottom));
}
@media (max-width: 600px) {
.follow-mode-indicator {
bottom: calc(100px + env(safe-area-inset-bottom));
}
}
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }

View file

@ -304,6 +304,14 @@
color: #eee;
}
/* Safe area support for dismiss button */
@supports (padding: max(0px)) {
.spaxel-dismiss-all {
/* Adjust bottom position to account for safe area */
bottom: calc(20px + env(safe-area-inset-bottom));
}
}
/* ============================================
Post-Calibration Card (inside wizard)
============================================ */