const createPath = (type: 'Happy' | 'Sad' | 'Normal',{ height, width }: PathParams) => {switch (type) {case 'Happy':return `M0 ${height / 2} Q${width / 2} ${height} ${width} ${height / 2}`;case 'Sad':return `M0 ${height / 2} Q${width / 2} 0 ${width} ${height / 2}`;case 'Normal':return `M0 ${height / 2} Q${width / 2} ${height / 2} ${width} ${height / 2}`;}};export const DefaultMouthPaths = {Happy: createPath('Happy', { height: MOUTH_HEIGHT, width: MOUTH_WIDTH }),Sad: createPath('Sad', { height: MOUTH_HEIGHT, width: MOUTH_WIDTH }),Normal: createPath('Normal', { height: MOUTH_HEIGHT, width: MOUTH_WIDTH }),};export const DefaultEyebrowPaths = {// Note how the Happy Eyebrow is just the Sad Mouth flipped πHappy: createPath('Sad', { height: EYEBROW_HEIGHT, width: EYEBROW_WIDTH }),Sad: createPath('Happy', { height: EYEBROW_HEIGHT, width: EYEBROW_WIDTH }),Normal: createPath('Normal', {height: EYEBROW_HEIGHT,width: EYEBROW_WIDTH,}),};
const activeMouthPath = usePathInterpolation(animatedProgress,[AnimationType.Happy, AnimationType.Normal, AnimationType.Sad],outputRange);
Learn Reanimated, Gesture Handler & Skia with Reanimate.dev
I value a lot your feedback! Help me improve by sharing your thoughts, suggestions, or reporting any issues you encounter. If you need assistance, send me an email at hello@reactiive.io