⚠️ Notice: As so far, you need to manage when to updateCursor yourself. Make sure to call updateCursor after dom updated.
In the future, there maybe a better way to handle this, see Roadmap for more details.
Custom Style
You can customize the style of the cursor by Config, config can be passed to initCursor method, or use updateConfig method to update config. Every type can be configured separately.
When initCursor called, it will remove default cursor, and generate a fake cursor use div element. Then listen mousemove event, and move the fake cursor to the mouse position.
After init finished, it will call updateCursor method, scan element with data-cursor attribute, detect the cursor type, and add event listener to the element.
Init cursor, remove default cursor, and generate a fake cursor use div element. Then listen mousemove event, and move the fake cursor to the mouse position.
updateCursor
Scan element to observe hover event, and apply styles, as well as remove unused element's event listener.
disposeCursor
Remove fake cursor, and remove all event listener, recover default cursor.
Mouse effect of iPad in browser that can be used in any framework
The npm package ipad-cursor receives a total of 41 weekly downloads. As such, ipad-cursor popularity was classified as not popular.
We found that ipad-cursor demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.It has 1 open source maintainer collaborating on the project.
Package last updated on 30 Jul 2023
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."