1/* 2 pointer.js was created by OwL for use on websites, 3 and can be found at https://www.garantiwebtasarim.com 4*/ 5 6const pointer = document.createElement("div") 7pointer.id = "pointer-dot" 8const ring = document.createElement("div") 9ring.id = "pointer-ring" 10document.body.insertBefore(pointer, document.body.children[0]) 11document.body.insertBefore(ring, document.body.children[0]) 12 13let mouseX = -100 14let mouseY = -100 15let ringX = -100 16let ringY = -100 17let isHover = false 18let mouseDown = false 19const init_pointer = (options) => { 20 21 window.onmousemove = (mouse) => { 22 mouseX = mouse.clientX 23 mouseY = mouse.clientY 24 } 25 26 window.onmousedown = (mouse) => { 27 mouseDown = true 28 } 29 30 window.onmouseup = (mouse) => { 31 mouseDown = false 32 } 33 34 const trace = (a, b, n) => { 35 return (1 - n) * a + n * b; 36 } 37 window["trace"] = trace 38 39 const getOption = (option) => { 40 let defaultObj = { 41 pointerColor: "#f1f1f1", 42 ringSize: 25, 43 ringClickSize: (options["ringSize"] || 15) - 5, 44 } 45 if (options[option] == undefined) { 46 return defaultObj[option] 47 } else { 48 return options[option] 49 } 50 } 51 52 const render = () => { 53 ringX = trace(ringX, mouseX, 0.2) 54 ringY = trace(ringY, mouseY, 0.2) 55 56 if (document.querySelector(".p-action-click:hover")) { 57 pointer.style.borderColor = getOption("pointerColor") 58 isHover = true 59 } else { 60 pointer.style.borderColor = "#ababab" 61 isHover = false 62 } 63 ring.style.borderColor = getOption("pointerColor") 64 if (mouseDown) { 65 ring.style.padding = getOption("ringClickSize") + "px" 66 } else { 67 ring.style.padding = getOption("ringSize") + "px" 68 } 69 70 pointer.style.transform = `translate(${mouseX}px, ${mouseY}px)` 71 ring.style.transform = `translate(${ringX - (mouseDown ? getOption("ringClickSize") : getOption("ringSize"))}px, ${ringY - (mouseDown ? getOption("ringClickSize") : getOption("ringSize"))}px)` 72 73 requestAnimationFrame(render) 74 } 75 requestAnimationFrame(render) 76}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.