function startTracking(e) { e.preventDefault(); if (active) active.stop(); active = pointer() .pipe( (v) => { const nodePos = node.getBoundingClientRect(); const nodeCenter = { x: nodePos.left + (nodePos.width / 2), y: nodePos.top + (nodePos.height / 2) }; const angleFromCenter = angle(nodeCenter, v); return angleFromCenter; }, applyOffset(nodeRotation.get()) ) .start(nodeRotation); }
.start((e) => { e.preventDefault(); pointer(ballXY.get()).start(ballXY); });