1
- import { computed , type ComputedRef } from 'vue'
1
+ import { computed , type Ref } from 'vue'
2
2
import { cubicBezier } from 'motion-v'
3
3
4
4
const easeOutExpo = cubicBezier ( 0.16 , 1 , 0.3 , 1 )
5
5
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 } ,
9
9
animate : isInView . value ? 'inView' : 'initial' ,
10
10
variants : {
11
11
inView : {
@@ -21,8 +21,8 @@ export function useFlyIn(isInView: ComputedRef<boolean>) {
21
21
} ) )
22
22
}
23
23
24
- export function useFadeIn ( isInView : ComputedRef < boolean > ) {
25
- return computed ( ( ) => ( delay : number ) => ( {
24
+ export function useFadeIn ( isInView : Ref < boolean > ) {
25
+ return computed ( ( ) => ( delay = 0 ) => ( {
26
26
initial : { opacity : 0 } ,
27
27
animate : isInView . value ? 'inView' : 'initial' ,
28
28
variants : {
@@ -38,8 +38,8 @@ export function useFadeIn(isInView: ComputedRef<boolean>) {
38
38
} ) )
39
39
}
40
40
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 ) => ( {
43
43
initial : { width : 0 , opacity : 0 } ,
44
44
animate : isInView . value ? 'inView' : 'initial' ,
45
45
variants : {
0 commit comments