{"id":21518765,"url":"https://github.com/halo-lab/magnetic-hover","last_synced_at":"2025-10-26T09:36:57.651Z","repository":{"id":39160147,"uuid":"254649241","full_name":"Halo-Lab/magnetic-hover","owner":"Halo-Lab","description":"magneticHover lets you trigger the hover effect on the element when the cursor is near it, but not over it yet","archived":false,"fork":false,"pushed_at":"2023-01-07T04:38:14.000Z","size":895,"stargazers_count":41,"open_issues_count":13,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T22:07:15.816Z","etag":null,"topics":["effects","js","promo"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Halo-Lab.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-10T14:04:34.000Z","updated_at":"2025-02-04T00:36:29.000Z","dependencies_parsed_at":"2023-02-06T12:01:39.748Z","dependency_job_id":null,"html_url":"https://github.com/Halo-Lab/magnetic-hover","commit_stats":null,"previous_names":["halo-lab/magnetichover"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Halo-Lab%2Fmagnetic-hover","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Halo-Lab%2Fmagnetic-hover/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Halo-Lab%2Fmagnetic-hover/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Halo-Lab%2Fmagnetic-hover/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Halo-Lab","download_url":"https://codeload.github.com/Halo-Lab/magnetic-hover/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248119296,"owners_count":21050755,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["effects","js","promo"],"created_at":"2024-11-24T00:53:52.878Z","updated_at":"2025-10-06T21:10:48.638Z","avatar_url":"https://github.com/Halo-Lab.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# magneticHover\n\nmagneticHover lets you trigger hover effect on the element when the cursor is near it, but not over it yet.\n\n## Examples\nhttps://codesandbox.io/s/elegant-bogdan-eupvp?file=/src/index.js \u003cbr /\u003e\nhttps://codesandbox.io/s/competent-kare-tnx6t?file=/src/index.js \u003cbr /\u003e\nhttps://codesandbox.io/s/friendly-tdd-pdyw3?file=/src/index.js\n\n\n## Installation\n```\nnpm install --save magnetic-hover\n```\n\n## Usage\n\n```\nimport MagneticHover from \"../js/magneticHover\";\n\n// find target element\nconst elem = document.getElementById(\"box\");\n\nnew MagneticHover({\n  element: elem,\n  radius: 122,\n  callback: (distance) =\u003e {\n    // get the distance from the cursor to the target element\n    console.log(distance);\n  },\n});\n```\n\n## Settings\n\n* element - DOM element\n* radius - how far from the target element callback should be triggered\n* callback - function that's gonna be triggered once cursor is over the range between radius and target element\n\n## Word from author\n\nHave fun! ✌️\n\n\u003ca href=\"https://www.halo-lab.com/?utm_source=github\"\u003e\n  \u003cimg src=\"https://dgestran.sirv.com/Images/supported-by-halolab.png\" alt=\"Supported by Halo lab\" height=\"60\"\u003e\n\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhalo-lab%2Fmagnetic-hover","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhalo-lab%2Fmagnetic-hover","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhalo-lab%2Fmagnetic-hover/lists"}