Commit e908bd76 authored by hewenhao's avatar hewenhao

feat: update

parent 818acc64
......@@ -63,7 +63,7 @@
align-items: center;
justify-content: center;
animation-name: fadeInUp;
animation-duration: .5s;
animation-duration: .3s;
animation-timing-function: ease-out;
animation-fill-mode: backwards;
animation-iteration-count: 1;
......@@ -72,10 +72,10 @@
animation-delay: 0;
}
&:nth-child(2) {
animation-delay: .3s;
animation-delay: .2s;
}
&:nth-child(3) {
animation-delay: .6s;
animation-delay: .4s;
}
}
......
......@@ -18,7 +18,7 @@
transition: all ease-out .3s;
transform: translateY(0px);
&.isShow {
&.is_hide {
opacity: 0;
pointer-events: none;
transform: translateY(-30px);
......
......@@ -13,10 +13,9 @@ type ShortCutProps = {
}
const ShortCut = (props: ShortCutProps) => {
const [isShow, setIsShow] = useState(true)
const [isHide, setIsHide] = useState(true)
const [isDown, setIsDown] = useState(false)
const scrollRef = useRef(0)
const lastEffectedScroll = useRef(0)
const stageList = useStoreState(state => state.mainModel.stageList)
usePageScroll((payload) => {
......@@ -27,18 +26,16 @@ const ShortCut = (props: ShortCutProps) => {
if (!stageList.some(c => c.status === StageStatus.CURRENT)) {
return
}
lastEffectedScroll.current = scrollRef.current
// @ts-ignore
let observer = createIntersectionObserver()
observer
.relativeToViewport({ bottom: 0 })
.observe(`#${CurrentRoundId}`, ({ intersectionRatio }) => {
const show = intersectionRatio > 0
setIsShow(show)
.observe(`#${CurrentRoundId}`, (res) => {
const { intersectionRatio, boundingClientRect } = res
const hide = intersectionRatio > 0
setIsHide(hide)
setIsDown(lastEffectedScroll.current < scrollRef.current)
lastEffectedScroll.current = scrollRef.current
setIsDown(boundingClientRect.top < 0)
})
return () => {
......@@ -51,9 +48,9 @@ const ShortCut = (props: ShortCutProps) => {
return (
<View className={styles.shortcut}>
<View className={classNames(styles.shortcutInner, isShow && styles.isShow)} onClick={props.onClick}>
<View className={classNames(styles.shortcutInner, isHide && styles.is_hide)} onClick={props.onClick}>
<Image src={assets['short-cut-bg.png'].u} className={styles.bg}></Image>
<Image src={assets['short-cut-arrow.png'].u} className={classNames(styles.arrow, ((!isShow && isDown) || (isShow && !isDown)) && styles.isDown)}></Image>
<Image src={assets['short-cut-arrow.png'].u} className={classNames(styles.arrow, ((!isHide && isDown) || (isHide && !isDown)) && styles.isDown)}></Image>
</View>
</View>
)
......
......@@ -41,7 +41,7 @@ const Scene5 = (props: Scene5Props) => {
<Text>各类题型,已经为你准备好啦。我这个数学大师不错吧!</Text>
)
: (
<Text>请问同学有哪些<Text className={styles.em}>计算问题</Text>需要提高呢?<Text className={styles.select}>多选</Text></Text>
<Text>请问同学有哪些<Text className={styles.em}>计算问题</Text>需要提高呢?<Text className={styles.select}>多选</Text></Text>
)}
</View>
{isSubmit && (
......
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