MCPcopy Index your code
hub / github.com/hoothin/UserScripts / mouseMoveHandler

Method mouseMoveHandler

Pagetual/pagetual.user.js:8278–8290  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8276 };
8277
8278 let mouseMoveHandler = e => {
8279 if (moving) {
8280 let windowHeight = window.innerHeight || document.documentElement.clientHeight;
8281 let windowWidth = window.innerWidth || document.documentElement.clientWidth;
8282 perX = (clientX(e) - 10 + 40) / windowWidth * 100;
8283 perY = (clientY(e) - 83 + 83) / windowHeight * 100;
8284 this.frame.style.top = `calc(${perY}% - 83px)`;
8285 this.frame.style.left = `calc(${perX}% - 40px)`;
8286 } else if (Math.abs(clientX(e) - initX) + Math.abs(clientY(e) - initY) > 5) {
8287 moving = true;
8288 clearTimeout(removeTimer);
8289 }
8290 };
8291 let mouseUpHandler = e => {
8292 clearTimeout(removeTimer);
8293 document.removeEventListener("mousemove", mouseMoveHandler, true);

Callers

nothing calls this directly

Calls 2

clientXFunction · 0.85
clientYFunction · 0.85

Tested by

no test coverage detected