@supermousejs/magnetic 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/README.md +30 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
|
|
2
|
+
# @supermousejs/magnetic
|
|
3
|
+
|
|
4
|
+
A **Logic Plugin** that attracts the cursor to interactive elements.
|
|
5
|
+
|
|
6
|
+
## Installation
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
pnpm add @supermousejs/magnetic
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import { Supermouse } from '@supermousejs/core';
|
|
16
|
+
import { Magnetic } from '@supermousejs/magnetic';
|
|
17
|
+
|
|
18
|
+
const app = new Supermouse();
|
|
19
|
+
|
|
20
|
+
// Priority is handled automatically (-10)
|
|
21
|
+
app.use(Magnetic({
|
|
22
|
+
attraction: 0.3, // Strength (0-1)
|
|
23
|
+
distance: 100 // Capture radius in px
|
|
24
|
+
}));
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**HTML:**
|
|
28
|
+
```html
|
|
29
|
+
<button data-supermouse-magnetic="true">Magnetic Button</button>
|
|
30
|
+
```
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supermousejs/magnetic",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"main": "dist/index.umd.js",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@supermousejs/core": "2.0.
|
|
9
|
-
"@supermousejs/utils": "2.0.
|
|
8
|
+
"@supermousejs/core": "2.0.1",
|
|
9
|
+
"@supermousejs/utils": "2.0.1"
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {},
|
|
12
12
|
"peerDependencies": {},
|