File tree 1 file changed +52
-0
lines changed
1 file changed +52
-0
lines changed Original file line number Diff line number Diff line change
1
+ "use client" ;
2
+
3
+ import { motion , HTMLMotionProps , type Variants } from "framer-motion" ;
4
+
5
+ const container : Variants = {
6
+ hidden : { } ,
7
+ show : {
8
+ transition : {
9
+ staggerChildren : 0.1 ,
10
+ } ,
11
+ } ,
12
+ } ;
13
+
14
+ const item = ( y : boolean ) : Variants => ( {
15
+ hidden : {
16
+ opacity : 0 ,
17
+ y : y ? 16 : 0 ,
18
+ filter : "blur(10px)" ,
19
+ } ,
20
+ show : {
21
+ opacity : 1 ,
22
+ scale : 1 ,
23
+ y : 0 ,
24
+ filter : "blur(0px)" ,
25
+ transition : {
26
+ type : "spring" ,
27
+ stiffness : 150 ,
28
+ damping : 19 ,
29
+ mass : 1.2 ,
30
+ } ,
31
+ } ,
32
+ } ) ;
33
+
34
+ function Container ( props : HTMLMotionProps < "div" > ) {
35
+ return (
36
+ < motion . div
37
+ variants = { container }
38
+ initial = "hidden"
39
+ animate = "show"
40
+ { ...props }
41
+ />
42
+ ) ;
43
+ }
44
+
45
+ function Item ( {
46
+ translateAnimation = true ,
47
+ ...props
48
+ } : { translateAnimation ?: boolean } & HTMLMotionProps < "div" > ) {
49
+ return < motion . div variants = { item ( translateAnimation ) } { ...props } /> ;
50
+ }
51
+
52
+ export { Container , Item } ;
You can’t perform that action at this time.
0 commit comments