Commit eec81b91 authored by hewenhao's avatar hewenhao

feat: update

parent 9040cf1e
...@@ -49,14 +49,13 @@ ...@@ -49,14 +49,13 @@
.icon_wrap { .icon_wrap {
position: relative; position: relative;
margin-right: 24px;
} }
.rocket { .rocket {
position: absolute; position: absolute;
width: 34px; width: 34px;
height: 32px; height: 32px;
bottom: 0; bottom: 0;
right: -10px; right: 14px;
animation-name: updown; animation-name: updown;
animation-timing-function: ease-in-out; animation-timing-function: ease-in-out;
animation-duration: 1.3s; animation-duration: 1.3s;
...@@ -128,6 +127,7 @@ ...@@ -128,6 +127,7 @@
.achieve_icon { .achieve_icon {
width: 96px; width: 96px;
height: 96px; height: 96px;
margin-right: 24px;
} }
.bonus_icon { .bonus_icon {
...@@ -141,6 +141,7 @@ ...@@ -141,6 +141,7 @@
color: #00AEFF; color: #00AEFF;
line-height: 30px; line-height: 30px;
margin-top: 4px; margin-top: 4px;
text-align: center;
} }
.footer { .footer {
......
...@@ -28,7 +28,6 @@ const StageTag = (props: StageTagProps) => { ...@@ -28,7 +28,6 @@ const StageTag = (props: StageTagProps) => {
}, [url]) }, [url])
const uid = useMemo(() => `tag_${id}`, [id]) const uid = useMemo(() => `tag_${id}`, [id])
const bgid = useMemo(() => `bg_${id}`, [id])
useEffect(() => { useEffect(() => {
let observer: IntersectionObserver | null = null let observer: IntersectionObserver | null = null
...@@ -37,15 +36,6 @@ const StageTag = (props: StageTagProps) => { ...@@ -37,15 +36,6 @@ const StageTag = (props: StageTagProps) => {
const navVal = nav.current const navVal = nav.current
// @ts-ignore // @ts-ignore
observer = createIntersectionObserver() observer = createIntersectionObserver()
const animateBg = () => {
page?.animate?.(`#${bgid}`, [
{ opacity: 1 },
{ opacity: 0 },
], 700, () => {
observer?.disconnect()
observer = null
})
}
let timer: NodeJS.Timeout | null = null let timer: NodeJS.Timeout | null = null
if (url) { if (url) {
observer observer
...@@ -63,25 +53,10 @@ const StageTag = (props: StageTagProps) => { ...@@ -63,25 +53,10 @@ const StageTag = (props: StageTagProps) => {
{ opacity: 1, translateY: -20, scale: [1.5, 1.5], offset: 0.5 }, { opacity: 1, translateY: -20, scale: [1.5, 1.5], offset: 0.5 },
{ opacity: 1, translateY: -20, scale: [1.5, 1.5], offset: 0.75 }, { opacity: 1, translateY: -20, scale: [1.5, 1.5], offset: 0.75 },
{ opacity: 1, translateY: 0, scale: [1, 1] }, { opacity: 1, translateY: 0, scale: [1, 1] },
], 1000, animateBg) ], 1000, () => {})
}, 500) }, 500)
} }
}) })
} else {
observer
.relativeToViewport({ bottom: 0, top: -navVal.height - navVal.top - 5 - 50 })
.observe(`#${bgid}`, ({ intersectionRatio }) => {
if (intersectionRatio > 0) {
if (isAnimated) return
if (timer) {
clearTimeout(timer)
}
timer = setTimeout(() => {
setIsAnimated(true)
animateBg()
}, 900)
}
})
} }
} }
} }
...@@ -94,7 +69,7 @@ const StageTag = (props: StageTagProps) => { ...@@ -94,7 +69,7 @@ const StageTag = (props: StageTagProps) => {
observer = null observer = null
} }
} }
}, [uid, ready, bgid, url, page, isFocus, isAnimated]) }, [uid, ready, url, page, isFocus, isAnimated])
if (!ready) { if (!ready) {
return null return null
...@@ -105,7 +80,7 @@ const StageTag = (props: StageTagProps) => { ...@@ -105,7 +80,7 @@ const StageTag = (props: StageTagProps) => {
{url && ( {url && (
<Image src={url} className={className} style={{ opacity: 0 }} id={uid}></Image> <Image src={url} className={className} style={{ opacity: 0 }} id={uid}></Image>
)} )}
<Image src={assets['top-bg.png'].u} className={className} id={bgid}></Image> <Image src={assets['top-bg.png'].u} className={className}></Image>
</> </>
) )
} }
......
...@@ -47,8 +47,8 @@ ...@@ -47,8 +47,8 @@
@include flexLayout(_, center); @include flexLayout(_, center);
&-icon { &-icon {
width: 32PX; width: 64px;
height: 32PX; height: 64px;
margin-right: 4px; margin-right: 4px;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment