2026-09-28 16:18:32 +00:00
|
|
|
// Module ID: 14613
|
|
|
|
|
// Function ID: 14614
|
2026-09-18 19:45:33 +00:00
|
|
|
// Name: useIsCarouselInView
|
2026-09-28 16:18:32 +00:00
|
|
|
// Dependencies: [32, 19, 1479, 2]
|
2026-09-26 17:57:22 +00:00
|
|
|
// Exports: default
|
2026-09-18 19:45:33 +00:00
|
|
|
|
2026-09-28 16:18:32 +00:00
|
|
|
// Module 14613 (useIsCarouselInView)
|
|
|
|
|
import useWindowDimensionsDefault from "useWindowDimensions" /* 1479 */;
|
2026-10-01 14:13:23 +00:00
|
|
|
import _slicedToArray from "_slicedToArray" /* 32 */;
|
|
|
|
|
import react from "react" /* 19 */;
|
|
|
|
|
import size from "module_2" /* 2 */;
|
2026-09-18 19:45:33 +00:00
|
|
|
|
|
|
|
|
const result = size.fileFinishedImporting("modules/quests/native/useIsCarouselInView.tsx");
|
|
|
|
|
|
2026-09-26 17:57:22 +00:00
|
|
|
export default function useIsCarouselInView() {
|
2026-10-01 14:13:23 +00:00
|
|
|
let closure_129_3;
|
|
|
|
|
let tmp4;
|
|
|
|
|
const containerRef = react.useRef(null);
|
2026-09-18 19:45:33 +00:00
|
|
|
const height = useWindowDimensionsDefault().height;
|
2026-10-01 14:13:23 +00:00
|
|
|
let closure_2 = react.useRef(height);
|
2026-09-18 19:45:33 +00:00
|
|
|
const items = [height];
|
2026-10-01 14:13:23 +00:00
|
|
|
const effect = react.useEffect(() => {
|
2026-09-18 19:45:33 +00:00
|
|
|
closure_2.current = height;
|
|
|
|
|
}, items);
|
2026-10-01 14:13:23 +00:00
|
|
|
[tmp4, closure_129_3] = _slicedToArray(react.useState(true), 2);
|
|
|
|
|
const tmp3 = _slicedToArray(react.useState(true), 2);
|
|
|
|
|
let closure_4 = react.useRef(isInView);
|
|
|
|
|
const effect1 = react.useEffect(() => {
|
|
|
|
|
const ref = setInterval(() => {
|
|
|
|
|
let ref2;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (null != ref.current) {
|
|
|
|
|
const current = ref.current;
|
|
|
|
|
current.measure((arg0, arg1, arg2, arg3, arg4, arg5) => {
|
|
|
|
|
const bound = Math.min(arg5 + arg3, ref.current);
|
2026-10-01 14:13:23 +00:00
|
|
|
const tmp2 = arg3 > 0 && max(0, bound - Math.max(arg5, 0)) / arg3 >= 0.5;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (tmp2 !== ref2.current) {
|
|
|
|
|
ref2.current = tmp2;
|
|
|
|
|
closure_1_3(tmp2);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}, 1000);
|
2026-10-01 14:13:23 +00:00
|
|
|
return () => clearInterval(ref);
|
2026-09-18 19:45:33 +00:00
|
|
|
}, []);
|
|
|
|
|
return { containerRef, isInView };
|
2026-09-26 17:57:22 +00:00
|
|
|
};
|