2026-09-18 06:58:00 +00:00
|
|
|
// Module ID: 15290
|
|
|
|
|
// Function ID: 15291
|
2026-07-20 16:05:17 +00:00
|
|
|
// Name: useIsCarouselInView
|
2026-09-15 14:23:42 +00:00
|
|
|
// Dependencies: [32, 19, 1478, 2]
|
2026-07-20 16:05:17 +00:00
|
|
|
// Exports: default
|
|
|
|
|
|
2026-09-18 06:58:00 +00:00
|
|
|
// Module 15290 (useIsCarouselInView)
|
2026-09-15 14:23:42 +00:00
|
|
|
import useWindowDimensionsDefault from "useWindowDimensions" /* 1478 */;
|
2026-09-10 05:38:07 +00:00
|
|
|
import _slicedToArray from "module_32" /* 32 */;
|
|
|
|
|
import noop from "module_19" /* 19 */;
|
2026-07-23 10:11:24 +00:00
|
|
|
|
2026-09-10 05:38:07 +00:00
|
|
|
const size = fn(2);
|
|
|
|
|
const result = size.fileFinishedImporting("modules/quests/native/useIsCarouselInView.tsx");
|
2026-07-20 16:05:17 +00:00
|
|
|
|
|
|
|
|
export default function useIsCarouselInView() {
|
2026-09-10 05:38:07 +00:00
|
|
|
const containerRef = noop.useRef(null);
|
|
|
|
|
const height = useWindowDimensionsDefault().height;
|
|
|
|
|
closure_2 = noop.useRef(height);
|
2026-07-20 16:05:17 +00:00
|
|
|
const items = [height];
|
2026-09-10 05:38:07 +00:00
|
|
|
const effect = noop.useEffect(() => {
|
2026-08-24 06:08:38 +00:00
|
|
|
closure_2.current = height;
|
2026-07-20 16:05:17 +00:00
|
|
|
}, items);
|
2026-09-10 05:38:07 +00:00
|
|
|
[tmp4, noop] = noop.useState(true);
|
|
|
|
|
closure_4 = noop.useRef(isInView);
|
|
|
|
|
const effect1 = noop.useEffect(() => {
|
|
|
|
|
setInterval(() => {
|
2026-07-20 16:05:17 +00:00
|
|
|
if (null != ref.current) {
|
|
|
|
|
const current = ref.current;
|
|
|
|
|
current.measure((arg0, arg1, arg2, arg3, arg4, arg5) => {
|
2026-07-29 08:29:29 +00:00
|
|
|
const bound = Math.min(arg5 + arg3, ref.current);
|
2026-07-20 16:05:17 +00:00
|
|
|
let tmp2 = arg3 > 0;
|
|
|
|
|
if (tmp2) {
|
|
|
|
|
tmp2 = Math.max(0, bound - Math.max(arg5, 0)) / arg3 >= 0.5;
|
|
|
|
|
}
|
2026-07-29 08:29:29 +00:00
|
|
|
if (tmp2 !== ref2.current) {
|
|
|
|
|
ref2.current = tmp2;
|
2026-09-10 05:38:07 +00:00
|
|
|
closure_1_3(tmp2);
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}, 1000);
|
|
|
|
|
return () => clearInterval(closure_0);
|
|
|
|
|
}, []);
|
|
|
|
|
return { containerRef, isInView };
|
|
|
|
|
};
|