fix(mobile): full-screen media viewers + touch-pan for zoomed images (M3)
Mobile-audit batch 3. All changes mobile-gated (@media <=750px) so desktop is unchanged. - ModalWide: fill the phone screen (100vw/100vh, no radius) at <=750px instead of floating as an 85vw card. This also full-screens the file/PDF viewer and the avatar-crop editor on mobile (they share ModalWide) — intended. - UserHero avatar viewer: new mobile-only ModalMobileFull class (no desktop effect) so it goes edge-to-edge on phones like the timeline lightbox. - usePan: add touch support (single-finger drag, cleaned up on touchend/cancel/unmount) alongside the unchanged mouse path, so a zoomed image can be panned on a phone. Wired into ImageViewer and the MediaGallery lightbox. Two review passes: mouse path byte-for-byte unchanged; desktop provably unaffected; touch is gated to zoom!=1 so a non-zoomed image never hijacks swipe/scroll. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,27 @@
|
||||
import { style } from '@vanilla-extract/css';
|
||||
|
||||
const mobileFullscreen = {
|
||||
minWidth: '100vw',
|
||||
minHeight: '100vh',
|
||||
width: '100vw',
|
||||
height: '100vh',
|
||||
borderRadius: 0,
|
||||
} as const;
|
||||
|
||||
export const ModalWide = style({
|
||||
minWidth: '85vw',
|
||||
minHeight: '90vh',
|
||||
'@media': {
|
||||
// Fill the phone screen instead of floating as an 85vw card with margins.
|
||||
'(max-width: 750px)': mobileFullscreen,
|
||||
},
|
||||
});
|
||||
|
||||
// Mobile-only full-screen: no desktop effect (keeps the modal's normal size),
|
||||
// but fills the viewport on phones. For dialogs that should stay a small card on
|
||||
// desktop but go edge-to-edge on mobile (e.g. the avatar viewer).
|
||||
export const ModalMobileFull = style({
|
||||
'@media': {
|
||||
'(max-width: 750px)': mobileFullscreen,
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user