Various dom utilities
import { getTransitionDuration } from "oj-dom-utils"
const duration = getTransitionDuration(element, deep)
const height = getOuterHeight(element)
const width = getOuterWidth(element)
const offset = getOffsetsOnPage(element)
const visible = withinViewport(element, completely)
const childExistsInContainerElement = childOf(container, child)
const handle = e => {
const { clientX, clientY } = getEventProps(e) // normalized
}
window.addEventListener("mousemove", handle)
window.addEventListener("touchmove", handle)
window.addEventListener("mousemove", e => {
const elementOffsetX = getOffsetX(e)
})
window.addEventListener("mousemove", e => {
const elementOffsetY = getOffsetY(e)
})
const newChildDiv = appendDivTo(element)
const text = sanitizeHTML(text)
const b64 = jsonToB64(obj)
const obj = jsonFromB64(b64)
await loadScript(url) // appends script tag to body
data-loaded="true" will be set on all returned elements. elements with this attribute wont be selected the next time.
const elements = getRootElements(selector)
selects the first input field within the element and returns the value as json
const data = getRootData(element)
uses getRootElements and getRootData
mounter("[data-dialog]", (root, data) => {
new Dialog(root, data)
})