-
-
Notifications
You must be signed in to change notification settings - Fork 94
Closed
Description
// ~/utils/motion
type SlideInDirection = 'left' | 'right' | 'up' | 'down'
type SlideInType = 'tween' | 'spring' | 'keyframes' | 'inertia'
export const fadeInVariants = (direction:SlideInDirection, type:SlideInType, delay:number, duration:number) => ({
initial: {
x: direction === 'left' ? 100 : direction === 'right' ? -100 : 0,
y: direction === 'up' ? 100 : direction === 'down' ? -100 : 0,
opacity: 0
},
visible: {
x: 0,
y: 0,
opacity: 1,
transition: {
type,
delay,
duration,
ease: 'easeOut'
}
}
})
// index.page
import { fadeInVariants } from '@/utils/motion'
<div v-motion="fadeInVariants('right', 'tween', 0.2, 1)">
move
</div>
it's not working !! How to pass argument to use this. is factible?
solved: fadeInVariants('right', 'tween', 200, 1000)
Metadata
Metadata
Assignees
Labels
No labels