react-box-tools
Version:
Box tools react components, utils and hooks
2 lines (1 loc) • 400 B
JavaScript
function p(i){const t=i.currentTarget,e=document.createElement("span"),l=Math.max(t.offsetWidth,t.offsetHeight),s=l/2,c=t.getBoundingClientRect();e.style.width=e.style.height=`${l}px`,e.style.left=`${i.clientX-c.left-s}px`,e.style.top=`${i.clientY-c.top-s}px`,e.classList.add("ripple");const n=t.getElementsByClassName("ripple")[0];n&&n.remove(),t.appendChild(e)}exports.createRipple=p;
;