2022-11-16 00:14:59 +01:00
|
|
|
export const moveInTop = {
|
|
|
|
initial: {
|
|
|
|
opacity: 0,
|
2022-11-16 23:36:38 +01:00
|
|
|
y: -50,
|
|
|
|
transition: { type: 'spring' }
|
2022-11-16 00:14:59 +01:00
|
|
|
},
|
|
|
|
enter: {
|
|
|
|
opacity: 1,
|
|
|
|
y: 0,
|
|
|
|
transition: {
|
|
|
|
type: 'spring',
|
|
|
|
duration: 0.3,
|
|
|
|
stiffness: 120
|
|
|
|
}
|
|
|
|
},
|
|
|
|
exit: {
|
|
|
|
opacity: 0,
|
2022-11-16 23:36:38 +01:00
|
|
|
y: -50,
|
2022-11-16 00:14:59 +01:00
|
|
|
transition: {
|
|
|
|
type: 'spring',
|
|
|
|
duration: 0.2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export const moveInBottom = {
|
|
|
|
initial: {
|
|
|
|
opacity: 0,
|
2022-11-17 00:06:26 +01:00
|
|
|
y: 20,
|
2022-11-16 00:14:59 +01:00
|
|
|
transition: { type: 'spring' }
|
|
|
|
},
|
|
|
|
enter: {
|
|
|
|
opacity: 1,
|
|
|
|
y: 0,
|
|
|
|
transition: {
|
|
|
|
type: 'spring',
|
2022-11-16 23:36:38 +01:00
|
|
|
duration: 0.4,
|
2022-11-16 00:14:59 +01:00
|
|
|
stiffness: 120
|
|
|
|
}
|
|
|
|
},
|
|
|
|
exit: {
|
|
|
|
opacity: 0,
|
2022-11-17 00:06:26 +01:00
|
|
|
y: 20,
|
2022-11-16 00:14:59 +01:00
|
|
|
transition: {
|
|
|
|
type: 'spring'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-04 23:09:00 +01:00
|
|
|
export const fadeIn = {
|
|
|
|
initial: { opacity: 0 },
|
|
|
|
enter: { opacity: 1 },
|
|
|
|
exit: { opacity: 0 }
|
|
|
|
}
|
|
|
|
|
2022-11-16 00:14:59 +01:00
|
|
|
export function getAnimationProps(shouldReduceMotion: boolean) {
|
|
|
|
return {
|
|
|
|
initial: `${shouldReduceMotion ? 'enter' : 'initial'}`,
|
|
|
|
animate: `${shouldReduceMotion ? null : 'enter'}`,
|
|
|
|
exit: `${shouldReduceMotion ? null : 'exit'}`
|
|
|
|
}
|
|
|
|
}
|