UNPKG

react-box-tools

Version:

Box tools react components, utils and hooks

10 lines (9 loc) 441 B
function p(l) { const t = l.currentTarget, e = document.createElement("span"), s = Math.max(t.offsetWidth, t.offsetHeight), c = s / 2, i = t.getBoundingClientRect(); e.style.width = e.style.height = `${s}px`, e.style.left = `${l.clientX - i.left - c}px`, e.style.top = `${l.clientY - i.top - c}px`, e.classList.add("ripple"); const n = t.getElementsByClassName("ripple")[0]; n && n.remove(), t.appendChild(e); } export { p as c };