ripppl 0.1.1 → 0.1.3
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/README.md +7 -3
- package/dist/ripppl.d.ts +5 -0
- package/dist/ripppl.d.ts.map +1 -1
- package/dist/ripppl.js +5738 -556
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
<p align="center">Ripple displacement using WebGL over the DOM.</p>
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
6
|
-
<img src="https://raw.githubusercontent.com/Arman-Luthra/ripppl/main/
|
|
7
|
-
<img src="https://raw.githubusercontent.com/Arman-Luthra/ripppl/main/demo-2.gif" alt="" width="49%" />
|
|
6
|
+
<img src="https://raw.githubusercontent.com/Arman-Luthra/ripppl/main/media/demo-1.gif" alt="" width="49%" />
|
|
7
|
+
<img src="https://raw.githubusercontent.com/Arman-Luthra/ripppl/main/media/demo-2.gif" alt="" width="49%" />
|
|
8
8
|
</p>
|
|
9
9
|
|
|
10
10
|
## Installation
|
|
@@ -36,9 +36,13 @@ The returned **handle** exposes:
|
|
|
36
36
|
| Method | Purpose |
|
|
37
37
|
|--------|---------|
|
|
38
38
|
| `update(partial)` | Merge new tuning values (see parameters below). |
|
|
39
|
-
| `trigger({ x?, y? })` | Start a ripple at normalized coordinates **0–1** inside the scope
|
|
39
|
+
| `trigger({ x?, y?, fromElement? })` | Start a ripple at normalized coordinates **0–1** inside the scope, or centered on `fromElement`. |
|
|
40
|
+
| `invalidateCapture()` | Mark the frozen DOM snapshot stale (for example after layout or content changes). The next `trigger` will capture again unless you prefetch first. |
|
|
41
|
+
| `prefetchCapture()` | Start a background capture while the DOM is in a known-good state. Use when you know you will call `trigger` soon so capture work overlaps with transitions, loaders, or countdowns instead of blocking the first frame of the ripple. |
|
|
40
42
|
| `destroy()` | Remove listeners, overlay, and WebGL resources. |
|
|
41
43
|
|
|
44
|
+
Export **`RIPPPL_CAPTURE_IGNORE_ATTR`**: the attribute name (`data-ripppl-overlay`) placed on the WebGL overlay and on any element that must be omitted from the snapshot. Apply it to temporary UI that should not appear in the captured texture while `prefetchCapture` runs.
|
|
45
|
+
|
|
42
46
|
Types: `RippleOptions`, `RippleTuning`, `RippleHandle` are exported from the package.
|
|
43
47
|
|
|
44
48
|
## Parameters
|
package/dist/ripppl.d.ts
CHANGED
|
@@ -14,13 +14,18 @@ export type RippleTuning = {
|
|
|
14
14
|
};
|
|
15
15
|
export type RippleOptions = RippleTuning & {
|
|
16
16
|
scope?: string | HTMLElement;
|
|
17
|
+
exclude?: boolean | TriggerInput;
|
|
17
18
|
};
|
|
19
|
+
export declare const RIPPPL_CAPTURE_IGNORE_ATTR = "data-ripppl-overlay";
|
|
18
20
|
export type RippleHandle = {
|
|
19
21
|
destroy: () => void;
|
|
20
22
|
update: (opts: Partial<RippleTuning>) => void;
|
|
23
|
+
invalidateCapture: () => void;
|
|
24
|
+
prefetchCapture: () => void;
|
|
21
25
|
trigger: (opts?: {
|
|
22
26
|
x?: number;
|
|
23
27
|
y?: number;
|
|
28
|
+
fromElement?: HTMLElement;
|
|
24
29
|
}) => void;
|
|
25
30
|
};
|
|
26
31
|
type TriggerInput = string | HTMLElement | NodeListOf<HTMLElement> | HTMLElement[];
|
package/dist/ripppl.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ripppl.d.ts","sourceRoot":"","sources":["../src/ripppl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ripppl.d.ts","sourceRoot":"","sources":["../src/ripppl.ts"],"names":[],"mappings":"AAyFA,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAA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