22 lines
373 B
JavaScript
22 lines
373 B
JavaScript
// composables/useScrollReveal.js
|
|
import { useMotion } from '@vueuse/motion'
|
|
|
|
export const useScrollReveal = (elRef) => {
|
|
useMotion(elRef, {
|
|
initial: {
|
|
opacity: 0,
|
|
y: 40,
|
|
},
|
|
visible: {
|
|
opacity: 1,
|
|
y: 0,
|
|
transition: {
|
|
type: 'spring',
|
|
stiffness: 250,
|
|
damping: 20,
|
|
},
|
|
},
|
|
onAppear: true,
|
|
})
|
|
}
|