You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ccbbc4f
Browse filesBrowse the repository at this point in the historyBrowse files
feat(Lightbox): touch zoom like the iOS Photos viewer
Lightbox's zoom moves to the gesture recognizers and the compositor
animator: a pinch about the fingers with the pan riding along, UIKit's
give past the zoom limits and its eased return about the last centroid,
Photos' aspect-fill double tap (the tapped point to the centre), and a
zoomed pan with UIScrollView's rubber band, coast and edge bounce. The
mouse uses the same recognizers. On a touch screen the photo's stage fills
the viewer and takes the pinch; the controls and caption keep the page's
pinch-zoom. Keyboard panning stops at the photo's edges.
[feat] Lightbox's zoom now works on touch screens the way the iOS Photos viewer does. Pinch the photo to zoom around your fingers, and move them to pan while you zoom. Past the zoom limits the photo gives way, then eases back when you let go. Double-tap zooms until the photo fills the screen, bringing the tapped point to the centre; double-tap again to go back. A zoomed photo pans with momentum, stretches past its edges and settles back. Keyboard panning now stops at the photo's edges.
6
+
7
+
On a phone the photo's stage fills the viewer. A pinch on the photo no longer zooms the page, and a pinch on the controls or caption still does. The zoom animations run on the compositor, so they stay smooth while the page is busy. With `hasZoom` off, nothing changes.
Copy file name to clipboardExpand all lines: packages/core/src/Lightbox/Lightbox.doc.mjs
+4-3Lines changed: 4 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -98,7 +98,7 @@ export const docs = {
98
98
name: 'hasZoom',
99
99
type: 'boolean',
100
100
description:
101
-
'Enable zoom on double-click, or Enter/Space/+/- via keyboard (images only). When zoomed, drag or use arrow keys to pan.',
101
+
'Enable zoom (images only): pinch, or double-tap or double-click to zoom in at that point and back, or Enter/Space/+/- via keyboard. When zoomed, drag (with momentum) or use arrow keys to pan.',
0 commit comments