File tree 1 file changed +10
-6
lines changed
frontend/src/component/template
1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -17,16 +17,20 @@ export default function NavbarLayout() {
17
17
}
18
18
19
19
return (
20
- < div
21
- className = 'relative h-screen w-[20%] rounded-[11px] bg-lightblue dark:bg-darkblue'
20
+ < motion . div
21
+ animate = { {
22
+ width : isNavbarOpen ? '20%' : '0%'
23
+ } }
24
+ transition = { { duration : 0.3 , ease : 'easeInOut' } }
25
+ className = 'relative h-screen rounded-[11px] bg-lightblue dark:bg-darkblue'
22
26
onMouseEnter = { ( ) => setIsHovered ( true ) }
23
27
onMouseLeave = { ( ) => setIsHovered ( false ) } >
24
28
< AnimatePresence >
25
29
{ isNavbarOpen && (
26
30
< motion . div
27
- initial = { { width : 0 , opacity : 0 , x : - 50 } }
28
- animate = { { width : '100%' , opacity : 1 , x : 0 } }
29
- exit = { { width : 0 , opacity : 0 , x : - 50 } }
31
+ initial = { { opacity : 0 , x : - 50 } }
32
+ animate = { { opacity : 1 , x : 0 } }
33
+ exit = { { opacity : 0 , x : - 50 } }
30
34
transition = { { duration : 0.3 , ease : 'easeInOut' } } >
31
35
< Navbar />
32
36
{ isHovered && (
@@ -57,6 +61,6 @@ export default function NavbarLayout() {
57
61
< ChevronRight size = { 20 } />
58
62
</ motion . button >
59
63
) }
60
- </ div >
64
+ </ motion . div >
61
65
) ;
62
66
}
You can’t perform that action at this time.
0 commit comments