securityos/node_modules/framer-motion/dist/es/projection/node/DocumentProjectionNode.mjs

14 lines
526 B
JavaScript
Raw Permalink Normal View History

2024-09-06 15:32:35 +00:00
import { createProjectionNode } from './create-projection-node.mjs';
import { addDomEvent } from '../../events/add-dom-event.mjs';
const DocumentProjectionNode = createProjectionNode({
attachResizeListener: (ref, notify) => addDomEvent(ref, "resize", notify),
measureScroll: () => ({
x: document.documentElement.scrollLeft || document.body.scrollLeft,
y: document.documentElement.scrollTop || document.body.scrollTop,
}),
checkIsScrollRoot: () => true,
});
export { DocumentProjectionNode };