272 lines
6.8 KiB
JavaScript
272 lines
6.8 KiB
JavaScript
// Metro module 5622 (f5623).
|
|
import { Animated, Platform } from "react-native";
|
|
import conditional from "./conditional";
|
|
Platform;
|
|
const { add, multiply } = Animated;
|
|
export function forHorizontalIOS(a0) {
|
|
const { current, next, inverted } = a0;
|
|
const screen = a0.layouts.screen;
|
|
const progress = current.progress;
|
|
let translateX = 0;
|
|
const transform = [{
|
|
translateX: multiply(progress.interpolate({
|
|
inputRange: [0, 1],
|
|
outputRange: [screen.width, 0],
|
|
extrapolate: "clamp"
|
|
}), inverted)
|
|
}, ,];
|
|
if (next) {
|
|
translateX = multiply(next.progress.interpolate({
|
|
inputRange: [0, 1],
|
|
outputRange: [0, -0.3 * screen.width],
|
|
extrapolate: "clamp"
|
|
}), inverted);
|
|
}
|
|
transform[1] = {
|
|
translateX
|
|
};
|
|
return {
|
|
cardStyle: {
|
|
transform
|
|
},
|
|
overlayStyle: {
|
|
opacity: current.progress.interpolate({
|
|
inputRange: [0, 1],
|
|
outputRange: [0, 0.07],
|
|
extrapolate: "clamp"
|
|
})
|
|
},
|
|
shadowStyle: {
|
|
shadowOpacity: current.progress.interpolate({
|
|
inputRange: [0, 1],
|
|
outputRange: [0, 0.3],
|
|
extrapolate: "clamp"
|
|
})
|
|
}
|
|
};
|
|
}
|
|
export function forVerticalIOS(a0) {
|
|
const { current, inverted } = a0;
|
|
return {
|
|
cardStyle: {
|
|
transform: [{
|
|
translateY: multiply(current.progress.interpolate({
|
|
inputRange: [0, 1],
|
|
outputRange: [a0.layouts.screen.height, 0],
|
|
extrapolate: "clamp"
|
|
}), inverted)
|
|
}]
|
|
}
|
|
};
|
|
}
|
|
export function forModalPresentationIOS(a0) {
|
|
const { index, current, next, inverted } = a0;
|
|
const screen = a0.layouts.screen;
|
|
const insets = a0.insets;
|
|
const r6 = screen.width > screen.height;
|
|
let r24 = 10;
|
|
const r2 = r6 ? 0 : 10;
|
|
const top = insets.top;
|
|
const r18 = screen.height / screen.width;
|
|
const r37 = add(current.progress.interpolate({
|
|
inputRange: [0, 1],
|
|
outputRange: [0, 1],
|
|
extrapolate: "clamp"
|
|
}), next ? next.progress.interpolate({
|
|
inputRange: [0, 1],
|
|
outputRange: [0, 1],
|
|
extrapolate: "clamp"
|
|
}) : 0);
|
|
const r7 = index === 0;
|
|
const translateY = multiply(r37.interpolate({
|
|
inputRange: [0, 1, 2],
|
|
outputRange: [screen.height, r7 ? 0 : r2, (r7 ? top : 0) - r2 * r18]
|
|
}), inverted);
|
|
const opacity = r37.interpolate({
|
|
inputRange: [0, 1, 1.0001, 2],
|
|
outputRange: [0, 0.3, 1, 1]
|
|
});
|
|
const scale = r6 ? 1 : r37.interpolate({
|
|
inputRange: [0, 1, 2],
|
|
outputRange: [1, 1, screen.width ? 1 - 2 * r2 / screen.width : 1]
|
|
});
|
|
let borderTopLeftRadius = 0;
|
|
if (!r6) {
|
|
if (r7) {
|
|
r24 = r37.interpolate({
|
|
inputRange: [0, 1, 1.0001, 2],
|
|
outputRange: [0, 0, 0, 10]
|
|
});
|
|
}
|
|
borderTopLeftRadius = r24;
|
|
}
|
|
return {
|
|
cardStyle: {
|
|
overflow: "hidden",
|
|
borderTopLeftRadius,
|
|
borderTopRightRadius: borderTopLeftRadius,
|
|
borderBottomLeftRadius: 0,
|
|
borderBottomRightRadius: 0,
|
|
marginTop: r7 ? 0 : top,
|
|
marginBottom: r7 ? 0 : r2,
|
|
transform: [{
|
|
translateY
|
|
}, {
|
|
scale
|
|
}]
|
|
},
|
|
overlayStyle: {
|
|
opacity
|
|
}
|
|
};
|
|
}
|
|
export function forFadeFromBottomAndroid(a0) {
|
|
const { current, inverted } = a0;
|
|
const screen = a0.layouts.screen;
|
|
const closing = a0.closing;
|
|
const translateY = multiply(current.progress.interpolate({
|
|
inputRange: [0, 1],
|
|
outputRange: [0.08 * screen.height, 0],
|
|
extrapolate: "clamp"
|
|
}), inverted);
|
|
return {
|
|
cardStyle: {
|
|
opacity: conditional(closing, current.progress, current.progress.interpolate({
|
|
inputRange: [0, 0.5, 0.9, 1],
|
|
outputRange: [0, 0.25, 0.7, 1],
|
|
extrapolate: "clamp"
|
|
})),
|
|
transform: [{
|
|
translateY
|
|
}]
|
|
}
|
|
};
|
|
}
|
|
export function forRevealFromBottomAndroid(a0) {
|
|
const { current, next, inverted } = a0;
|
|
const screen = a0.layouts.screen;
|
|
const progress = current.progress;
|
|
let translateY = 0;
|
|
const r23 = {
|
|
containerStyle: {
|
|
overflow: "hidden",
|
|
transform: [{
|
|
translateY: multiply(progress.interpolate({
|
|
inputRange: [0, 1],
|
|
outputRange: [screen.height, 0],
|
|
extrapolate: "clamp"
|
|
}), inverted)
|
|
}]
|
|
},
|
|
cardStyle: null,
|
|
overlayStyle: null
|
|
};
|
|
const transform = [{
|
|
translateY: multiply(current.progress.interpolate({
|
|
inputRange: [0, 1],
|
|
outputRange: [0.9590000000000001 * screen.height * -1, 0],
|
|
extrapolate: "clamp"
|
|
}), inverted)
|
|
}, ,];
|
|
if (next) {
|
|
translateY = multiply(next.progress.interpolate({
|
|
inputRange: [0, 1],
|
|
outputRange: [0, 0.02 * screen.height * -1],
|
|
extrapolate: "clamp"
|
|
}), inverted);
|
|
}
|
|
transform[1] = {
|
|
translateY
|
|
};
|
|
r23.cardStyle = {
|
|
transform
|
|
};
|
|
r23.overlayStyle = {
|
|
opacity: current.progress.interpolate({
|
|
inputRange: [0, 0.36, 1],
|
|
outputRange: [0, 0.1, 0.1],
|
|
extrapolate: "clamp"
|
|
})
|
|
};
|
|
return r23;
|
|
}
|
|
export function forScaleFromCenterAndroid({ current, next, closing }) {
|
|
const r19 = add(current.progress.interpolate({
|
|
inputRange: [0, 1],
|
|
outputRange: [0, 1],
|
|
extrapolate: "clamp"
|
|
}), next ? next.progress.interpolate({
|
|
inputRange: [0, 1],
|
|
outputRange: [0, 1],
|
|
extrapolate: "clamp"
|
|
}) : 0);
|
|
return {
|
|
cardStyle: {
|
|
opacity: r19.interpolate({
|
|
inputRange: [0, 0.75, 0.875, 1, 1.0825, 1.2075, 2],
|
|
outputRange: [0, 0, 1, 1, 1, 1, 0]
|
|
}),
|
|
transform: [{
|
|
scale: conditional(closing, current.progress.interpolate({
|
|
inputRange: [0, 1],
|
|
outputRange: [0.925, 1],
|
|
extrapolate: "clamp"
|
|
}), r19.interpolate({
|
|
inputRange: [0, 1, 2],
|
|
outputRange: [0.85, 1, 1.075]
|
|
}))
|
|
}]
|
|
}
|
|
};
|
|
}
|
|
export function forBottomSheetAndroid(a0) {
|
|
const { current, inverted } = a0;
|
|
const screen = a0.layouts.screen;
|
|
const closing = a0.closing;
|
|
const translateY = multiply(current.progress.interpolate({
|
|
inputRange: [0, 1],
|
|
outputRange: [0.8 * screen.height, 0],
|
|
extrapolate: "clamp"
|
|
}), inverted);
|
|
return {
|
|
cardStyle: {
|
|
opacity: conditional(closing, current.progress, current.progress.interpolate({
|
|
inputRange: [0, 1],
|
|
outputRange: [0, 1],
|
|
extrapolate: "clamp"
|
|
})),
|
|
transform: [{
|
|
translateY
|
|
}]
|
|
},
|
|
overlayStyle: {
|
|
opacity: current.progress.interpolate({
|
|
inputRange: [0, 1],
|
|
outputRange: [0, 0.3],
|
|
extrapolate: "clamp"
|
|
})
|
|
}
|
|
};
|
|
}
|
|
export function forFadeFromCenter(a0) {
|
|
const progress = a0.current.progress;
|
|
return {
|
|
cardStyle: {
|
|
opacity: progress.interpolate({
|
|
inputRange: [0, 0.5, 0.9, 1],
|
|
outputRange: [0, 0.25, 0.7, 1]
|
|
})
|
|
},
|
|
overlayStyle: {
|
|
opacity: progress.interpolate({
|
|
inputRange: [0, 1],
|
|
outputRange: [0, 0.5],
|
|
extrapolate: "clamp"
|
|
})
|
|
}
|
|
};
|
|
}
|
|
export function forNoAnimation() {
|
|
return {};
|
|
}
|