Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
() => block([
cond(eq(opened, 0), [
set(driver, runTiming(clock, 0, timingConfig)),
cond(eq(clockRunning(clock), 0), set(opened, 1)),
]),
set(x, binaryInterpolation(driver, position.x, 0)),
set(y, binaryInterpolation(driver, position.y, 0)),
set(width, binaryInterpolation(driver, position.width, wWidth)),
set(contentX, binaryInterpolation(driver, position.x, 0)),
set(contentY, binaryInterpolation(driver, position.y, position.height)),
cond(and(greaterOrEq(round(translationY), 100), neq(driver, 0)), [
set(driver, runTiming(clock, 1, {
toValue: 0,
duration: 300,
easing: Easing.inOut(Easing.ease),
})),
cond(eq(clockRunning(clock), 0), call([], close)),
]),
])
}
const timing = (clock: Animated.Clock) =>
runTiming(clock, 0, { toValue: 1, duration: 400, easing: Easing.linear });
() => block([
cond(eq(opened, 0), [
set(driver, runTiming(clock, 0, timingConfig)),
cond(eq(clockRunning(clock), 0), set(opened, 1)),
]),
set(x, binaryInterpolation(driver, position.x, 0)),
set(y, binaryInterpolation(driver, position.y, 0)),
set(width, binaryInterpolation(driver, position.width, wWidth)),
set(contentX, binaryInterpolation(driver, position.x, 0)),
set(contentY, binaryInterpolation(driver, position.y, position.height)),
cond(and(greaterOrEq(round(translationY), 100), neq(driver, 0)), [
set(driver, runTiming(clock, 1, {
toValue: 0,
duration: 300,
easing: Easing.inOut(Easing.ease),
})),
cond(eq(clockRunning(clock), 0), call([], close)),
]),
])
export default () => {
const clock = new Clock();
const config = {
duration: 10 * 1000,
toValue: 1,
easing: Easing.linear,
};
return (
);
};
const timing = (clock: Animated.Clock) =>
runTiming(clock, 0, { toValue: 1, duration: 400, easing: Easing.linear });
export const delay = (
node: Animated.Node,
duration: number,
nodeBefore: Animated.Adaptable = 0
) => {
const clock = new Clock();
return block([
runTiming(clock, 0, { toValue: 1, duration, easing: Easing.linear }),
cond(eq(clockRunning(clock), 0), node, nodeBefore)
]);
};