@supermousejs/core 2.4.2 → 2.5.0-beta.0
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 +46 -0
- package/README.md +158 -334
- package/dist/index.d.ts +137 -55
- package/dist/index.mjs +467 -312
- package/dist/index.umd.js +2 -10
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,51 @@
|
|
|
1
1
|
# @supermousejs/core
|
|
2
2
|
|
|
3
|
+
## 2.5.0-beta.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 0af4732: Architecture rewrite for v2.5. This is a beta, therefore expect API surface churn before the stable release.
|
|
8
|
+
|
|
9
|
+
**Scopes.** A single instance can now own multiple scopes. Pass them at construction or add them at runtime:
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
const mouse = new Supermouse({
|
|
13
|
+
scopes: [{ name: "sidebar", container: sidebarEl, cursor: "native" }]
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const handle = mouse.addScope({ container: modalEl, cursor: "custom" });
|
|
17
|
+
handle.setCursor("auto");
|
|
18
|
+
handle.remove();
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The innermost scope whose container contains the pointer is the active one. Plugin installation, cursor mode, hover selectors, and native-cursor state are all managed per scope.
|
|
22
|
+
|
|
23
|
+
**Cursor policy.** `NATIVE_TAGS` and the old `Stage.selectors` are unified into a single `CursorPolicy`. Pass a custom policy via `cursorPolicy` at the top level or per scope. `DEFAULT_CURSOR_POLICY` is exported for spreading.
|
|
24
|
+
|
|
25
|
+
**Ancestor-chain interaction.** `data-supermouse-*` attributes and `rules` now cascade from ancestors to the hovered element, ensuring the closest ancestor wins. This fixes the tag-inside-a-tag class of bugs. Disable with `inheritDataAttributes: false`.
|
|
26
|
+
|
|
27
|
+
**Lifecycle.** `onBeforeDisable` (and its `definePlugin` equivalent, `beforeDisable`) is now scope-aware: when a scope deactivates, each of its plugins runs `onBeforeDisable`, and the core waits for any returned Promise before hiding the element and calling `onDisable`.
|
|
28
|
+
|
|
29
|
+
**Changed.**
|
|
30
|
+
- `disable()` no longer resets physics. Call `disable({ reset: true })` for the old behavior.
|
|
31
|
+
- `suspend()` and `resume()` are removed. Use scopes.
|
|
32
|
+
- `registerHoverTarget` now mutates the active scope's selector set. It's still available for raw-object plugins, but `definePlugin`'s `selector` option is preferred.
|
|
33
|
+
- Stage no longer owns an individual `<style>` tag. All scopes share a single engine-level stylesheet.
|
|
34
|
+
|
|
35
|
+
**Removed.**
|
|
36
|
+
- `NATIVE_TAGS`, `SUPERMOUSE_CURSORS` internal constants (moved into policy).
|
|
37
|
+
- `Stage.addSelector` / `Stage.addSelectors` no-ops.
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- 1325a9c: Reorganized Supermouse core for better tree-shaking and module isolation
|
|
42
|
+
|
|
43
|
+
## 2.4.3
|
|
44
|
+
|
|
45
|
+
### Patch Changes
|
|
46
|
+
|
|
47
|
+
- 16a387f: Updated README with npm-sensible quick start section
|
|
48
|
+
|
|
3
49
|
## 2.4.2
|
|
4
50
|
|
|
5
51
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,334 +1,158 @@
|
|
|
1
|
-
# Supermouse.js - TypeScript cursor engine
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/@supermousejs/core)
|
|
4
|
-
[](https://www.npmjs.com/package/@supermousejs/core)
|
|
5
|
-
[](https://opensource.org/licenses/MIT)
|
|
6
|
-

|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
There are four modes:
|
|
160
|
-
|
|
161
|
-
- **`"auto"`** (default) – Supermouse looks at whatever is under the pointer and makes a reasonable choice. Over buttons, links, inputs, and other native controls, the native OS cursor appears; everywhere else, your custom cursor takes over. This is the best starting point and for most projects, it's what you're going to use without extra configuration.
|
|
162
|
-
|
|
163
|
-
- **`"custom"`** – The custom cursor is always shown, and the native cursor is always hidden. This is the mode you'd use when you want complete visual control and are confident your custom cursor handles all interactions gracefully.
|
|
164
|
-
|
|
165
|
-
- **`"native"`** – The native cursor is always visible, and the custom cursor stays hidden. Useful when you temporarily want to give full control back to the OS.
|
|
166
|
-
|
|
167
|
-
- **`"both"`** – Both the native cursor and the custom cursor are visible at the same time. This is particularly useful for effects that surround the native pointer such as a ring that highlights the native arrow, or a trail that follows the real cursor.
|
|
168
|
-
|
|
169
|
-
You can switch modes at any time with:
|
|
170
|
-
|
|
171
|
-
```ts
|
|
172
|
-
mouse.setCursor("both");
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
If you’re coming from an older version and relied on those options, the following table might help you translate:
|
|
176
|
-
|
|
177
|
-
| Old behaviour | New `cursor` value |
|
|
178
|
-
| -------------------------------------------- | ---------------------------------------------------------- |
|
|
179
|
-
| `hideCursor: true`, `ignoreOnNative: "auto"` | `"auto"` |
|
|
180
|
-
| `hideCursor: true`, `ignoreOnNative: null` | `"custom"` |
|
|
181
|
-
| `hideCursor: false` | `"both"` or `"native"` depending on the rest of your setup |
|
|
182
|
-
|
|
183
|
-
The rest of the documentation uses `cursor` consistently. If you have questions about a specific migration case, the [options documentation](https://supermouse.js.org/advanced/api) covers the details.
|
|
184
|
-
|
|
185
|
-
### Containers
|
|
186
|
-
|
|
187
|
-
By default, Supermouse appends the cursor stage to `document.body` and uses global event listeners. You can scope an instance to a specific container:
|
|
188
|
-
|
|
189
|
-
```ts
|
|
190
|
-
const modal = document.getElementById("my-modal");
|
|
191
|
-
|
|
192
|
-
const app = new Supermouse({
|
|
193
|
-
container: modal,
|
|
194
|
-
cursor: "custom"
|
|
195
|
-
});
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
This allows multiple independent instances on the same page. CSS and cursor‑hiding rules are scoped to avoid leakage. For example:
|
|
199
|
-
|
|
200
|
-
```ts
|
|
201
|
-
// Main page cursor
|
|
202
|
-
const app1 = new Supermouse({
|
|
203
|
-
container: document.body,
|
|
204
|
-
cursor: "custom"
|
|
205
|
-
});
|
|
206
|
-
app1.use(Dot({ color: "red" }));
|
|
207
|
-
|
|
208
|
-
// Modal cursor
|
|
209
|
-
const app2 = new Supermouse({
|
|
210
|
-
container: document.getElementById("modal"),
|
|
211
|
-
cursor: "both"
|
|
212
|
-
});
|
|
213
|
-
app2.use(Dot({ color: "blue" }));
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
### Forcing Native Cursor on an Element
|
|
217
|
-
|
|
218
|
-
When `cursor` is `"auto"`, Supermouse automatically detects when to show the native OS cursor. To force native cursor on an element and its descendants, add the attribute `data-supermouse-ignore`:
|
|
219
|
-
|
|
220
|
-
```html
|
|
221
|
-
<div data-supermouse-ignore>This area will show the native cursor</div>
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
This only works when `cursor` is `"auto"`.
|
|
225
|
-
|
|
226
|
-
> **Note:** Custom cursors often break usability on native controls (inputs, text selection, drag handles). The `"auto"` cursor mode briefly yields control back to the OS cursor for these interactions, ensuring accessibility.
|
|
227
|
-
|
|
228
|
-
### Data Attributes
|
|
229
|
-
|
|
230
|
-
Some plugins can be reactive to HTML data attributes. For example, `Dot` watches for `data-supermouse-color`:
|
|
231
|
-
|
|
232
|
-
```html
|
|
233
|
-
<div data-supermouse-color="#fff000">...</div>
|
|
234
|
-
```
|
|
235
|
-
|
|
236
|
-
The `dataPrefix` option can customize this:
|
|
237
|
-
|
|
238
|
-
```ts
|
|
239
|
-
const app = new Supermouse({ dataPrefix: "sm" });
|
|
240
|
-
```
|
|
241
|
-
|
|
242
|
-
```html
|
|
243
|
-
<div data-sm-stick>Sticky Zone</div>
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
`data-supermouse-ignore` becomes `data-sm-ignore`.
|
|
247
|
-
|
|
248
|
-
### Rules
|
|
249
|
-
|
|
250
|
-
Use `rules` to define interaction data without writing many data attributes:
|
|
251
|
-
|
|
252
|
-
```ts
|
|
253
|
-
const app = new Supermouse({
|
|
254
|
-
rules: {
|
|
255
|
-
".primary-action": {
|
|
256
|
-
magnetic: true,
|
|
257
|
-
distance: 200,
|
|
258
|
-
color: "red",
|
|
259
|
-
text: "Click!",
|
|
260
|
-
scale: 1.5
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
});
|
|
264
|
-
```
|
|
265
|
-
|
|
266
|
-
When both rules and data attributes apply to the same element, the HTML `data-supermouse-*` attribute wins for that property.
|
|
267
|
-
|
|
268
|
-
## API
|
|
269
|
-
|
|
270
|
-
```ts
|
|
271
|
-
const mouse = new Supermouse(options?);
|
|
272
|
-
|
|
273
|
-
// Mouse state read inside plugins
|
|
274
|
-
mouse.state
|
|
275
|
-
// All options with defaults applied
|
|
276
|
-
mouse.options
|
|
277
|
-
// The DOM element the plugins render into
|
|
278
|
-
mouse.stage
|
|
279
|
-
|
|
280
|
-
// Whether the instance is currently processing input
|
|
281
|
-
mouse.isEnabled
|
|
282
|
-
|
|
283
|
-
// Start processing input and re-apply cursor state
|
|
284
|
-
mouse.enable()
|
|
285
|
-
// Stop processing input, restore native cursor, reset state
|
|
286
|
-
mouse.disable()
|
|
287
|
-
// Pause input and hide the stage without destroying the instance
|
|
288
|
-
mouse.suspend()
|
|
289
|
-
// Resume input and show the stage
|
|
290
|
-
mouse.resume()
|
|
291
|
-
|
|
292
|
-
// Set cursor mode: "auto" | "custom" | "native" | "both"
|
|
293
|
-
mouse.setCursor(mode)
|
|
294
|
-
|
|
295
|
-
// Install a plugin
|
|
296
|
-
mouse.use(plugin)
|
|
297
|
-
// Return a plugin by name
|
|
298
|
-
mouse.getPlugin(name)
|
|
299
|
-
// Enable a disabled plugin
|
|
300
|
-
mouse.enablePlugin(name)
|
|
301
|
-
// Disable a plugin
|
|
302
|
-
mouse.disablePlugin(name)
|
|
303
|
-
// Toggle a plugin's enabled state
|
|
304
|
-
mouse.togglePlugin(name)
|
|
305
|
-
|
|
306
|
-
// Add a selector at runtime. Whenever the cursor hovers over this selector, Supermouse detects it and hides the native cursor for it
|
|
307
|
-
mouse.registerHoverTarget(selector)
|
|
308
|
-
|
|
309
|
-
// Start the animation loop if stopped
|
|
310
|
-
mouse.start()
|
|
311
|
-
// Advance one frame manually
|
|
312
|
-
mouse.step(time)
|
|
313
|
-
|
|
314
|
-
// Destroy Supermouse and plugin instances
|
|
315
|
-
mouse.destroy()
|
|
316
|
-
```
|
|
317
|
-
|
|
318
|
-
## Browser support
|
|
319
|
-
|
|
320
|
-
Supermouse.js supports all modern browsers.
|
|
321
|
-
|
|
322
|
-
## Contributing
|
|
323
|
-
|
|
324
|
-
Any bug fixes, performance / docs improvements are welcome. Before adding new effects or features to core, please read [how to contribute](https://github.com/Whitestar14/supermouse-js/blob/main/CONTRIBUTING.md).
|
|
325
|
-
|
|
326
|
-
## Credits
|
|
327
|
-
|
|
328
|
-
This project was heavily inspired by [Pointer.js](https://github.com/mageowl/pointer.js) and the cursor effects gallery, [Curzr](https://github.com/fuzionix/curzr).
|
|
329
|
-
|
|
330
|
-
## License
|
|
331
|
-
|
|
332
|
-
MIT
|
|
333
|
-
|
|
334
|
-
Built and maintained by [Whitestar14](https://github.com/Whitestar14)
|
|
1
|
+
# Supermouse.js - TypeScript cursor engine
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@supermousejs/core)
|
|
4
|
+
[](https://www.npmjs.com/package/@supermousejs/core)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+

|
|
7
|
+
|
|
8
|
+
Supermouse is a headless, physics‑based cursor engine for the web written in TypeScript. It provides pointer tracking, state, physics, and a plugin lifecycle. You install plugins (or write your own) to render custom cursors and effects. The core is zero‑dependency and TypeScript‑first.
|
|
9
|
+
|
|
10
|
+
**Documentation:** [supermouse.js.org](https://supermouse.js.org)
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pnpm add @supermousejs/core
|
|
16
|
+
npm install @supermousejs/core
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Install plugins you need:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pnpm add @supermousejs/dot @supermousejs/ring
|
|
23
|
+
npm install @supermousejs/dot @supermousejs/ring
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Quick Start
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
import { Supermouse } from "@supermousejs/core";
|
|
30
|
+
import { Dot } from "@supermousejs/dot";
|
|
31
|
+
|
|
32
|
+
const mouse = new Supermouse({
|
|
33
|
+
plugins: [Dot({ size: 8 })]
|
|
34
|
+
});
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Or use the plugin interface directly:
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
import { Supermouse } from "@supermousejs/core";
|
|
41
|
+
|
|
42
|
+
const dot = document.createElement("div");
|
|
43
|
+
// ... style dot ...
|
|
44
|
+
|
|
45
|
+
const redDot = {
|
|
46
|
+
name: "red-dot",
|
|
47
|
+
install(app) {
|
|
48
|
+
app.stage.appendChild(dot);
|
|
49
|
+
},
|
|
50
|
+
update(app) {
|
|
51
|
+
const { smooth } = app.state;
|
|
52
|
+
dot.style.transform = `translate3d(${smooth.x}px, ${smooth.y}px, 0)`;
|
|
53
|
+
},
|
|
54
|
+
destroy() {
|
|
55
|
+
dot.remove();
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const mouse = new Supermouse({ plugins: [redDot] });
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Options
|
|
63
|
+
|
|
64
|
+
| Option | Default | Description |
|
|
65
|
+
| --------------------- | ----------------------------------------------------------------------- | --------------------------------------------- |
|
|
66
|
+
| `smoothness` | `0.15` | Lower = smoother cursor follow |
|
|
67
|
+
| `hoverSelectors` | `["a", "button", "input", "textarea", "[data-hover]", "[data-cursor]"]` | Selectors that set `state.isHover` |
|
|
68
|
+
| `enableTouch` | `false` | Allow touch events to move cursor |
|
|
69
|
+
| `autoDisableOnMobile` | `true` | Disable on coarse‑pointer devices |
|
|
70
|
+
| `cursor` | `"auto"` | `"auto"`, `"custom"`, `"native"`, or `"both"` |
|
|
71
|
+
| `hideOnLeave` | `true` | Hide when pointer leaves window |
|
|
72
|
+
| `container` | `document.body` | Scoping container |
|
|
73
|
+
| `zIndex` | `9999` | Stage stacking order |
|
|
74
|
+
| `dataPrefix` | `"supermouse"` | Prefix for data attributes |
|
|
75
|
+
| `rules` | — | Map of selectors to interaction data |
|
|
76
|
+
| `plugins` | — | Plugins to install at creation |
|
|
77
|
+
| `autoStart` | `true` | Set `false` and call `.start()` manually |
|
|
78
|
+
|
|
79
|
+
## Cursor Modes
|
|
80
|
+
|
|
81
|
+
- `"auto"` – native cursor on interactive elements, custom elsewhere.
|
|
82
|
+
- `"custom"` – always custom, hide native.
|
|
83
|
+
- `"native"` – always native, hide custom.
|
|
84
|
+
- `"both"` – show both native and custom together.
|
|
85
|
+
|
|
86
|
+
Change at runtime with `mouse.setCursor("both")`.
|
|
87
|
+
|
|
88
|
+
## Containers & Multiple Instances
|
|
89
|
+
|
|
90
|
+
Scope an instance to a container:
|
|
91
|
+
|
|
92
|
+
```ts
|
|
93
|
+
const modal = document.getElementById("modal");
|
|
94
|
+
const mouse = new Supermouse({ container: modal, cursor: "custom" });
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Multiple instances can coexist; CSS rules are scoped automatically.
|
|
98
|
+
|
|
99
|
+
## Native Cursor Fallback
|
|
100
|
+
|
|
101
|
+
In `"auto"` mode, add `data-supermouse-ignore` to force the native cursor on an element and its descendants.
|
|
102
|
+
|
|
103
|
+
```html
|
|
104
|
+
<div data-supermouse-ignore>Native cursor here</div>
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Data Attributes
|
|
108
|
+
|
|
109
|
+
Plugins can react to `data-*` attributes, e.g. `data-supermouse-color`. The prefix is configurable via `dataPrefix`.
|
|
110
|
+
|
|
111
|
+
## Rules
|
|
112
|
+
|
|
113
|
+
Define interaction data without writing many attributes:
|
|
114
|
+
|
|
115
|
+
```ts
|
|
116
|
+
const mouse = new Supermouse({
|
|
117
|
+
rules: {
|
|
118
|
+
".primary-action": { magnetic: true, color: "red" }
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
HTML `data-*` attributes override rule values per property.
|
|
124
|
+
|
|
125
|
+
## API
|
|
126
|
+
|
|
127
|
+
```ts
|
|
128
|
+
mouse.state; // current MouseState
|
|
129
|
+
mouse.options; // resolved options
|
|
130
|
+
mouse.stage; // DOM element plugins render into
|
|
131
|
+
mouse.isEnabled; // boolean
|
|
132
|
+
|
|
133
|
+
mouse.enable(); // start input, hide native cursor
|
|
134
|
+
mouse.disable(); // stop input, show native cursor, reset
|
|
135
|
+
mouse.suspend(); // pause non‑destructively
|
|
136
|
+
mouse.resume(); // resume from suspend
|
|
137
|
+
|
|
138
|
+
mouse.setCursor(mode); // "auto" | "custom" | "native" | "both"
|
|
139
|
+
|
|
140
|
+
mouse.use(plugin); // install plugin
|
|
141
|
+
mouse.getPlugin(name); // retrieve plugin
|
|
142
|
+
mouse.enablePlugin(name); // enable plugin
|
|
143
|
+
mouse.disablePlugin(name); // disable plugin
|
|
144
|
+
mouse.togglePlugin(name); // toggle plugin
|
|
145
|
+
|
|
146
|
+
mouse.registerHoverTarget(sel); // add hover selector at runtime
|
|
147
|
+
mouse.start(); // start animation loop
|
|
148
|
+
mouse.step(time); // advance one frame manually
|
|
149
|
+
mouse.destroy(); // destroy instance and plugins
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Browser Support
|
|
153
|
+
|
|
154
|
+
All modern browsers.
|
|
155
|
+
|
|
156
|
+
## License
|
|
157
|
+
|
|
158
|
+
MIT
|