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
bced1825
Commit
bced1825
authored
Aug 08, 2024
by
HoMeTown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 动画
parent
94991ba6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
3 deletions
+31
-3
src/pages/Home/Home.tsx
+31
-3
No files found.
src/pages/Home/Home.tsx
View file @
bced1825
import
type
React
from
'react'
import
{
Virtuoso
}
from
'react-virtuoso'
import
{
motion
}
from
'framer-motion'
import
styles
from
'./Home.module.less'
import
{
QuestionList
}
from
'./components/QuestionList'
import
{
WelcomeWord
}
from
'./components/WelcomeWord'
...
...
@@ -10,6 +11,32 @@ import { GradientBackground } from '@/components/GradientBackground'
import
{
ChatEditor
}
from
'@/components/ChatEditor'
import
{
RECOMMEND_QUESTIONS_OTHER
,
RECOMMEND_QUESTIONS_PRODUCT
}
from
'@/config/recommendQuestion'
function
getAnimationProps
(
delay
:
number
)
{
return
{
variants
:
{
hidden
:
{
opacity
:
0
,
y
:
50
,
scale
:
0.9
,
rotateX
:
-
6
,
},
visible
:
{
opacity
:
1
,
y
:
0
,
scale
:
1
,
rotateX
:
0
,
transition
:
{
duration
:
0.4
,
delay
:
delay
*
0.1
,
ease
:
[
0.25
,
0.1
,
0.25
,
1
],
},
},
},
initial
:
'hidden'
,
animate
:
'visible'
,
}
}
export
const
Home
:
React
.
FC
=
()
=>
{
return
(
<
div
className=
{
styles
.
homePage
}
>
...
...
@@ -27,9 +54,10 @@ export const Home: React.FC = () => {
{
/* 欢迎语 */
}
<
div
className=
"gap-[20px] flex justify-center flex-row flex-wrap mt-[42px] sm:mt-[62px] lg:mt-[112px]"
>
<
WelcomeWord
/>
<
QuestionList
questions=
{
RECOMMEND_QUESTIONS_PRODUCT
}
dotColor=
"#D4CCFF"
title=
"产品问答"
iconImg=
{
HomeIcon1
}
/>
<
QuestionList
questions=
{
RECOMMEND_QUESTIONS_OTHER
}
dotColor=
"#CBECFF"
title=
"其他问答"
iconImg=
{
HomeIcon2
}
/>
<
motion
.
div
{
...
getAnimationProps
(1)}
><
WelcomeWord
/></
motion
.
div
>
<
motion
.
div
{
...
getAnimationProps
(2)}
><
QuestionList
questions=
{
RECOMMEND_QUESTIONS_PRODUCT
}
dotColor=
"#D4CCFF"
title=
"产品问答"
iconImg=
{
HomeIcon1
}
/></
motion
.
div
>
<
motion
.
div
{
...
getAnimationProps
(3)}
><
QuestionList
questions=
{
RECOMMEND_QUESTIONS_OTHER
}
dotColor=
"#CBECFF"
title=
"其他问答"
iconImg=
{
HomeIcon2
}
/></
motion
.
div
>
</
div
>
</
div
>
)
}
...
...
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