Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
QiuYeDx committed Sep 18, 2023
1 parent a158986 commit 4f0f24c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion src/modules/XList/DiscreteProgress.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ import {randomNum} from "@/utils/utils";
*/
const DiscreteProgress = ({ clientWidth, scrollWidth, scrollLeft, numberOfSteps = 5, distancePerStep = 100, gsapClass = null, scrollRef }) => {
const activeStep = Math.min(numberOfSteps, Math.floor((scrollLeft + 170) / distancePerStep) + 1);
console.info(numberOfSteps, Math.floor(scrollLeft / distancePerStep) + 1);
// console.info(numberOfSteps, Math.floor(scrollLeft / distancePerStep) + 1);
const random_num = randomNum(0, 999);
const [DELAY, setDELAY] = useState(1.8);
const notFirst = useRef(false);
Expand Down
4 changes: 0 additions & 4 deletions src/modules/XList/XList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ export default function XList({
const { clientWidth, scrollWidth, scrollPercentage, scrollLeft } = useHorizontalScroll(scrollRef, true);
const gsap_ref = useRef(null);

useEffect(() => {
console.info('isMobile, clientWidth, scrollWidth, scrollPercentage, scrollLeft: ', isMobile, clientWidth, scrollWidth, scrollPercentage, scrollLeft);
}, [isMobile, clientWidth, scrollWidth, scrollPercentage, scrollLeft]);

useLayoutEffect(() => {
// XListItem依次渐入
if (!gsap_ref.current) {
Expand Down

0 comments on commit 4f0f24c

Please sign in to comment.