Skip to content

Instantly share code, notes, and snippets.

@reime005
Last active December 10, 2020 16:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reime005/d97a3b23988d9365b33e1c972cc62510 to your computer and use it in GitHub Desktop.
Save reime005/d97a3b23988d9365b33e1c972cc62510 to your computer and use it in GitHub Desktop.
import { interpolate, useAnimatedProps } from 'react-native-reanimated';
const firstProps = useAnimatedProps(() => {
x.first.value = interpolate(
currTime.value,
[-1, 1],
[RADIUS + 10, RADIUS * 3 + 10],
);
radius.first.value = interpolate(
currTime.value,
[-1, -0.6, 0, 0.6, 1],
[RADIUS * 0.8, RADIUS * 1, RADIUS * 1.2, RADIUS * 1, RADIUS * 0.8],
);
return {
cx: x.first.value,
r: radius.first.value,
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment