加入新的打赏码;

文章详情页重新排班;
文章卡牌动画调整;
This commit is contained in:
tangly1024
2021-11-05 13:20:02 +08:00
parent ded8f27c2a
commit 15fb499f44
14 changed files with 68 additions and 58 deletions

View File

@@ -8,7 +8,7 @@ import throttle from 'lodash.throttle'
*/
const Progress = ({ targetRef }) => {
const [percent, changePercent] = useState(0)
const scrollListener = useCallback(throttle(() => {
const scrollListener = () => {
if (targetRef.current) {
const clientHeight = targetRef ? (targetRef.current.clientHeight) : 0
const scrollY = window.pageYOffset
@@ -17,7 +17,7 @@ const Progress = ({ targetRef }) => {
if (per > 100) per = 100
changePercent(per)
}
}, 100))
}
useEffect(() => {
document.addEventListener('scroll', scrollListener)