File tree Expand file tree Collapse file tree 2 files changed +40
-5
lines changed Expand file tree Collapse file tree 2 files changed +40
-5
lines changed Original file line number Diff line number Diff line change @@ -110,20 +110,21 @@ export default defineAppConfig({
110
110
} ,
111
111
} ,
112
112
ul : {
113
- initial : { x : 100 , opacity : 0 } ,
114
- visibleOnce : { x : 0 , opacity : 1 } ,
113
+ initial : { x : 100 , y : 100 , opacity : 0 } ,
114
+ visibleOnce : { x : 0 , y : 0 , opacity : 1 } ,
115
115
} ,
116
116
li : {
117
- initial : { x : 100 , opacity : 0 } ,
117
+ initial : { x : 40 , y : 20 , opacity : 0 } ,
118
118
hovered : {
119
119
x : 10 ,
120
120
opacity : 1 ,
121
- transition : { mass : 0.5 , damping : 5 , delay : 0 } ,
121
+ transition : { mass : 1 , delay : 0 } ,
122
122
} ,
123
123
visibleOnce : {
124
124
x : 0 ,
125
+ y : 0 ,
125
126
opacity : 1 ,
126
- transition : { mass : 0.5 , damping : 5 } ,
127
+ transition : { mass : 1 } ,
127
128
} ,
128
129
} ,
129
130
headers : {
Original file line number Diff line number Diff line change
1
+ export default defineComponent ( {
2
+ setup ( ) {
3
+ const MotionComponent = resolveComponent ( 'Motion' )
4
+ const slots = useSlots ( )
5
+ const appConfig = useAppConfig ( )
6
+
7
+ return ( ) => {
8
+ const nodes : VNode [ ] = slots . default ?.( ) || [ ]
9
+
10
+ return h (
11
+ 'ol' ,
12
+ {
13
+ ...appConfig . motions . ul ,
14
+ } ,
15
+ nodes . map ( ( node , i ) => {
16
+ node . props = {
17
+ is : 'li' ,
18
+ ...appConfig . motions . li ,
19
+ visibleOnce : {
20
+ ...appConfig . motions . li . visibleOnce ,
21
+ transition : {
22
+ ...appConfig . motions . li . visibleOnce . transition ,
23
+ delay : i * 50 ,
24
+ } ,
25
+ } ,
26
+ }
27
+
28
+ // @ts -expect-error type conflict but seems to work fine
29
+ return h ( MotionComponent , { ...node . props } , node . children )
30
+ } ) ,
31
+ )
32
+ }
33
+ } ,
34
+ } )
You can’t perform that action at this time.
0 commit comments