kuinetic 0.1.4 → 0.2.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/README.md +93 -10
- package/dist/esm/advanced/index.mjs +4727 -0
- package/dist/esm/chunk-AEQGC2KM.mjs +189 -0
- package/dist/esm/chunk-MQSNMYRP.mjs +9332 -0
- package/dist/esm/chunk-RVTYN6NZ.mjs +3446 -0
- package/dist/esm/chunk-U43BX5O2.mjs +2984 -0
- package/dist/esm/core/index.mjs +16 -9
- package/dist/esm/effects/index.mjs +19 -4
- package/dist/esm/index.mjs +17 -10
- package/dist/kuinetic.advanced.js +5070 -0
- package/dist/kuinetic.advanced.min.js +749 -0
- package/dist/kuinetic.all.js +15147 -6039
- package/dist/kuinetic.all.min.js +2 -0
- package/dist/kuinetic.css +2801 -318
- package/dist/kuinetic.js +15147 -6038
- package/dist/kuinetic.min.css +1 -0
- package/dist/kuinetic.min.js +7 -0
- package/dist/types/3d/angles.d.ts +30 -0
- package/dist/types/3d/flattening.d.ts +49 -0
- package/dist/types/3d/index.d.ts +36 -0
- package/dist/types/3d/model-3d.d.ts +115 -0
- package/dist/types/3d/register.d.ts +26 -0
- package/dist/types/3d/webgl.d.ts +24 -0
- package/dist/types/advanced/audio.d.ts +322 -0
- package/dist/types/advanced/base.d.ts +233 -0
- package/dist/types/advanced/camera-3d.d.ts +236 -0
- package/dist/types/advanced/fluid-cursor.d.ts +149 -0
- package/dist/types/advanced/gl-utils.d.ts +52 -0
- package/dist/types/advanced/glsl.d.ts +60 -0
- package/dist/types/advanced/index.d.ts +23 -0
- package/dist/types/advanced/particles.d.ts +108 -0
- package/dist/types/advanced/scenes.d.ts +207 -0
- package/dist/types/advanced/shaders.d.ts +972 -0
- package/dist/types/browser/boot.d.ts +72 -0
- package/dist/types/core/activation.d.ts +227 -2
- package/dist/types/core/animator.d.ts +446 -11
- package/dist/types/core/attrs.d.ts +9 -0
- package/dist/types/core/breakpoints.d.ts +260 -0
- package/dist/types/core/bundles.d.ts +71 -0
- package/dist/types/core/callback.d.ts +64 -0
- package/dist/types/core/capabilities.d.ts +47 -0
- package/dist/types/core/channels.d.ts +120 -2
- package/dist/types/core/cloak-selectors.d.ts +47 -0
- package/dist/types/core/compile.d.ts +207 -2
- package/dist/types/core/control.d.ts +218 -0
- package/dist/types/core/declarations.d.ts +128 -0
- package/dist/types/core/derived/aggregate.d.ts +43 -0
- package/dist/types/core/derived/book.d.ts +30 -0
- package/dist/types/core/derived/diagnostics.d.ts +51 -0
- package/dist/types/core/derived/group-gate.d.ts +62 -0
- package/dist/types/core/derived/install.d.ts +110 -0
- package/dist/types/core/derived/late-matches.d.ts +19 -0
- package/dist/types/core/derived/types.d.ts +108 -0
- package/dist/types/core/easing.d.ts +57 -0
- package/dist/types/core/element-config.d.ts +47 -6
- package/dist/types/core/element-size.d.ts +23 -0
- package/dist/types/core/event-sources.d.ts +39 -0
- package/dist/types/core/flip.d.ts +34 -1
- package/dist/types/core/gesture.d.ts +12 -0
- package/dist/types/core/host-facts.d.ts +155 -0
- package/dist/types/core/index.d.ts +7 -3
- package/dist/types/core/owned-styles.d.ts +129 -2
- package/dist/types/core/params.d.ts +48 -0
- package/dist/types/core/parse.d.ts +28 -1
- package/dist/types/core/register-into.d.ts +29 -0
- package/dist/types/core/registry.d.ts +10 -3
- package/dist/types/core/repeat.d.ts +91 -0
- package/dist/types/core/sequence.d.ts +126 -0
- package/dist/types/core/stagger-config.d.ts +199 -0
- package/dist/types/core/stagger-keys.d.ts +63 -0
- package/dist/types/core/stagger.d.ts +187 -6
- package/dist/types/core/style-plan.d.ts +21 -16
- package/dist/types/core/target.d.ts +128 -0
- package/dist/types/core/threshold-reachability.d.ts +45 -0
- package/dist/types/core/time-scale.d.ts +9 -0
- package/dist/types/core/toggle-actions.d.ts +141 -0
- package/dist/types/core/travel.d.ts +59 -0
- package/dist/types/core/types.d.ts +699 -13
- package/dist/types/core/unquoted-selectors.d.ts +53 -0
- package/dist/types/effects/carousel/drag.d.ts +80 -0
- package/dist/types/effects/carousel/index.d.ts +149 -0
- package/dist/types/effects/catalog/discrete.d.ts +13 -0
- package/dist/types/effects/catalog/interaction-proximity.d.ts +24 -0
- package/dist/types/effects/catalog/interaction-reveal.d.ts +248 -0
- package/dist/types/effects/catalog/interaction-shared.d.ts +42 -0
- package/dist/types/effects/catalog/interaction-states.d.ts +68 -0
- package/dist/types/effects/catalog/materials.d.ts +67 -0
- package/dist/types/effects/catalog/media-shared.d.ts +3 -2
- package/dist/types/effects/catalog/numbers-shared.d.ts +8 -5
- package/dist/types/effects/catalog/shared.d.ts +1 -1
- package/dist/types/effects/catalog/text-shared.d.ts +86 -10
- package/dist/types/effects/catalog/transforms.d.ts +13 -0
- package/dist/types/effects/catalog/view-transitions.d.ts +13 -0
- package/dist/types/effects/forms/primitives.d.ts +15 -4
- package/dist/types/effects/gestures/index.d.ts +53 -0
- package/dist/types/effects/index.d.ts +5 -0
- package/dist/types/effects/layout/presets.d.ts +35 -0
- package/dist/types/effects/motion-path/index.d.ts +35 -0
- package/dist/types/effects/scroll-mechanics/params.d.ts +23 -0
- package/dist/types/effects/scroll-mechanics/presets.d.ts +51 -0
- package/dist/types/effects/scroll-mechanics/section-index.d.ts +47 -0
- package/dist/types/effects/shared.d.ts +124 -4
- package/dist/types/effects/step-index.d.ts +121 -0
- package/dist/types/effects/step-marking.d.ts +41 -33
- package/dist/types/effects/svg/icon-parts.d.ts +23 -0
- package/dist/types/effects/three-d/flip-parts.d.ts +46 -0
- package/dist/types/effects/tween/index.d.ts +57 -0
- package/dist/types/effects/tween/properties.d.ts +107 -0
- package/dist/types/effects/tween/waypoints.d.ts +106 -0
- package/dist/types/showcase/compare.d.ts +4 -0
- package/dist/types/showcase/device-frame.d.ts +3 -0
- package/dist/types/showcase/hotspots.d.ts +3 -0
- package/dist/types/showcase/index.d.ts +30 -0
- package/dist/types/showcase/lightbox.d.ts +3 -0
- package/dist/types/showcase/media-source.d.ts +13 -0
- package/dist/types/showcase/modal-shell.d.ts +22 -0
- package/dist/types/showcase/scroll-story.d.ts +4 -0
- package/dist/types/showcase/shared.d.ts +47 -0
- package/dist/types/showcase/slideshow.d.ts +3 -0
- package/dist/types/showcase/slow-mo.d.ts +5 -0
- package/package.json +14 -7
- package/dist/esm/chunk-7WMNPIOZ.mjs +0 -4883
- package/dist/esm/chunk-JT4PZL3A.mjs +0 -773
- package/dist/esm/chunk-TJDDIQRG.mjs +0 -1290
package/README.md
CHANGED
|
@@ -10,8 +10,13 @@ wherever CSS can do it. Standalone, MIT, npm + CDN, framework-agnostic. No produ
|
|
|
10
10
|
<h1 data-kui="fade-up">Hello.</h1>
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
gesture-driven motion.
|
|
13
|
+
302 named effects across scroll reveals, hover/interaction, text, numbers, layout, SVG, 3D, and
|
|
14
|
+
gesture-driven motion. 3,800+ unit tests. The jsdom suite holds `src/` at 100%
|
|
15
|
+
line/branch/function/statement coverage with two carve-outs: the WebGL tier in `src/advanced/`
|
|
16
|
+
(`shaders.ts`, `gl-utils.ts`, `fluid-cursor.ts`, `particles.ts`), whose GPU paths cannot execute
|
|
17
|
+
without a real context and report below 100%, and `src/effects/gestures/primitives.ts`, which
|
|
18
|
+
`vitest.config.ts` excludes from the metric outright. Both are exercised by the real-browser tier
|
|
19
|
+
under `test/browser/` instead.
|
|
15
20
|
|
|
16
21
|
## Install
|
|
17
22
|
|
|
@@ -23,12 +28,23 @@ load) — download `kuinetic.js` + `kuinetic.css`, or use them straight from the
|
|
|
23
28
|
```html
|
|
24
29
|
<link rel="stylesheet" href="./kuinetic.css">
|
|
25
30
|
<script src="./kuinetic.js"></script>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
That is the whole integration — no JavaScript of your own. The script starts itself once the
|
|
34
|
+
document is ready, with `observe: true`, so elements added later by your app, a CMS or a
|
|
35
|
+
client-side router are picked up automatically.
|
|
36
|
+
|
|
37
|
+
To drive it by hand instead, put `data-kui-manual` on the tag and the script does nothing until you
|
|
38
|
+
say so:
|
|
39
|
+
|
|
40
|
+
```html
|
|
41
|
+
<script src="./kuinetic.js" data-kui-manual></script>
|
|
26
42
|
<script>
|
|
27
43
|
kuinetic.kuinetic({ observe: true }).start()
|
|
28
44
|
</script>
|
|
29
45
|
```
|
|
30
46
|
|
|
31
|
-
**One tag, self-hosted** — CSS embedded
|
|
47
|
+
**One tag, self-hosted** — same auto-start, CSS embedded so there is no `<link>` either:
|
|
32
48
|
|
|
33
49
|
```html
|
|
34
50
|
<script src="./kuinetic.all.js"></script>
|
|
@@ -38,7 +54,7 @@ load) — download `kuinetic.js` + `kuinetic.css`, or use them straight from the
|
|
|
38
54
|
|
|
39
55
|
```html
|
|
40
56
|
<!-- one-tag convenience -->
|
|
41
|
-
<script src="https://kuinetic.pages.dev/kuinetic.all.js"></script>
|
|
57
|
+
<script src="https://kuinetic.pages.dev/kuinetic.all.min.js"></script>
|
|
42
58
|
```
|
|
43
59
|
|
|
44
60
|
Or via npm, with a bundler:
|
|
@@ -54,6 +70,37 @@ import 'kuinetic/css'
|
|
|
54
70
|
kuinetic({ observe: true }).start()
|
|
55
71
|
```
|
|
56
72
|
|
|
73
|
+
### Experimental: the advanced tier
|
|
74
|
+
|
|
75
|
+
A separate, opt-in set of WebGL, CSS-3D and Web-Audio primitives — shader surfaces, a depth camera,
|
|
76
|
+
particle dissolve, a fluid cursor trail, and an audio-reactive driver. It is a **tier**: a second
|
|
77
|
+
file you add beside core, never a different build of core.
|
|
78
|
+
|
|
79
|
+
```html
|
|
80
|
+
<script src="./kuinetic.js"></script>
|
|
81
|
+
<script src="./kuinetic.advanced.js"></script>
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
In either order, with nothing else. Core is not shipped twice — the tier externalises it — and the
|
|
85
|
+
two find each other and share one animator. A later tier (`kuinetic.3d.js`, when it exists) is
|
|
86
|
+
another tag on the same terms, never a combined bundle.
|
|
87
|
+
|
|
88
|
+
Or via npm, where the subpath resolves to the same package instance:
|
|
89
|
+
|
|
90
|
+
```js
|
|
91
|
+
import { kuinetic } from 'kuinetic'
|
|
92
|
+
import { registerAdvanced } from 'kuinetic/advanced'
|
|
93
|
+
|
|
94
|
+
const k = kuinetic()
|
|
95
|
+
registerAdvanced(k) // or one module at a time: registerShaders, registerCamera, …
|
|
96
|
+
k.start()
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
It is **unstable and not covered by the guarantees the rest of this README makes** — the API can
|
|
100
|
+
change without a major version, and nothing here is CSS-first or zero-dependency. Nothing is imported
|
|
101
|
+
unless you write that import: the default entry is byte-for-byte the same whether or not this
|
|
102
|
+
subpath exists. See `docs/advanced-modules.md` for what each module does and what it costs.
|
|
103
|
+
|
|
57
104
|
### CDN reference
|
|
58
105
|
|
|
59
106
|
Every file is mirrored on jsDelivr and unpkg — both update automatically from every npm release,
|
|
@@ -63,15 +110,29 @@ no separate action needed — and additionally self-hosted on Cloudflare at **`k
|
|
|
63
110
|
|---|---|---|---|
|
|
64
111
|
| `kuinetic.js` | [`/npm/kuinetic`](https://cdn.jsdelivr.net/npm/kuinetic) † | [`/kuinetic`](https://unpkg.com/kuinetic) † | [`/kuinetic.js`](https://kuinetic.pages.dev/kuinetic.js) |
|
|
65
112
|
| `kuinetic.css` | [`/npm/kuinetic/dist/kuinetic.css`](https://cdn.jsdelivr.net/npm/kuinetic/dist/kuinetic.css) | [`/kuinetic/dist/kuinetic.css`](https://unpkg.com/kuinetic/dist/kuinetic.css) | [`/kuinetic.css`](https://kuinetic.pages.dev/kuinetic.css) |
|
|
66
|
-
| `kuinetic.all.js` | [`/npm/kuinetic/dist/kuinetic.all.js`](https://cdn.jsdelivr.net/npm/kuinetic/dist/kuinetic.all.js) | [`/kuinetic/dist/kuinetic.all.js`](https://unpkg.com/kuinetic/dist/kuinetic.all.js) | [`/kuinetic.all.js`](https://kuinetic.pages.dev/kuinetic.all.js) |
|
|
113
|
+
| `kuinetic.all.min.js` | [`/npm/kuinetic/dist/kuinetic.all.min.js`](https://cdn.jsdelivr.net/npm/kuinetic/dist/kuinetic.all.min.js) | [`/kuinetic/dist/kuinetic.all.min.js`](https://unpkg.com/kuinetic/dist/kuinetic.all.min.js) | [`/kuinetic.all.min.js`](https://kuinetic.pages.dev/kuinetic.all.min.js) |
|
|
114
|
+
| `kuinetic.advanced.min.js` | [`/npm/kuinetic/dist/kuinetic.advanced.min.js`](https://cdn.jsdelivr.net/npm/kuinetic/dist/kuinetic.advanced.min.js) | [`/kuinetic/dist/kuinetic.advanced.min.js`](https://unpkg.com/kuinetic/dist/kuinetic.advanced.min.js) | — |
|
|
67
115
|
|
|
68
116
|
† shorthand — resolves via the `"jsdelivr"`/`"unpkg"` fields in `package.json`; only `kuinetic.js`
|
|
69
117
|
gets one, since a package can only designate a single default file that way.
|
|
70
118
|
|
|
71
|
-
`kuinetic.js` is the split bundle —
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
119
|
+
`kuinetic.js` is the split bundle — pair it with `kuinetic.css`, which keeps working even if the JS
|
|
120
|
+
is slow, blocked, or fails to load. `kuinetic.all.min.js` is the one-tag drop-in, the same thing with
|
|
121
|
+
the CSS embedded, trading that CSS-independence guarantee for one less step. (`kuinetic.all.js` is
|
|
122
|
+
its readable, unminified twin, about twice the transfer size; use it only for debugging.)
|
|
123
|
+
`kuinetic.advanced.min.js` is a tier: it needs core on the page, in either order, and never carries
|
|
124
|
+
a copy of it.
|
|
125
|
+
|
|
126
|
+
Every one of those browser bundles starts itself once the document is ready. `data-kui-manual` on a
|
|
127
|
+
`<script>` tag turns that off for that file. Importing from npm does **not** start anything — a
|
|
128
|
+
module import stays side-effect-free, which is the guarantee the bundler path is built on.
|
|
129
|
+
|
|
130
|
+
> **Changed in 0.2.** These bundles used to do nothing until you called
|
|
131
|
+
> `kuinetic.kuinetic({ observe: true }).start()` yourself, and `kuinetic.all.js` started itself the
|
|
132
|
+
> instant it parsed rather than at `DOMContentLoaded`. If you already write that call, it keeps
|
|
133
|
+
> working and your animator is still the one the page uses — you will see one console line saying
|
|
134
|
+
> the call is now redundant. Add `data-kui-manual` to the tag to silence it and go back to driving
|
|
135
|
+
> everything by hand.
|
|
75
136
|
|
|
76
137
|
## Your first animation
|
|
77
138
|
|
|
@@ -86,6 +147,16 @@ comma-separating them — no wrapper element, no extra markup:
|
|
|
86
147
|
<h1 data-kui="slide-up 800ms, blur-in 400ms">
|
|
87
148
|
```
|
|
88
149
|
|
|
150
|
+
A composition worth repeating gets a name, with no build step. Define it once in a `<template>` —
|
|
151
|
+
which never renders, so it can sit anywhere on the page, including below the elements that use it:
|
|
152
|
+
|
|
153
|
+
```html
|
|
154
|
+
<template data-kui-define="card-in" data-kui="fade-up 700ms, blur-in 400ms at:-200ms"></template>
|
|
155
|
+
|
|
156
|
+
<article data-kui="card-in"></article>
|
|
157
|
+
<article data-kui="card-in 300ms">…the same bundle, faster</article>
|
|
158
|
+
```
|
|
159
|
+
|
|
89
160
|
Not every effect is a scroll reveal — switch `on:` to drive it from hover, click, focus, or call it
|
|
90
161
|
manually:
|
|
91
162
|
|
|
@@ -93,10 +164,22 @@ manually:
|
|
|
93
164
|
<button data-kui="shine-sweep">Hover me</button>
|
|
94
165
|
```
|
|
95
166
|
|
|
167
|
+
Every animated element dispatches `kui:start` / `kui:finish` / `kui:reverse-finish` / `kui:cancel`
|
|
168
|
+
as ordinary bubbling DOM events, so `addEventListener('kui:finish', fn)` is all you need to chain
|
|
169
|
+
work off an animation — and it is what any project with a build step should use. On a no-build page,
|
|
170
|
+
`func:` names a global function to run at that same moment instead:
|
|
171
|
+
|
|
172
|
+
```html
|
|
173
|
+
<div data-kui="fade-up func:onReveal">…</div>
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
`func:` is a lookup by name on `window`, so never build its value from a CMS field or any other
|
|
177
|
+
untrusted input — see Getting Started for the full note.
|
|
178
|
+
|
|
96
179
|
## Docs
|
|
97
180
|
|
|
98
181
|
- **Getting Started** — install, first animation, timing, composition, common mistakes.
|
|
99
|
-
- **Catalog** — all
|
|
182
|
+
- **Catalog** — all 302 named effects, grouped by category, with renderer and channel metadata.
|
|
100
183
|
- **Architecture** — the attribute grammar, the composition model, and why the library is built
|
|
101
184
|
the way it is (`docs/design.md` in this repo).
|
|
102
185
|
|