src/js/utils/modal.js
function positionModalOpening(targetElement, openingElement) {
  if (targetElement.getBoundingClientRect && openingElement instanceof SVGElement) {
    const { x, y, width, height, left, top } = targetElement.getBoundingClientRect();

    // getBoundingClientRect is not consistent. Some browsers use x and y, while others use left and top
    _setAttributes(openingElement, { x: x || left, y: y || top, width, height });
  }
}
function positionModalOpening(targetElement, openingElement) {
  if (targetElement.getBoundingClientRect && openingElement instanceof SVGElement) {
    const { x, y, width, height, left, top } = targetElement.getBoundingClientRect();

    // getBoundingClientRect is not consistent. Some browsers use x and y, while others use left and top
    _setAttributes(openingElement, { x: x || left, y: y || top, width, height });
  }
}
function positionModalOpening ( targetElement , openingElement ) { if ( targetElement . getBoundingClientRect && openingElement instanceof SVGElement ) { const { x , y , width , height , left , top } = targetElement . getBoundingClientRect ( ) ; // getBoundingClientRect is not consistent. Some browsers use x and y, while others use left and top _setAttributes ( openingElement , { x : x || left , y : y || top , width , height } ) ; } }
Uses the bounds of the element we want the opening overtop of to set the dimensions of the opening and position it
@param {HTMLElement} targetElement The element the opening will expose
@param {SVGElement} openingElement The svg mask for the opening
Uses the bounds of the element we want the opening overtop of to set the dimensions of the opening and position it