loading code fetching the highlighted snippet
Pinch the card to zoom between 1x and 4x and twist it, and drag to move it. Past its limits it resists and springs back; on release its rotation snaps to the nearest 90°. Trackpad: pinch, and in Safari twist with two fingers too. Touch: pinch and twist with two fingers. Mouse: hold ctrl and scroll.
pinch needs pinchFeatures in a LazyMotion, on motion.* components too.scale: { min: 1, max: 4 } resists past the limits and springs back
on release.rotate: { snap: 90 } rotates to the nearest 90° on release.Three cards limited to between 0.5x and 2x. Pinch each past 2x: elastic: 0 stops dead, the default resists and springs back, and snapToOrigin returns to 1x on release.
elastic: 0 stops at the limit; 1 doesn't resist.0.35, resists past the limit and springs back.snapToOrigin animates scale to 1, and rotation and x/y to 0, on release.No motion component and no LazyMotion: pinch() binds the gesture to a plain element, its start callback returns handlers for each pinch, and rotation snaps to 45° on release.
pinch(element, onPinchStart, options) returns a function that removes the
gesture.{ onPinch, onComplete }.