Initial commit
This commit is contained in:
27
node_modules/framer-motion/dist/es/projection/node/HTMLProjectionNode.mjs
generated
vendored
Normal file
27
node_modules/framer-motion/dist/es/projection/node/HTMLProjectionNode.mjs
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
import { createProjectionNode } from './create-projection-node.mjs';
|
||||
import { DocumentProjectionNode } from './DocumentProjectionNode.mjs';
|
||||
|
||||
const rootProjectionNode = {
|
||||
current: undefined,
|
||||
};
|
||||
const HTMLProjectionNode = createProjectionNode({
|
||||
measureScroll: (instance) => ({
|
||||
x: instance.scrollLeft,
|
||||
y: instance.scrollTop,
|
||||
}),
|
||||
defaultParent: () => {
|
||||
if (!rootProjectionNode.current) {
|
||||
const documentNode = new DocumentProjectionNode({});
|
||||
documentNode.mount(window);
|
||||
documentNode.setOptions({ layoutScroll: true });
|
||||
rootProjectionNode.current = documentNode;
|
||||
}
|
||||
return rootProjectionNode.current;
|
||||
},
|
||||
resetTransform: (instance, value) => {
|
||||
instance.style.transform = value !== undefined ? value : "none";
|
||||
},
|
||||
checkIsScrollRoot: (instance) => Boolean(window.getComputedStyle(instance).position === "fixed"),
|
||||
});
|
||||
|
||||
export { HTMLProjectionNode, rootProjectionNode };
|
||||
Reference in New Issue
Block a user