MCPcopy
hub / github.com/formkit/auto-animate / getCoords

Function getCoords

src/index.ts:410–419  ·  view source on GitHub ↗

* Get the coordinates of elements adjusted for scroll position. * @param el - Element * @returns

(el: Element)

Source from the content-addressed store, hash-verified

408 * @returns
409 */
410function 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.

Callers 5

observePositionFunction · 0.85
updatePosFunction · 0.85
remainFunction · 0.85
addFunction · 0.85
deletePositionFunction · 0.85

Calls 1

getScrollOffsetFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…