Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sdream-ai-fe
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
侯明涛
sdream-ai-fe
Commits
08186cd0
Commit
08186cd0
authored
Jan 20, 2025
by
HoMeTown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 完善navbar的展开收起
parent
f229ff56
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
src/layouts/MainLayout/MainLayout.tsx
+10
-4
No files found.
src/layouts/MainLayout/MainLayout.tsx
View file @
08186cd0
...
@@ -17,9 +17,13 @@ interface MainLayoutProps {
...
@@ -17,9 +17,13 @@ interface MainLayoutProps {
}
}
const
contentVariants
=
{
const
contentVariants
=
{
hidden
:
{
navTween
:
{
x
:
'-100%'
,
// 向左移出屏幕
x
:
'-90px'
,
// 向左移出屏幕
transition
:
{
type
:
'tween'
,
duration
:
0.3
},
transition
:
{
type
:
'tween'
,
duration
:
0.3
,
ease
:
'easeInOut'
},
},
mainTween
:
{
x
:
'-60px'
,
// 向左移出屏幕
transition
:
{
type
:
'tween'
,
duration
:
0.3
,
ease
:
'easeInOut'
},
},
},
expanded
:
{
expanded
:
{
width
:
'90px'
,
width
:
'90px'
,
...
@@ -57,7 +61,7 @@ export const MainLayout: React.FC<MainLayoutProps> = ({ children }) => {
...
@@ -57,7 +61,7 @@ export const MainLayout: React.FC<MainLayoutProps> = ({ children }) => {
<
motion
.
main
className=
{
styles
.
layoutMain
}
>
<
motion
.
main
className=
{
styles
.
layoutMain
}
>
{
/* hidden */
}
{
/* hidden */
}
<
motion
.
div
<
motion
.
div
animate=
{
isNavBarVisible
?
isHistoryVisible
?
'shrunk'
:
'expanded'
:
'
hidd
en'
}
animate=
{
isNavBarVisible
?
isHistoryVisible
?
'shrunk'
:
'expanded'
:
'
navTwe
en'
}
variants=
{
contentVariants
}
variants=
{
contentVariants
}
className=
{
`fixed right-[-12px] top-[10px] z-[49] h-auto sm:relative flex sm:h-full pl-[12px] items-center ${isHistoryVisible && !isMobile() ? 'w-[340px]' : 'w-[90px]'} box-border`
}
className=
{
`fixed right-[-12px] top-[10px] z-[49] h-auto sm:relative flex sm:h-full pl-[12px] items-center ${isHistoryVisible && !isMobile() ? 'w-[340px]' : 'w-[90px]'} box-border`
}
>
>
...
@@ -87,6 +91,8 @@ export const MainLayout: React.FC<MainLayoutProps> = ({ children }) => {
...
@@ -87,6 +91,8 @@ export const MainLayout: React.FC<MainLayoutProps> = ({ children }) => {
)
}
)
}
</
motion
.
div
>
</
motion
.
div
>
<
motion
.
div
<
motion
.
div
variants=
{
contentVariants
}
animate=
{
isNavBarVisible
?
''
:
'mainTween'
}
className=
{
`${styles.layoutContent}`
}
className=
{
`${styles.layoutContent}`
}
>
>
{
children
}
{
children
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment