1- import { computed , type ComputedRef } from 'vue'
1+ import { computed , type Ref } from 'vue'
22import { cubicBezier } from 'motion-v'
33
44const easeOutExpo = cubicBezier ( 0.16 , 1 , 0.3 , 1 )
55
6- export function useFlyIn ( isInView : ComputedRef < boolean > ) {
7- return computed ( ( ) => ( delay : number ) => ( {
8- initial : { translateY : '1.5rem ' , opacity : 0 } ,
6+ export function useFlyIn ( isInView : Ref < boolean > ) {
7+ return computed ( ( ) => ( delay = 0 ) => ( {
8+ initial : { translateY : '1.75rem ' , opacity : 0 } ,
99 animate : isInView . value ? 'inView' : 'initial' ,
1010 variants : {
1111 inView : {
@@ -21,8 +21,8 @@ export function useFlyIn(isInView: ComputedRef<boolean>) {
2121 } ) )
2222}
2323
24- export function useFadeIn ( isInView : ComputedRef < boolean > ) {
25- return computed ( ( ) => ( delay : number ) => ( {
24+ export function useFadeIn ( isInView : Ref < boolean > ) {
25+ return computed ( ( ) => ( delay = 0 ) => ( {
2626 initial : { opacity : 0 } ,
2727 animate : isInView . value ? 'inView' : 'initial' ,
2828 variants : {
@@ -38,8 +38,8 @@ export function useFadeIn(isInView: ComputedRef<boolean>) {
3838 } ) )
3939}
4040
41- export function useExpandWidth ( isInView : ComputedRef < boolean > ) {
42- return computed ( ( ) => ( width :number , delay : number ) => ( {
41+ export function useExpandWidth ( isInView : Ref < boolean > ) {
42+ return computed ( ( ) => ( width : number , delay = 0 ) => ( {
4343 initial : { width : 0 , opacity : 0 } ,
4444 animate : isInView . value ? 'inView' : 'initial' ,
4545 variants : {
0 commit comments