spaxel/dashboard/css/expert.css
jedarden f7b9d4fde5 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>
2026-04-11 03:07:40 -04:00

492 lines
12 KiB
CSS

/**
* Spaxel Dashboard - Expert Mode Styles
*
* Expert mode 3D scene layout with responsive canvas sizing.
* Handles iOS Safari visual viewport quirks and bottom navigation spacing.
*
* WCAG 2.1 Touch Target Compliance:
* - All interactive elements meet minimum 44x44px touch target size
* - Touch targets are expanded using padding or pseudo-elements where needed
*/
/* ===== WCAG 2.1 Touch Target Compliance Utilities ===== */
/* Touch target expansion for small checkboxes */
.panel-form-checkbox input[type="checkbox"],
.pattern-checkbox input[type="checkbox"],
.timeline-category-checkbox input[type="checkbox"],
.sim-gdop-controls input[type="checkbox"] {
/* Ensure checkbox touch area is 44x44px minimum */
width: 18px;
height: 18px;
min-width: 18px;
min-height: 18px;
position: relative;
}
/* Expand checkbox hit area with pseudo-element */
.panel-form-checkbox input[type="checkbox"]::before,
.pattern-checkbox input[type="checkbox"]::before,
.timeline-category-checkbox input[type="checkbox"]::before,
.sim-gdop-controls input[type="checkbox"]::before {
content: '';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 44px;
height: 44px;
border-radius: 50%;
}
/* Expand small toggle switches to 44px height */
.toggle-switch {
min-height: 44px;
}
.toggle-switch .slider {
min-height: 44px;
height: 44px;
}
.toggle-switch .slider:before {
width: 36px;
height: 36px;
top: 4px;
left: 4px;
}
.toggle-switch input:checked + .slider:before {
transform: translateX(22px);
}
/* Expand slider thumb touch area */
.panel-form-group input[type="range"] {
height: 44px; /* Full touch target height */
background: transparent;
cursor: pointer;
}
.panel-form-group input[type="range"]::-webkit-slider-runnable-track {
height: 6px;
background: rgba(255, 255, 255, 0.1);
border-radius: 3px;
margin: 19px 0; /* Center track within 44px height */
}
.panel-form-group input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 32px;
height: 32px;
background: #4fc3f7;
border-radius: 50%;
cursor: pointer;
margin-top: -13px; /* Center thumb on track */
transition: transform 0.1s;
}
.panel-form-group input[type="range"]::-webkit-slider-thumb:hover {
transform: scale(1.15);
}
.panel-form-group input[type="range"]::-moz-range-track {
height: 6px;
background: rgba(255, 255, 255, 0.1);
border-radius: 3px;
}
.panel-form-group input[type="range"]::-moz-range-thumb {
width: 32px;
height: 32px;
background: #4fc3f7;
border-radius: 50%;
cursor: pointer;
border: none;
}
/* Expand close button touch targets to 44x44px */
.panel-close,
.modal-close,
.panel-modal-close,
.sim-close-btn {
min-width: 44px;
min-height: 44px;
width: 44px;
height: 44px;
font-size: 24px;
line-height: 44px;
padding: 0;
}
/* Expand context menu items to 44px minimum height */
.context-item,
.blob-context-menu-item {
min-height: 44px;
padding: 12px 16px;
}
/* Expand link list items to 44px minimum */
.link-item {
min-height: 44px;
padding: 12px 16px;
font-size: 13px;
}
/* Ensure all buttons meet 44x44px minimum */
.panel-btn,
.modal-btn,
.btn,
.sim-btn,
.alert-banner-btn,
.timeline-filter-toggle,
.timeline-load-more-btn,
.view-btn,
#floorplan-btn,
.node-identify-btn {
min-height: 44px;
min-width: 44px;
padding: 12px 20px;
font-size: 14px;
}
/* Small buttons: expand with padding while keeping appearance compact */
.btn-sm,
.timeline-feedback-btn,
.timeline-seek-btn {
min-height: 44px;
min-width: 44px;
padding: 14px 12px; /* Extra vertical padding to reach 44px */
}
/* Volume tools buttons */
.volume-tools button {
min-height: 44px;
min-width: 44px;
padding: 12px 16px;
}
/* Hamburger tabs - ensure 44px minimum */
.hamburger-tab {
min-height: 44px;
min-width: 44px;
}
/* Hamburger items - already 44px, ensure explicit */
.hamburger-item {
min-height: 44px;
padding: 12px 16px;
}
/* Toast dismiss button */
.toast-dismiss {
min-width: 44px;
min-height: 44px;
width: 44px;
height: 44px;
font-size: 18px;
}
/* Mode toggle buttons */
.mode-toggle-btn {
min-height: 44px;
min-width: 44px;
padding: 12px 16px;
}
/* Action items */
.action-item .action-remove {
min-width: 44px;
min-height: 44px;
padding: 12px 8px;
font-size: 14px;
}
/* Sim item delete button */
.sim-item-delete {
min-height: 44px;
min-width: 44px;
padding: 12px 16px;
}
/* Form controls */
.panel-form-group input[type="text"],
.panel-form-group input[type="number"],
.panel-form-group input[type="password"],
.panel-form-group input[type="email"],
.panel-form-group input[type="url"],
.panel-form-group select,
.panel-form-group textarea,
.panel-input,
.form-control,
.timeline-filter-select,
.timeline-search,
.timeline-date-input {
min-height: 44px;
padding: 12px 16px;
}
/* ===== Scene Container (3D Canvas) ===== */
#scene-container {
position: fixed;
top: 0;
left: 0;
width: 100%;
/* Full viewport height by default */
height: 100vh;
/* Fallback for browsers that don't support viewport units */
height: 100%;
z-index: 1;
}
/* Canvas height adjustment when simple mode navigation is visible */
body.simple-mode #scene-container {
/* Simple mode has 56px bottom nav, subtract from viewport height */
height: calc(100vh - 56px);
}
/* iOS Safari-specific handling for visual viewport */
@supports (-webkit-touch-callout: none) {
/* iOS Safari with visual viewport API */
#scene-container {
/* Use dynamic viewport height on iOS (handles address bar) */
height: 100dvh;
}
body.simple-mode #scene-container {
/* Subtract bottom navigation bar height */
height: calc(100dvh - 56px);
}
}
/* iOS Safari orientation change handling */
/* Prevent iOS Safari from scaling content on orientation change */
@supports (-webkit-touch-callout: none) {
body {
/* Prevent automatic text size adjustment on orientation change */
-webkit-text-size-adjust: 100%;
}
}
/* Ensure canvas doesn't overflow during transitions */
#scene-container canvas {
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) */
.visual-viewport-resizing #scene-container {
/* Prevent layout shift during visual viewport changes */
pointer-events: none;
}
/* ===== Status Bar ===== */
#status-bar {
position: fixed;
top: 0;
left: 0;
right: 0;
height: 40px;
background: rgba(0, 0, 0, 0.9);
z-index: 100;
display: flex;
align-items: center;
padding: 0 16px;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
/* Adjust scene container when status bar is visible */
#status-bar ~ #scene-container {
top: 40px;
height: calc(100vh - 40px);
}
/* Simple mode navigation bar adjustment */
body.simple-mode .simple-quick-actions {
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 56px;
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;
top: 40px;
left: 0;
right: 0;
height: 44px;
z-index: 90;
}
/* Adjust scene container when mode toggle bar is visible */
.mode-toggle-bar ~ #scene-container,
body:not(.simple-mode) .mode-toggle-bar ~ #scene-container {
top: 84px; /* 40px status bar + 44px mode toggle bar */
height: calc(100vh - 84px);
}
/* Both status bar and mode toggle bar present */
#status-bar .mode-toggle-bar ~ #scene-container {
top: 84px;
height: calc(100vh - 84px);
}
/* ===== Alert Banner ===== */
#alert-banner {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 5000;
}
/* Adjust scene container when alert banner is visible */
#alert-banner.visible ~ #scene-container {
top: 60px; /* Approximate alert banner height */
height: calc(100vh - 60px);
}
/* ===== Orientation-specific adjustments ===== */
/* Landscape orientation */
@media screen and (orientation: landscape) {
#scene-container {
/* In landscape, ensure full height is used */
height: 100vh;
height: 100dvh;
}
body.simple-mode #scene-container {
height: calc(100vh - 56px);
height: calc(100dvh - 56px);
}
/* Adjust for landscape status bar */
#status-bar ~ #scene-container {
height: calc(100vh - 40px);
height: calc(100dvh - 40px);
}
/* Adjust for landscape mode toggle bar */
.mode-toggle-bar ~ #scene-container {
height: calc(100vh - 44px);
height: calc(100dvh - 44px);
}
}
/* Portrait orientation */
@media screen and (orientation: portrait) {
#scene-container {
height: 100vh;
height: 100dvh;
}
body.simple-mode #scene-container {
height: calc(100vh - 56px);
height: calc(100dvh - 56px);
}
}
/* ===== Responsive breakpoints ===== */
/* Small mobile devices */
@media screen and (max-width: 600px) {
#scene-container {
height: 100vh;
height: 100dvh;
}
body.simple-mode #scene-container {
height: calc(100vh - 56px);
height: calc(100dvh - 56px);
}
/* On small mobile, status bar and mode toggle may stack */
#status-bar ~ .mode-toggle-bar ~ #scene-container {
top: 84px;
height: calc(100vh - 84px);
height: calc(100dvh - 84px);
}
}
/* Tablets and larger */
@media screen and (min-width: 601px) {
#scene-container {
height: 100vh;
height: 100dvh;
}
}
/* ===== Safe area insets for notched devices ===== */
@supports (padding: max(0px)) {
body {
/* Add safe area insets to body for iOS Safari notch/home indicator */
padding-top: env(safe-area-inset-top);
padding-bottom: env(safe-area-inset-bottom);
}
#scene-container {
/* Use safe-area-inset for devices with notches (iPhone X+) */
padding-left: env(safe-area-inset-left);
padding-right: env(safe-area-inset-right);
}
/* Adjust height calculation to account for safe areas */
#scene-container {
height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
}
body.simple-mode #scene-container {
/* Simple mode: also subtract bottom nav height */
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);
}
}
/* ===== Prevent overscroll/bounce on iOS ===== */
@supports (-webkit-touch-callout: none) {
#scene-container {
/* Prevent rubber-band scrolling effect */
-webkit-overflow-scrolling: touch;
overscroll-behavior: none;
}
}
/* ===== Loading state ===== */
#scene-container.loading {
opacity: 0.5;
pointer-events: none;
transition: opacity 0.3s ease;
}
/* ===== Hide scene container in simple mode ===== */
body.simple-mode #scene-container {
display: none;
}
/* ===== Expert mode specific styles ===== */
body:not(.simple-mode) #scene-container {
display: block;
}