export function getRelativePosition(child, parent) {
const childRect = child.getBoundingClientRect();
const parentRect = parent.getBoundingClientRect();
const top = childRect.top - parentRect.top;
const right = parentRect.right - childRect.right;
const bottom = parentRect.bottom - childRect.bottom;
const left = childRect.left - parentRect.left;
return { childRect, parentRect, top, right, bottom, left };
}