transition.ts 760 B

12345678910111213141516171819202122232425
  1. import type { TranEnterType, TranExitType, TranHoverType } from '../types'
  2. // https://www.framer.com/motion/transition/
  3. // A transition defines how values animate from one state to another.
  4. export const varTranHover = (props?: TranHoverType) => {
  5. const duration = props?.duration || 0.32
  6. const ease = props?.ease || [0.43, 0.13, 0.23, 0.96]
  7. return { duration, ease }
  8. }
  9. export const varTranEnter = (props?: TranEnterType) => {
  10. const duration = props?.durationIn || 0.64
  11. const ease = props?.easeIn || [0.43, 0.13, 0.23, 0.96]
  12. return { duration, ease }
  13. }
  14. export const varTranExit = (props?: TranExitType) => {
  15. const duration = props?.durationOut || 0.48
  16. const ease = props?.easeOut || [0.43, 0.13, 0.23, 0.96]
  17. return { duration, ease }
  18. }