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
feat: add transformPerspective prop and card flip demo (#34)
* feat: add transformPerspective prop and card flip demo
- Add `transformPerspective` prop for configurable 3D perspective on all platforms
- iOS: use individual key-path animations for transform sub-properties,
apply perspective to parent via didMoveToSuperview
- Android: fix cameraDistance formula to match RN (density² × perspective × √5),
add backface visibility updates during rotation animations
- Web: add perspective() to CSS transform when 3D rotations are active,
always include rotateX/rotateY in transform for correct CSS transitions
- Add CardFlipDemo example with 3D card flip animation
- Update default perspective from 850 to 1280 (matches RN default)
- Document iOS caveat about Fabric view flattening
* chore: use 800 perspective in card flip demo
Default is `1280`, matching React Native's default perspective.
443
+
444
+
> **iOS note:** On iOS, the parent view must not be flattened by Fabric for perspective to render correctly. Ensure the parent has `collapsable={false}` or a style that prevents flattening (e.g. `transform`, `opacity`, `zIndex`).
445
+
429
446
### Style Handling
430
447
431
448
`EaseView` accepts all standard `ViewStyle` properties. If a property appears in both `style` and `animate`, the animated value takes priority and the style value is stripped. A dev warning is logged when this happens.
@@ -465,6 +482,7 @@ A `View` that animates property changes using native platform APIs.
465
482
|`transition`|`Transition`| Animation configuration — a single config (timing, spring, or none) or a [per-property map](#per-property-transitions)|
466
483
|`onTransitionEnd`|`(event) => void`| Called when all animations complete with `{ finished: boolean }`|
467
484
|`transformOrigin`|`{ x?: number; y?: number }`| Pivot point for scale/rotation as 0–1 fractions. Default: `{ x: 0.5, y: 0.5 }` (center) |
485
+
|`transformPerspective`|`number`| Camera distance for 3D transforms (`rotateX`, `rotateY`). See [Transform Perspective](#transform-perspective). Default: `1280`|
468
486
|`useHardwareLayer`|`boolean`| Android only — rasterize to GPU texture during animations. See [Hardware Layers](#hardware-layers-android). Default: `false`|
469
487
|`className`|`string`| NativeWind / Uniwind / Tailwind CSS class string. Requires NativeWind or Uniwind in your project. |
Default is `1280`, matching React Native's default perspective.
222
+
223
+
:::note[iOS]
224
+
On iOS, the parent view must not be flattened by Fabric for perspective to render correctly. Ensure the parent has `collapsable={false}` or a style that prevents flattening (e.g. `transform`, `opacity`, `zIndex`).
225
+
:::
226
+
208
227
## Style handling
209
228
210
229
If a property appears in both `style` and `animate`, the animated value takes priority and the style value is stripped.
0 commit comments