* Get the coordinates of elements adjusted for scroll position. * @param el - Element * @returns
(el: Element)
| 408 | * @returns |
| 409 | */ |
| 410 | function getCoords(el: Element): Coordinates { |
| 411 | const rect = el.getBoundingClientRect() |
| 412 | const { x, y } = getScrollOffset(el) |
| 413 | return { |
| 414 | top: rect.top + y, |
| 415 | left: rect.left + x, |
| 416 | width: rect.width, |
| 417 | height: rect.height, |
| 418 | } |
| 419 | } |
| 420 | |
| 421 | /** |
| 422 | * Returns the width/height that the element should be transitioned between. |
no test coverage detected
searching dependent graphs…