Commit eec81b91 authored by hewenhao's avatar hewenhao

feat: update

parent 9040cf1e
......@@ -49,14 +49,13 @@
.icon_wrap {
position: relative;
margin-right: 24px;
}
.rocket {
position: absolute;
width: 34px;
height: 32px;
bottom: 0;
right: -10px;
right: 14px;
animation-name: updown;
animation-timing-function: ease-in-out;
animation-duration: 1.3s;
......@@ -128,6 +127,7 @@
.achieve_icon {
width: 96px;
height: 96px;
margin-right: 24px;
}
.bonus_icon {
......@@ -141,6 +141,7 @@
color: #00AEFF;
line-height: 30px;
margin-top: 4px;
text-align: center;
}
.footer {
......
......@@ -28,7 +28,6 @@ const StageTag = (props: StageTagProps) => {
}, [url])
const uid = useMemo(() => `tag_${id}`, [id])
const bgid = useMemo(() => `bg_${id}`, [id])
useEffect(() => {
let observer: IntersectionObserver | null = null
......@@ -37,15 +36,6 @@ const StageTag = (props: StageTagProps) => {
const navVal = nav.current
// @ts-ignore
observer = createIntersectionObserver()
const animateBg = () => {
page?.animate?.(`#${bgid}`, [
{ opacity: 1 },
{ opacity: 0 },
], 700, () => {
observer?.disconnect()
observer = null
})
}
let timer: NodeJS.Timeout | null = null
if (url) {
observer
......@@ -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.75 },
{ opacity: 1, translateY: 0, scale: [1, 1] },
], 1000, animateBg)
], 1000, () => {})
}, 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) => {
observer = null
}
}
}, [uid, ready, bgid, url, page, isFocus, isAnimated])
}, [uid, ready, url, page, isFocus, isAnimated])
if (!ready) {
return null
......@@ -105,7 +80,7 @@ const StageTag = (props: StageTagProps) => {
{url && (
<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 @@
@include flexLayout(_, center);
&-icon {
width: 32PX;
height: 32PX;
width: 64px;
height: 64px;
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