function getElementRect(element) {
  const style = window.getComputedStyle(element, null);
  return {
    x: getPropertyValue(style, 'left'),
    y: getPropertyValue(style, 'top'),
    width: getPropertyValue(style, 'width'),
    height: getPropertyValue(style, 'height')
  };
}
Get an elements bounding rectagle.
@param {HTMLElement} element - A DOM element to get the bounding rectangle for.
@returns {{x: number, y: number, width: number, height: number}} - The bounding rectangle.