magneticHover lets you trigger hover effect on the element when the cursor is near it, but not over it yet.
Usage
import MagneticHover from "magnetic-hover"
const htmlElement= document.getElementById('element')
function showDistance(distance){
console.log(distance)
}
new MagneticHover({
element:htmlElement
radius:100,
callback:showDistance
})
Settings:
element - HTML element
radius - distance to element, where will work mousemove event
callback - function
Example: some link to example