Commit e908bd76 authored by hewenhao's avatar hewenhao

feat: update

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