@supermousejs/stick 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 +29 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/README.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
|
|
2
|
+
# @supermousejs/stick
|
|
3
|
+
|
|
4
|
+
A **Logic Plugin** that calculates the bounding box of hovered elements.
|
|
5
|
+
Used in combination with `@supermousejs/ring` (or SmartRing) to create a morphing effect.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm add @supermousejs/stick
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { Supermouse } from '@supermousejs/core';
|
|
17
|
+
import { Stick } from '@supermousejs/stick';
|
|
18
|
+
import { Ring } from '@supermousejs/ring';
|
|
19
|
+
|
|
20
|
+
const app = new Supermouse();
|
|
21
|
+
|
|
22
|
+
app.use(Stick({ padding: 10 }));
|
|
23
|
+
app.use(Ring()); // Ring automatically detects 'stick' state and morphs
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**HTML:**
|
|
27
|
+
```html
|
|
28
|
+
<button data-supermouse-stick="true">Sticky Element</button>
|
|
29
|
+
```
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supermousejs/stick",
|
|
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/
|
|
9
|
-
"@supermousejs/
|
|
8
|
+
"@supermousejs/utils": "2.0.1",
|
|
9
|
+
"@supermousejs/core": "2.0.1"
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {},
|
|
12
12
|
"peerDependencies": {},
|