Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
GeekLearnMathWeapp
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
frontend
GeekLearnMathWeapp
Commits
4cf29630
Commit
4cf29630
authored
Apr 10, 2023
by
hewenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update
parent
e908bd76
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
stage-tag.tsx
src/pages/main/components/scene/stage-tag.tsx
+8
-1
No files found.
src/pages/main/components/scene/stage-tag.tsx
View file @
4cf29630
...
@@ -48,6 +48,7 @@ const StageTag = (props: StageTagProps) => {
...
@@ -48,6 +48,7 @@ const StageTag = (props: StageTagProps) => {
const
page
=
useMemo
(()
=>
getCurrentInstance
().
page
,
[])
const
page
=
useMemo
(()
=>
getCurrentInstance
().
page
,
[])
const
nav
=
useRef
(
getMenuButtonBoundingClientRect
())
const
nav
=
useRef
(
getMenuButtonBoundingClientRect
())
const
{
url
,
className
,
id
,
ready
}
=
props
const
{
url
,
className
,
id
,
ready
}
=
props
const
[
isAnimated
,
setIsAnimated
]
=
useState
(
false
)
const
isFocus
=
useFocus
()
const
isFocus
=
useFocus
()
const
scrollRef
=
useRef
(
0
)
const
scrollRef
=
useRef
(
0
)
...
@@ -55,10 +56,15 @@ const StageTag = (props: StageTagProps) => {
...
@@ -55,10 +56,15 @@ const StageTag = (props: StageTagProps) => {
scrollRef
.
current
=
payload
.
scrollTop
scrollRef
.
current
=
payload
.
scrollTop
})
})
useEffect
(()
=>
{
setIsAnimated
(
false
)
},
[
url
])
const
uid
=
useMemo
(()
=>
`tag_
${
id
}
`
,
[
id
])
const
uid
=
useMemo
(()
=>
`tag_
${
id
}
`
,
[
id
])
useEffect
(()
=>
{
useEffect
(()
=>
{
let
observer
:
IntersectionObserver
|
null
=
null
let
observer
:
IntersectionObserver
|
null
=
null
if
(
isAnimated
)
return
const
fn
=
()
=>
{
const
fn
=
()
=>
{
if
(
ready
&&
isFocus
)
{
if
(
ready
&&
isFocus
)
{
const
navVal
=
nav
.
current
const
navVal
=
nav
.
current
...
@@ -71,6 +77,7 @@ const StageTag = (props: StageTagProps) => {
...
@@ -71,6 +77,7 @@ const StageTag = (props: StageTagProps) => {
if
(
intersectionRatio
>
0
)
{
if
(
intersectionRatio
>
0
)
{
animationQueue
.
push
(()
=>
{
animationQueue
.
push
(()
=>
{
palyAudio
(
audio
[
'蹦蹦top出现首页.wav'
].
u
)
palyAudio
(
audio
[
'蹦蹦top出现首页.wav'
].
u
)
setIsAnimated
(
true
)
page
?.
animate
?.(
`#
${
uid
}
`
,
[
page
?.
animate
?.(
`#
${
uid
}
`
,
[
{
opacity
:
0
,
translateY
:
50
,
scale
:
[
1
,
1
]
},
{
opacity
:
0
,
translateY
:
50
,
scale
:
[
1
,
1
]
},
{
opacity
:
1
,
translateY
:
-
20
,
scale
:
[
1.5
,
1.5
],
offset
:
0.5
},
{
opacity
:
1
,
translateY
:
-
20
,
scale
:
[
1.5
,
1.5
],
offset
:
0.5
},
...
@@ -97,7 +104,7 @@ const StageTag = (props: StageTagProps) => {
...
@@ -97,7 +104,7 @@ const StageTag = (props: StageTagProps) => {
observer
=
null
observer
=
null
}
}
}
}
},
[
uid
,
ready
,
url
,
page
,
isFocus
])
},
[
uid
,
ready
,
url
,
page
,
isFocus
,
isAnimated
])
if
(
!
ready
)
{
if
(
!
ready
)
{
return
null
return
null
...
...
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