add transform origin to animation

This commit is contained in:
Samuel Newman
2025-06-23 14:50:32 +03:00
committed by Eric Bailey
parent af70a8a9e0
commit ca4e7f9cc0
+14 -1
View File
@@ -294,7 +294,9 @@ function Bubble({
left: coords.left,
},
]}>
<Animated.View entering={ZoomIn.easing(Easing.out(Easing.exp))}>
<Animated.View
entering={ZoomIn.easing(Easing.out(Easing.exp))}
style={{transformOrigin: oppposite(position)}}>
<View
style={[
a.absolute,
@@ -341,3 +343,14 @@ function Bubble({
</View>
)
}
function oppposite(position: 'top' | 'bottom') {
switch (position) {
case 'top':
return 'center bottom'
case 'bottom':
return 'center top'
default:
return 'center'
}
}