first commit

This commit is contained in:
2025-11-06 13:59:10 +03:00
commit 778af9fd19
26 changed files with 2968 additions and 0 deletions

16
hooks/use-is-in-view.jsx Normal file
View File

@@ -0,0 +1,16 @@
import * as React from 'react';
import { useInView } from 'motion/react';
function useIsInView(ref, options = {}) {
const { inView, inViewOnce = false, inViewMargin = '0px' } = options;
const localRef = React.useRef(null);
React.useImperativeHandle(ref, () => localRef.current);
const inViewResult = useInView(localRef, {
once: inViewOnce,
margin: inViewMargin,
});
const isInView = !inView || inViewResult;
return { ref: localRef, isInView };
}
export { useIsInView };