use-scroll-animate 8.3.0 → 8.5.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 +33 -0
- package/dist/components/fx-cyber.cjs +140 -0
- package/dist/components/fx-cyber.cjs.map +1 -0
- package/dist/components/fx-cyber.d.cts +66 -0
- package/dist/components/fx-cyber.d.ts +66 -0
- package/dist/components/fx-cyber.js +136 -0
- package/dist/components/fx-cyber.js.map +1 -0
- package/dist/components/fx-paper.cjs +108 -0
- package/dist/components/fx-paper.cjs.map +1 -0
- package/dist/components/fx-paper.d.cts +68 -0
- package/dist/components/fx-paper.d.ts +68 -0
- package/dist/components/fx-paper.js +103 -0
- package/dist/components/fx-paper.js.map +1 -0
- package/dist/components/fx2.cjs +13 -0
- package/dist/components/fx2.cjs.map +1 -1
- package/dist/components/fx2.d.cts +47 -1
- package/dist/components/fx2.d.ts +47 -1
- package/dist/components/fx2.js +9 -1
- package/dist/components/fx2.js.map +1 -1
- package/dist/components/widgets.cjs +478 -162
- package/dist/components/widgets.cjs.map +1 -1
- package/dist/components/widgets.d.cts +71 -2
- package/dist/components/widgets.d.ts +71 -2
- package/dist/components/widgets.js +474 -163
- package/dist/components/widgets.js.map +1 -1
- package/dist/widgets.umd.js +1 -1
- package/dist/widgets.umd.js.map +1 -1
- package/docs/ROADMAP.md +2 -2
- package/docs/components.md +44 -0
- package/package.json +41 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,39 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [8.5.0] - 2026-10-09
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- **2 new components (8.5)** in `motionary/components/widgets` (also in `dist/widgets.umd.js`):
|
|
14
|
+
- `<usa-sticky-wall>` — wall of sticky notes: each child becomes a pinned paper note (`data-color` yellow · pink · blue · green, or cycling) with a slight tilt (`seed`); notes drop onto the wall one by one on first view; click / Enter lifts a note to the front (`pick(index)`, `usa:pick` { index }); `notes`, `label`.
|
|
15
|
+
- `<usa-sketch-chart>` — hand-drawn chart: wobbly pencil axes, hatched bars (`type="bar"`) or a sketchy line with dots (`type="line"`), sketched in stroke by stroke on first view; `values`, `labels`, `color`, `label`; `values` / `setValues()`; `usa:drawn`.
|
|
16
|
+
- **Paper & hand-drawn pack — `motionary/fx/paper`** (= `motionary/components/fx-paper`, `registerPaperPack()`, also in `registerEffectPacks()`): `paper-unfold` (enter), `pencil-sketch` (enter), `watercolor` (enter), `crumple` (attention). `roughLine()`, `paperRandom()`.
|
|
17
|
+
- Showcase: 4 new gallery cards with copyable code, live demos and live Store thumbnails.
|
|
18
|
+
|
|
19
|
+
### Accessibility
|
|
20
|
+
- Sticky wall is a `list` of focusable `listitem`s (Enter / Space picks a note). Sketch chart is an `img` whose label lists every label and value; the drawing is `aria-hidden`. Reduced motion: notes and charts are shown at once, `paper-unfold` / `watercolor` fade in, `pencil-sketch` shows the drawing, `crumple` does nothing.
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
- the 5.8 theme pack already registers a `paper-fold` effect, so the 8.5 unfold effect is named `paper-unfold` (registering it as `paper-fold` would have overridden the 5.8 theme effect).
|
|
24
|
+
- the sketch chart only sketched itself once, on first view — it now re-sketches on click / `redraw()` (gallery and Store demos replay it).
|
|
25
|
+
- the sticky-wall and sketch-chart gallery / Store demos only animated once on first view — demos now have "Pick a note" / "New data" buttons (wired to `pick()` / `setValues()` + `redraw()`).
|
|
26
|
+
|
|
27
|
+
## [8.4.0] - 2026-10-09
|
|
28
|
+
|
|
29
|
+
### Added
|
|
30
|
+
- **2 new components (8.4)** in `motionary/components/widgets` (also in `dist/widgets.umd.js`):
|
|
31
|
+
- `<usa-hud-panel>` — sci-fi HUD panel: angled corners, a glowing frame that draws itself in on first view, header with blinking status light (`title`, `status`, `color`), `<p data-value="72">` rows become animated bar readouts; `boot()` replays the intro, `usa:boot`.
|
|
32
|
+
- `<usa-radar>` — radar scope: a conic beam sweeps round (`speed` s per turn, `rings`) and targets (`targets="Name:bearing,distance; …"`) light up as the beam passes; `targets` / `setTargets()`, `usa:ping` { name }; `parseTargets()`.
|
|
33
|
+
- **Cyber pack — `motionary/fx/cyber`** (= `motionary/components/fx-cyber`, `registerCyberPack()`, also in `registerEffectPacks()`): `hud-frame` (enter), `scanline-sweep` (attention), `hologram` (loop), `data-decode` (enter). `decodeFrame()`.
|
|
34
|
+
- Showcase: 4 new gallery cards with copyable code, live demos and live Store thumbnails.
|
|
35
|
+
|
|
36
|
+
### Accessibility
|
|
37
|
+
- HUD panel is a labelled `region` (its `title`); the frame and bars are `aria-hidden`, the percentage is real text. Radar is an `img` whose label lists every target with its bearing; the sweep only runs on screen. `data-decode` keeps the real text as `aria-label` while it scrambles. Reduced motion: the panel shows at once, the radar is a still scope with all targets lit, `hud-frame` / `data-decode` just show, `scanline-sweep` does nothing, `hologram` is skipped.
|
|
38
|
+
|
|
39
|
+
### Fixed
|
|
40
|
+
- the 8.4 hologram gallery card id `fx-holo` collided with the 5.x "Holographic card" card (catalog ids must be unique — caught by the showcase catalog test) → renamed `fx-hologram`; a duplicate-id check now runs at staging.
|
|
41
|
+
|
|
42
|
+
|
|
10
43
|
## [8.3.0] - 2026-10-09
|
|
11
44
|
|
|
12
45
|
### Added
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var registry = require('../chunks/registry-BVklOepd.cjs');
|
|
4
|
+
require('../chunks/base-DoRUZBy-.cjs');
|
|
5
|
+
|
|
6
|
+
const GLYPHS = '01<>/\\[]{}#$%&*+=ABCDEFXYZ';
|
|
7
|
+
/** The `k`-th frame of decoding `text` over `n` frames: resolved prefix + random glyphs (8.4). */
|
|
8
|
+
function decodeFrame(text, k, n, rnd = Math.random) {
|
|
9
|
+
const done = Math.floor((Math.min(n, Math.max(0, k)) / n) * text.length);
|
|
10
|
+
let out = text.slice(0, done);
|
|
11
|
+
for (let i = done; i < text.length; i++)
|
|
12
|
+
out += /\s/.test(text[i]) ? text[i] : GLYPHS[Math.floor(rnd() * GLYPHS.length)];
|
|
13
|
+
return out;
|
|
14
|
+
}
|
|
15
|
+
const overlay = (el, ctx) => {
|
|
16
|
+
if (getComputedStyle(el).position === 'static') {
|
|
17
|
+
const prev = el.style.position;
|
|
18
|
+
el.style.position = 'relative';
|
|
19
|
+
ctx.onCleanup(() => (el.style.position = prev));
|
|
20
|
+
}
|
|
21
|
+
const o = document.createElement('span');
|
|
22
|
+
o.setAttribute('aria-hidden', 'true');
|
|
23
|
+
Object.assign(o.style, { position: 'absolute', inset: '0', pointerEvents: 'none', overflow: 'hidden', borderRadius: 'inherit' });
|
|
24
|
+
el.appendChild(o);
|
|
25
|
+
ctx.onCleanup(() => o.remove());
|
|
26
|
+
return o;
|
|
27
|
+
};
|
|
28
|
+
const bar = (o, color, h = '2px') => {
|
|
29
|
+
const b = document.createElement('span');
|
|
30
|
+
Object.assign(b.style, { position: 'absolute', left: '0', right: '0', top: '0', height: h, background: color, boxShadow: `0 0 10px 2px ${color}` });
|
|
31
|
+
o.appendChild(b);
|
|
32
|
+
return b;
|
|
33
|
+
};
|
|
34
|
+
const CYBER_FX = [
|
|
35
|
+
{
|
|
36
|
+
name: 'hud-frame',
|
|
37
|
+
kind: 'enter',
|
|
38
|
+
description: 'Corner brackets draw in around the element and a scan bar sweeps across it, like a HUD locking on (`color`).',
|
|
39
|
+
defaults: { color: '#22d3ee', duration: 900 },
|
|
40
|
+
run: (el, o, ctx) => {
|
|
41
|
+
if (ctx.reduced)
|
|
42
|
+
return;
|
|
43
|
+
const ov = overlay(el, ctx);
|
|
44
|
+
ov.style.overflow = 'visible';
|
|
45
|
+
const runs = [];
|
|
46
|
+
['0 0', '100% 0', '0 100%', '100% 100%'].forEach((pos, i) => {
|
|
47
|
+
const c = document.createElement('span');
|
|
48
|
+
const [x, y] = pos.split(' ');
|
|
49
|
+
Object.assign(c.style, { position: 'absolute', width: '14px', height: '14px', left: x === '0' ? '-4px' : 'calc(100% - 10px)', top: y === '0' ? '-4px' : 'calc(100% - 10px)', borderColor: o.color, borderStyle: 'solid', borderWidth: `${y === '0' ? 2 : 0}px ${x !== '0' ? 2 : 0}px ${y !== '0' ? 2 : 0}px ${x === '0' ? 2 : 0}px` });
|
|
50
|
+
ov.appendChild(c);
|
|
51
|
+
const dx = x === '0' ? -14 : 14;
|
|
52
|
+
const dy = y === '0' ? -14 : 14;
|
|
53
|
+
runs.push(ctx.animate(c, [{ transform: `translate(${dx}px,${dy}px)`, opacity: 0 }, { transform: 'none', opacity: 1, offset: 0.5 }, { transform: 'none', opacity: 1, offset: 0.85 }, { transform: 'none', opacity: 0 }], { duration: o.duration + 500, delay: i * 60, easing: 'ease-out', fill: 'backwards' })?.finished.catch(() => undefined));
|
|
54
|
+
});
|
|
55
|
+
const b = bar(ov, o.color);
|
|
56
|
+
runs.push(ctx.animate(b, [{ transform: 'translateY(0)', opacity: 0 }, { opacity: 1, offset: 0.1 }, { transform: `translateY(${el.clientHeight || 80}px)`, opacity: 0 }], { duration: o.duration, delay: 250, easing: 'ease-in-out', fill: 'backwards' })?.finished.catch(() => undefined));
|
|
57
|
+
runs.push(ctx.animate(el, [{ opacity: 0, filter: 'brightness(2) saturate(0)' }, { opacity: 1, filter: 'none' }], { duration: o.duration, easing: 'steps(6, end)', fill: 'backwards' })?.finished.catch(() => undefined));
|
|
58
|
+
return Promise.all(runs).then(() => ov.remove());
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: 'scanline-sweep',
|
|
63
|
+
kind: 'attention',
|
|
64
|
+
description: 'A bright horizontal scanline runs down the element (`color`, `passes`).',
|
|
65
|
+
defaults: { color: 'rgba(34,211,238,.9)', passes: 1, duration: 800 },
|
|
66
|
+
run: (el, o, ctx) => {
|
|
67
|
+
if (ctx.reduced)
|
|
68
|
+
return;
|
|
69
|
+
const ov = overlay(el, ctx);
|
|
70
|
+
const b = bar(ov, o.color, '3px');
|
|
71
|
+
const a = ctx.animate(b, [{ transform: 'translateY(-4px)' }, { transform: `translateY(${(el.clientHeight || 80) + 4}px)` }], { duration: o.duration, iterations: Math.max(1, Math.min(5, Number(o.passes) || 1)), easing: 'linear' });
|
|
72
|
+
const end = () => ov.remove();
|
|
73
|
+
return a ? a.finished.then(end, end) : (end(), undefined);
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: 'hologram',
|
|
78
|
+
kind: 'loop',
|
|
79
|
+
description: 'A flickering, translucent hologram look with drifting scan bands until the cleanup runs (`color`).',
|
|
80
|
+
defaults: { color: '#22d3ee', duration: 2400 },
|
|
81
|
+
run: (el, o, ctx) => {
|
|
82
|
+
const ov = overlay(el, ctx);
|
|
83
|
+
ov.style.background = `repeating-linear-gradient(0deg, transparent 0 3px, ${o.color}33 3px 4px)`;
|
|
84
|
+
ov.style.mixBlendMode = 'screen';
|
|
85
|
+
const prev = el.style.filter;
|
|
86
|
+
el.style.filter = `drop-shadow(0 0 6px ${o.color}) saturate(1.4)`;
|
|
87
|
+
const a = ctx.animate(el, [{ opacity: 0.85 }, { opacity: 0.6, offset: 0.08 }, { opacity: 0.9, offset: 0.12 }, { opacity: 0.8, offset: 0.5 }, { opacity: 0.55, offset: 0.52 }, { opacity: 0.85 }], { duration: o.duration, iterations: Infinity });
|
|
88
|
+
const b = ctx.animate(ov, [{ backgroundPosition: '0 0' }, { backgroundPosition: '0 40px' }], { duration: 1600, iterations: Infinity, easing: 'linear' });
|
|
89
|
+
return () => {
|
|
90
|
+
a?.cancel();
|
|
91
|
+
b?.cancel();
|
|
92
|
+
ov.remove();
|
|
93
|
+
el.style.filter = prev;
|
|
94
|
+
};
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
name: 'data-decode',
|
|
99
|
+
kind: 'enter',
|
|
100
|
+
description: 'The text resolves from random glyphs to the real characters, left to right (`speed` ms per frame).',
|
|
101
|
+
defaults: { speed: 40, frames: 16 },
|
|
102
|
+
run: (el, o, ctx) => {
|
|
103
|
+
if (ctx.reduced)
|
|
104
|
+
return;
|
|
105
|
+
const text = el.textContent || '';
|
|
106
|
+
if (!text.trim() || el.children.length)
|
|
107
|
+
return;
|
|
108
|
+
const n = Math.max(4, Math.min(60, Number(o.frames) || 16));
|
|
109
|
+
el.setAttribute('aria-label', text);
|
|
110
|
+
let k = 0;
|
|
111
|
+
let timer = 0;
|
|
112
|
+
const restore = () => {
|
|
113
|
+
clearTimeout(timer);
|
|
114
|
+
el.textContent = text;
|
|
115
|
+
el.removeAttribute('aria-label');
|
|
116
|
+
};
|
|
117
|
+
ctx.onCleanup(restore);
|
|
118
|
+
return new Promise((resolve) => {
|
|
119
|
+
const step = () => {
|
|
120
|
+
if (k > n) {
|
|
121
|
+
restore();
|
|
122
|
+
return resolve();
|
|
123
|
+
}
|
|
124
|
+
el.textContent = decodeFrame(text, k++, n);
|
|
125
|
+
timer = setTimeout(step, Math.max(10, Number(o.speed) || 40));
|
|
126
|
+
};
|
|
127
|
+
step();
|
|
128
|
+
});
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
];
|
|
132
|
+
/** Register hud-frame, scanline-sweep, hologram and data-decode (8.4). */
|
|
133
|
+
function registerCyberPack() {
|
|
134
|
+
registry.registerEffects(CYBER_FX);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
exports.CYBER_FX = CYBER_FX;
|
|
138
|
+
exports.decodeFrame = decodeFrame;
|
|
139
|
+
exports.registerCyberPack = registerCyberPack;
|
|
140
|
+
//# sourceMappingURL=fx-cyber.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fx-cyber.cjs","sources":["../../src/components/fx2/cyber.ts"],"sourcesContent":["/**\n * 8.4 — Cyber / sci-fi pack (`motionary/fx/cyber`, also `motionary/components/fx-cyber`):\n *\n * - `hud-frame` (enter) — corner brackets draw in around the element and a\n * scan bar sweeps across it, like a HUD locking on (`color`).\n * - `scanline-sweep` (attention) — a bright horizontal scanline runs down\n * the element (`color`, `passes`).\n * - `hologram` (loop) — a flickering, translucent cyan hologram look with\n * drifting scan bands; the cleanup restores the element (`color`).\n * - `data-decode` (enter) — the text resolves from random glyphs to the real\n * characters, left to right (`speed`).\n *\n * Reduced motion: hud-frame / data-decode just show, scanline-sweep does\n * nothing, hologram is skipped. Overlays are `aria-hidden` and removed.\n */\nimport type { EffectContext, EffectDefinition } from '../fx/registry';\nimport { registerEffects } from '../fx/registry';\n\nconst GLYPHS = '01<>/\\\\[]{}#$%&*+=ABCDEFXYZ';\n/** The `k`-th frame of decoding `text` over `n` frames: resolved prefix + random glyphs (8.4). */\nexport function decodeFrame(text: string, k: number, n: number, rnd: () => number = Math.random): string {\n const done = Math.floor((Math.min(n, Math.max(0, k)) / n) * text.length);\n let out = text.slice(0, done);\n for (let i = done; i < text.length; i++) out += /\\s/.test(text[i]) ? text[i] : GLYPHS[Math.floor(rnd() * GLYPHS.length)];\n return out;\n}\n\nconst overlay = (el: HTMLElement, ctx: EffectContext) => {\n if (getComputedStyle(el).position === 'static') {\n const prev = el.style.position;\n el.style.position = 'relative';\n ctx.onCleanup(() => (el.style.position = prev));\n }\n const o = document.createElement('span');\n o.setAttribute('aria-hidden', 'true');\n Object.assign(o.style, { position: 'absolute', inset: '0', pointerEvents: 'none', overflow: 'hidden', borderRadius: 'inherit' });\n el.appendChild(o);\n ctx.onCleanup(() => o.remove());\n return o;\n};\nconst bar = (o: HTMLElement, color: string, h = '2px') => {\n const b = document.createElement('span');\n Object.assign(b.style, { position: 'absolute', left: '0', right: '0', top: '0', height: h, background: color, boxShadow: `0 0 10px 2px ${color}` });\n o.appendChild(b);\n return b;\n};\n\nexport const CYBER_FX: EffectDefinition[] = [\n {\n name: 'hud-frame',\n kind: 'enter',\n description: 'Corner brackets draw in around the element and a scan bar sweeps across it, like a HUD locking on (`color`).',\n defaults: { color: '#22d3ee', duration: 900 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n if (ctx.reduced) return;\n const ov = overlay(el, ctx);\n ov.style.overflow = 'visible';\n const runs: (Promise<unknown> | undefined)[] = [];\n ['0 0', '100% 0', '0 100%', '100% 100%'].forEach((pos, i) => {\n const c = document.createElement('span');\n const [x, y] = pos.split(' ');\n Object.assign(c.style, { position: 'absolute', width: '14px', height: '14px', left: x === '0' ? '-4px' : 'calc(100% - 10px)', top: y === '0' ? '-4px' : 'calc(100% - 10px)', borderColor: o.color, borderStyle: 'solid', borderWidth: `${y === '0' ? 2 : 0}px ${x !== '0' ? 2 : 0}px ${y !== '0' ? 2 : 0}px ${x === '0' ? 2 : 0}px` });\n ov.appendChild(c);\n const dx = x === '0' ? -14 : 14;\n const dy = y === '0' ? -14 : 14;\n runs.push(ctx.animate(c, [{ transform: `translate(${dx}px,${dy}px)`, opacity: 0 }, { transform: 'none', opacity: 1, offset: 0.5 }, { transform: 'none', opacity: 1, offset: 0.85 }, { transform: 'none', opacity: 0 }], { duration: o.duration + 500, delay: i * 60, easing: 'ease-out', fill: 'backwards' })?.finished.catch(() => undefined));\n });\n const b = bar(ov, o.color);\n runs.push(ctx.animate(b, [{ transform: 'translateY(0)', opacity: 0 }, { opacity: 1, offset: 0.1 }, { transform: `translateY(${el.clientHeight || 80}px)`, opacity: 0 }], { duration: o.duration, delay: 250, easing: 'ease-in-out', fill: 'backwards' })?.finished.catch(() => undefined));\n runs.push(ctx.animate(el, [{ opacity: 0, filter: 'brightness(2) saturate(0)' }, { opacity: 1, filter: 'none' }], { duration: o.duration, easing: 'steps(6, end)', fill: 'backwards' })?.finished.catch(() => undefined));\n return Promise.all(runs).then(() => ov.remove());\n },\n },\n {\n name: 'scanline-sweep',\n kind: 'attention',\n description: 'A bright horizontal scanline runs down the element (`color`, `passes`).',\n defaults: { color: 'rgba(34,211,238,.9)', passes: 1, duration: 800 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n if (ctx.reduced) return;\n const ov = overlay(el, ctx);\n const b = bar(ov, o.color, '3px');\n const a = ctx.animate(b, [{ transform: 'translateY(-4px)' }, { transform: `translateY(${(el.clientHeight || 80) + 4}px)` }], { duration: o.duration, iterations: Math.max(1, Math.min(5, Number(o.passes) || 1)), easing: 'linear' });\n const end = () => ov.remove();\n return a ? a.finished.then(end, end) : (end(), undefined);\n },\n },\n {\n name: 'hologram',\n kind: 'loop',\n description: 'A flickering, translucent hologram look with drifting scan bands until the cleanup runs (`color`).',\n defaults: { color: '#22d3ee', duration: 2400 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n const ov = overlay(el, ctx);\n ov.style.background = `repeating-linear-gradient(0deg, transparent 0 3px, ${o.color}33 3px 4px)`;\n ov.style.mixBlendMode = 'screen';\n const prev = el.style.filter;\n el.style.filter = `drop-shadow(0 0 6px ${o.color}) saturate(1.4)`;\n const a = ctx.animate(el, [{ opacity: 0.85 }, { opacity: 0.6, offset: 0.08 }, { opacity: 0.9, offset: 0.12 }, { opacity: 0.8, offset: 0.5 }, { opacity: 0.55, offset: 0.52 }, { opacity: 0.85 }], { duration: o.duration, iterations: Infinity });\n const b = ctx.animate(ov, [{ backgroundPosition: '0 0' }, { backgroundPosition: '0 40px' }], { duration: 1600, iterations: Infinity, easing: 'linear' });\n return () => {\n a?.cancel();\n b?.cancel();\n ov.remove();\n el.style.filter = prev;\n };\n },\n },\n {\n name: 'data-decode',\n kind: 'enter',\n description: 'The text resolves from random glyphs to the real characters, left to right (`speed` ms per frame).',\n defaults: { speed: 40, frames: 16 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n if (ctx.reduced) return;\n const text = el.textContent || '';\n if (!text.trim() || el.children.length) return;\n const n = Math.max(4, Math.min(60, Number(o.frames) || 16));\n el.setAttribute('aria-label', text);\n let k = 0;\n let timer = 0 as unknown as ReturnType<typeof setTimeout>;\n const restore = () => {\n clearTimeout(timer);\n el.textContent = text;\n el.removeAttribute('aria-label');\n };\n ctx.onCleanup(restore);\n return new Promise<void>((resolve) => {\n const step = () => {\n if (k > n) {\n restore();\n return resolve();\n }\n el.textContent = decodeFrame(text, k++, n);\n timer = setTimeout(step, Math.max(10, Number(o.speed) || 40));\n };\n step();\n });\n },\n },\n];\n\n/** Register hud-frame, scanline-sweep, hologram and data-decode (8.4). */\nexport function registerCyberPack(): void {\n registerEffects(CYBER_FX);\n}\n"],"names":["registerEffects"],"mappings":";;;;;AAkBA,MAAM,MAAM,GAAG,6BAA6B;AAC5C;AACM,SAAU,WAAW,CAAC,IAAY,EAAE,CAAS,EAAE,CAAS,EAAE,GAAA,GAAoB,IAAI,CAAC,MAAM,EAAA;AAC7F,IAAA,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC;IACxE,IAAI,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC;AAC7B,IAAA,KAAK,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE;AAAE,QAAA,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;AACxH,IAAA,OAAO,GAAG;AACZ;AAEA,MAAM,OAAO,GAAG,CAAC,EAAe,EAAE,GAAkB,KAAI;IACtD,IAAI,gBAAgB,CAAC,EAAE,CAAC,CAAC,QAAQ,KAAK,QAAQ,EAAE;AAC9C,QAAA,MAAM,IAAI,GAAG,EAAE,CAAC,KAAK,CAAC,QAAQ;AAC9B,QAAA,EAAE,CAAC,KAAK,CAAC,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AAC,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;AAC3D,YAAA,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,IAAI,CAAC;YACnC,IAAI,CAAC,GAAG,CAAC;YACT,IAAI,KAAK,GAAG,CAA6C;YACzD,MAAM,OAAO,GAAG,MAAK;gBACnB,YAAY,CAAC,KAAK,CAAC;AACnB,gBAAA,EAAE,CAAC,WAAW,GAAG,IAAI;AACrB,gBAAA,EAAE,CAAC,eAAe,CAAC,YAAY,CAAC;AAClC,YAAA,CAAC;AACD,YAAA,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC;AACtB,YAAA,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,KAAI;gBACnC,MAAM,IAAI,GAAG,MAAK;AAChB,oBAAA,IAAI,CAAC,GAAG,CAAC,EAAE;AACT,wBAAA,OAAO,EAAE;wBACT,OAAO,OAAO,EAAE;oBAClB;AACA,oBAAA,EAAE,CAAC,WAAW,GAAG,WAAW,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;oBAC1C,KAAK,GAAG,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;AAC/D,gBAAA,CAAC;AACD,gBAAA,IAAI,EAAE;AACR,YAAA,CAAC,CAAC;QACJ,CAAC;AACF,KAAA;;AAGH;SACgB,iBAAiB,GAAA;IAC/BA,wBAAe,CAAC,QAAQ,CAAC;AAC3B;;;;;;"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
type MotionSensitivity = 'full' | 'gentle' | 'minimal' | 'static';
|
|
2
|
+
type Cleanup = () => void;
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 5.0 — unified plugin-style effect registration. Every effect (built-in or
|
|
6
|
+
* yours) is a plain object registered once and played the same way:
|
|
7
|
+
* `playEffect(el, name)`, `bindEffect(el, name, { trigger })` or
|
|
8
|
+
* `<usa-fx effect="name" trigger="click">`. Effects get a context that
|
|
9
|
+
* already applies reduced motion, motion sensitivity, intensity and the
|
|
10
|
+
* animation budget.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
declare const EFFECT_KINDS: readonly ["enter", "exit", "attention", "click", "hover", "card", "loop", "page", "background", "text", "cursor", "scroll"];
|
|
14
|
+
type EffectKind = (typeof EFFECT_KINDS)[number];
|
|
15
|
+
interface EffectContext {
|
|
16
|
+
/** Reduced motion applies (OS setting, `minimal` / `static` sensitivity). */
|
|
17
|
+
readonly reduced: boolean;
|
|
18
|
+
readonly sensitivity: MotionSensitivity;
|
|
19
|
+
/** The triggering event (pointer position for click effects), if any. */
|
|
20
|
+
readonly event?: Event;
|
|
21
|
+
/** `el.animate()` with the library's motion rules (may return `null`). */
|
|
22
|
+
animate(el: Element, keyframes: Keyframe[], options: KeyframeAnimationOptions): Animation | null;
|
|
23
|
+
/** Register teardown for long-running effects (loops, listeners). */
|
|
24
|
+
onCleanup(fn: Cleanup): void;
|
|
25
|
+
}
|
|
26
|
+
interface EffectDefinition<O extends Record<string, unknown> = Record<string, any>> {
|
|
27
|
+
/** Unique, kebab-case. */
|
|
28
|
+
name: string;
|
|
29
|
+
kind: EffectKind;
|
|
30
|
+
/** One line for docs and the gallery. */
|
|
31
|
+
description?: string;
|
|
32
|
+
/** Option defaults (merged under the caller's options). */
|
|
33
|
+
defaults?: Partial<O>;
|
|
34
|
+
/**
|
|
35
|
+
* Under reduced motion: `'skip'` (do nothing — default for loop, background
|
|
36
|
+
* and cursor effects) or `'run'` (run with `ctx.reduced === true`, the
|
|
37
|
+
* effect degrades itself — default for everything else).
|
|
38
|
+
*/
|
|
39
|
+
reduced?: 'skip' | 'run';
|
|
40
|
+
/** Play the effect. Return an Animation / Promise to be awaited, or a cleanup. */
|
|
41
|
+
run(el: HTMLElement, options: O, ctx: EffectContext): void | Cleanup | Animation | null | Promise<unknown>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* 8.4 — Cyber / sci-fi pack (`motionary/fx/cyber`, also `motionary/components/fx-cyber`):
|
|
46
|
+
*
|
|
47
|
+
* - `hud-frame` (enter) — corner brackets draw in around the element and a
|
|
48
|
+
* scan bar sweeps across it, like a HUD locking on (`color`).
|
|
49
|
+
* - `scanline-sweep` (attention) — a bright horizontal scanline runs down
|
|
50
|
+
* the element (`color`, `passes`).
|
|
51
|
+
* - `hologram` (loop) — a flickering, translucent cyan hologram look with
|
|
52
|
+
* drifting scan bands; the cleanup restores the element (`color`).
|
|
53
|
+
* - `data-decode` (enter) — the text resolves from random glyphs to the real
|
|
54
|
+
* characters, left to right (`speed`).
|
|
55
|
+
*
|
|
56
|
+
* Reduced motion: hud-frame / data-decode just show, scanline-sweep does
|
|
57
|
+
* nothing, hologram is skipped. Overlays are `aria-hidden` and removed.
|
|
58
|
+
*/
|
|
59
|
+
|
|
60
|
+
/** The `k`-th frame of decoding `text` over `n` frames: resolved prefix + random glyphs (8.4). */
|
|
61
|
+
declare function decodeFrame(text: string, k: number, n: number, rnd?: () => number): string;
|
|
62
|
+
declare const CYBER_FX: EffectDefinition[];
|
|
63
|
+
/** Register hud-frame, scanline-sweep, hologram and data-decode (8.4). */
|
|
64
|
+
declare function registerCyberPack(): void;
|
|
65
|
+
|
|
66
|
+
export { CYBER_FX, decodeFrame, registerCyberPack };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
type MotionSensitivity = 'full' | 'gentle' | 'minimal' | 'static';
|
|
2
|
+
type Cleanup = () => void;
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 5.0 — unified plugin-style effect registration. Every effect (built-in or
|
|
6
|
+
* yours) is a plain object registered once and played the same way:
|
|
7
|
+
* `playEffect(el, name)`, `bindEffect(el, name, { trigger })` or
|
|
8
|
+
* `<usa-fx effect="name" trigger="click">`. Effects get a context that
|
|
9
|
+
* already applies reduced motion, motion sensitivity, intensity and the
|
|
10
|
+
* animation budget.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
declare const EFFECT_KINDS: readonly ["enter", "exit", "attention", "click", "hover", "card", "loop", "page", "background", "text", "cursor", "scroll"];
|
|
14
|
+
type EffectKind = (typeof EFFECT_KINDS)[number];
|
|
15
|
+
interface EffectContext {
|
|
16
|
+
/** Reduced motion applies (OS setting, `minimal` / `static` sensitivity). */
|
|
17
|
+
readonly reduced: boolean;
|
|
18
|
+
readonly sensitivity: MotionSensitivity;
|
|
19
|
+
/** The triggering event (pointer position for click effects), if any. */
|
|
20
|
+
readonly event?: Event;
|
|
21
|
+
/** `el.animate()` with the library's motion rules (may return `null`). */
|
|
22
|
+
animate(el: Element, keyframes: Keyframe[], options: KeyframeAnimationOptions): Animation | null;
|
|
23
|
+
/** Register teardown for long-running effects (loops, listeners). */
|
|
24
|
+
onCleanup(fn: Cleanup): void;
|
|
25
|
+
}
|
|
26
|
+
interface EffectDefinition<O extends Record<string, unknown> = Record<string, any>> {
|
|
27
|
+
/** Unique, kebab-case. */
|
|
28
|
+
name: string;
|
|
29
|
+
kind: EffectKind;
|
|
30
|
+
/** One line for docs and the gallery. */
|
|
31
|
+
description?: string;
|
|
32
|
+
/** Option defaults (merged under the caller's options). */
|
|
33
|
+
defaults?: Partial<O>;
|
|
34
|
+
/**
|
|
35
|
+
* Under reduced motion: `'skip'` (do nothing — default for loop, background
|
|
36
|
+
* and cursor effects) or `'run'` (run with `ctx.reduced === true`, the
|
|
37
|
+
* effect degrades itself — default for everything else).
|
|
38
|
+
*/
|
|
39
|
+
reduced?: 'skip' | 'run';
|
|
40
|
+
/** Play the effect. Return an Animation / Promise to be awaited, or a cleanup. */
|
|
41
|
+
run(el: HTMLElement, options: O, ctx: EffectContext): void | Cleanup | Animation | null | Promise<unknown>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* 8.4 — Cyber / sci-fi pack (`motionary/fx/cyber`, also `motionary/components/fx-cyber`):
|
|
46
|
+
*
|
|
47
|
+
* - `hud-frame` (enter) — corner brackets draw in around the element and a
|
|
48
|
+
* scan bar sweeps across it, like a HUD locking on (`color`).
|
|
49
|
+
* - `scanline-sweep` (attention) — a bright horizontal scanline runs down
|
|
50
|
+
* the element (`color`, `passes`).
|
|
51
|
+
* - `hologram` (loop) — a flickering, translucent cyan hologram look with
|
|
52
|
+
* drifting scan bands; the cleanup restores the element (`color`).
|
|
53
|
+
* - `data-decode` (enter) — the text resolves from random glyphs to the real
|
|
54
|
+
* characters, left to right (`speed`).
|
|
55
|
+
*
|
|
56
|
+
* Reduced motion: hud-frame / data-decode just show, scanline-sweep does
|
|
57
|
+
* nothing, hologram is skipped. Overlays are `aria-hidden` and removed.
|
|
58
|
+
*/
|
|
59
|
+
|
|
60
|
+
/** The `k`-th frame of decoding `text` over `n` frames: resolved prefix + random glyphs (8.4). */
|
|
61
|
+
declare function decodeFrame(text: string, k: number, n: number, rnd?: () => number): string;
|
|
62
|
+
declare const CYBER_FX: EffectDefinition[];
|
|
63
|
+
/** Register hud-frame, scanline-sweep, hologram and data-decode (8.4). */
|
|
64
|
+
declare function registerCyberPack(): void;
|
|
65
|
+
|
|
66
|
+
export { CYBER_FX, decodeFrame, registerCyberPack };
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { registerEffects } from '../chunks/registry-CnO7ZVPK.js';
|
|
2
|
+
import '../chunks/base-CLuqlLfG.js';
|
|
3
|
+
|
|
4
|
+
const GLYPHS = '01<>/\\[]{}#$%&*+=ABCDEFXYZ';
|
|
5
|
+
/** The `k`-th frame of decoding `text` over `n` frames: resolved prefix + random glyphs (8.4). */
|
|
6
|
+
function decodeFrame(text, k, n, rnd = Math.random) {
|
|
7
|
+
const done = Math.floor((Math.min(n, Math.max(0, k)) / n) * text.length);
|
|
8
|
+
let out = text.slice(0, done);
|
|
9
|
+
for (let i = done; i < text.length; i++)
|
|
10
|
+
out += /\s/.test(text[i]) ? text[i] : GLYPHS[Math.floor(rnd() * GLYPHS.length)];
|
|
11
|
+
return out;
|
|
12
|
+
}
|
|
13
|
+
const overlay = (el, ctx) => {
|
|
14
|
+
if (getComputedStyle(el).position === 'static') {
|
|
15
|
+
const prev = el.style.position;
|
|
16
|
+
el.style.position = 'relative';
|
|
17
|
+
ctx.onCleanup(() => (el.style.position = prev));
|
|
18
|
+
}
|
|
19
|
+
const o = document.createElement('span');
|
|
20
|
+
o.setAttribute('aria-hidden', 'true');
|
|
21
|
+
Object.assign(o.style, { position: 'absolute', inset: '0', pointerEvents: 'none', overflow: 'hidden', borderRadius: 'inherit' });
|
|
22
|
+
el.appendChild(o);
|
|
23
|
+
ctx.onCleanup(() => o.remove());
|
|
24
|
+
return o;
|
|
25
|
+
};
|
|
26
|
+
const bar = (o, color, h = '2px') => {
|
|
27
|
+
const b = document.createElement('span');
|
|
28
|
+
Object.assign(b.style, { position: 'absolute', left: '0', right: '0', top: '0', height: h, background: color, boxShadow: `0 0 10px 2px ${color}` });
|
|
29
|
+
o.appendChild(b);
|
|
30
|
+
return b;
|
|
31
|
+
};
|
|
32
|
+
const CYBER_FX = [
|
|
33
|
+
{
|
|
34
|
+
name: 'hud-frame',
|
|
35
|
+
kind: 'enter',
|
|
36
|
+
description: 'Corner brackets draw in around the element and a scan bar sweeps across it, like a HUD locking on (`color`).',
|
|
37
|
+
defaults: { color: '#22d3ee', duration: 900 },
|
|
38
|
+
run: (el, o, ctx) => {
|
|
39
|
+
if (ctx.reduced)
|
|
40
|
+
return;
|
|
41
|
+
const ov = overlay(el, ctx);
|
|
42
|
+
ov.style.overflow = 'visible';
|
|
43
|
+
const runs = [];
|
|
44
|
+
['0 0', '100% 0', '0 100%', '100% 100%'].forEach((pos, i) => {
|
|
45
|
+
const c = document.createElement('span');
|
|
46
|
+
const [x, y] = pos.split(' ');
|
|
47
|
+
Object.assign(c.style, { position: 'absolute', width: '14px', height: '14px', left: x === '0' ? '-4px' : 'calc(100% - 10px)', top: y === '0' ? '-4px' : 'calc(100% - 10px)', borderColor: o.color, borderStyle: 'solid', borderWidth: `${y === '0' ? 2 : 0}px ${x !== '0' ? 2 : 0}px ${y !== '0' ? 2 : 0}px ${x === '0' ? 2 : 0}px` });
|
|
48
|
+
ov.appendChild(c);
|
|
49
|
+
const dx = x === '0' ? -14 : 14;
|
|
50
|
+
const dy = y === '0' ? -14 : 14;
|
|
51
|
+
runs.push(ctx.animate(c, [{ transform: `translate(${dx}px,${dy}px)`, opacity: 0 }, { transform: 'none', opacity: 1, offset: 0.5 }, { transform: 'none', opacity: 1, offset: 0.85 }, { transform: 'none', opacity: 0 }], { duration: o.duration + 500, delay: i * 60, easing: 'ease-out', fill: 'backwards' })?.finished.catch(() => undefined));
|
|
52
|
+
});
|
|
53
|
+
const b = bar(ov, o.color);
|
|
54
|
+
runs.push(ctx.animate(b, [{ transform: 'translateY(0)', opacity: 0 }, { opacity: 1, offset: 0.1 }, { transform: `translateY(${el.clientHeight || 80}px)`, opacity: 0 }], { duration: o.duration, delay: 250, easing: 'ease-in-out', fill: 'backwards' })?.finished.catch(() => undefined));
|
|
55
|
+
runs.push(ctx.animate(el, [{ opacity: 0, filter: 'brightness(2) saturate(0)' }, { opacity: 1, filter: 'none' }], { duration: o.duration, easing: 'steps(6, end)', fill: 'backwards' })?.finished.catch(() => undefined));
|
|
56
|
+
return Promise.all(runs).then(() => ov.remove());
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'scanline-sweep',
|
|
61
|
+
kind: 'attention',
|
|
62
|
+
description: 'A bright horizontal scanline runs down the element (`color`, `passes`).',
|
|
63
|
+
defaults: { color: 'rgba(34,211,238,.9)', passes: 1, duration: 800 },
|
|
64
|
+
run: (el, o, ctx) => {
|
|
65
|
+
if (ctx.reduced)
|
|
66
|
+
return;
|
|
67
|
+
const ov = overlay(el, ctx);
|
|
68
|
+
const b = bar(ov, o.color, '3px');
|
|
69
|
+
const a = ctx.animate(b, [{ transform: 'translateY(-4px)' }, { transform: `translateY(${(el.clientHeight || 80) + 4}px)` }], { duration: o.duration, iterations: Math.max(1, Math.min(5, Number(o.passes) || 1)), easing: 'linear' });
|
|
70
|
+
const end = () => ov.remove();
|
|
71
|
+
return a ? a.finished.then(end, end) : (end(), undefined);
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: 'hologram',
|
|
76
|
+
kind: 'loop',
|
|
77
|
+
description: 'A flickering, translucent hologram look with drifting scan bands until the cleanup runs (`color`).',
|
|
78
|
+
defaults: { color: '#22d3ee', duration: 2400 },
|
|
79
|
+
run: (el, o, ctx) => {
|
|
80
|
+
const ov = overlay(el, ctx);
|
|
81
|
+
ov.style.background = `repeating-linear-gradient(0deg, transparent 0 3px, ${o.color}33 3px 4px)`;
|
|
82
|
+
ov.style.mixBlendMode = 'screen';
|
|
83
|
+
const prev = el.style.filter;
|
|
84
|
+
el.style.filter = `drop-shadow(0 0 6px ${o.color}) saturate(1.4)`;
|
|
85
|
+
const a = ctx.animate(el, [{ opacity: 0.85 }, { opacity: 0.6, offset: 0.08 }, { opacity: 0.9, offset: 0.12 }, { opacity: 0.8, offset: 0.5 }, { opacity: 0.55, offset: 0.52 }, { opacity: 0.85 }], { duration: o.duration, iterations: Infinity });
|
|
86
|
+
const b = ctx.animate(ov, [{ backgroundPosition: '0 0' }, { backgroundPosition: '0 40px' }], { duration: 1600, iterations: Infinity, easing: 'linear' });
|
|
87
|
+
return () => {
|
|
88
|
+
a?.cancel();
|
|
89
|
+
b?.cancel();
|
|
90
|
+
ov.remove();
|
|
91
|
+
el.style.filter = prev;
|
|
92
|
+
};
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: 'data-decode',
|
|
97
|
+
kind: 'enter',
|
|
98
|
+
description: 'The text resolves from random glyphs to the real characters, left to right (`speed` ms per frame).',
|
|
99
|
+
defaults: { speed: 40, frames: 16 },
|
|
100
|
+
run: (el, o, ctx) => {
|
|
101
|
+
if (ctx.reduced)
|
|
102
|
+
return;
|
|
103
|
+
const text = el.textContent || '';
|
|
104
|
+
if (!text.trim() || el.children.length)
|
|
105
|
+
return;
|
|
106
|
+
const n = Math.max(4, Math.min(60, Number(o.frames) || 16));
|
|
107
|
+
el.setAttribute('aria-label', text);
|
|
108
|
+
let k = 0;
|
|
109
|
+
let timer = 0;
|
|
110
|
+
const restore = () => {
|
|
111
|
+
clearTimeout(timer);
|
|
112
|
+
el.textContent = text;
|
|
113
|
+
el.removeAttribute('aria-label');
|
|
114
|
+
};
|
|
115
|
+
ctx.onCleanup(restore);
|
|
116
|
+
return new Promise((resolve) => {
|
|
117
|
+
const step = () => {
|
|
118
|
+
if (k > n) {
|
|
119
|
+
restore();
|
|
120
|
+
return resolve();
|
|
121
|
+
}
|
|
122
|
+
el.textContent = decodeFrame(text, k++, n);
|
|
123
|
+
timer = setTimeout(step, Math.max(10, Number(o.speed) || 40));
|
|
124
|
+
};
|
|
125
|
+
step();
|
|
126
|
+
});
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
];
|
|
130
|
+
/** Register hud-frame, scanline-sweep, hologram and data-decode (8.4). */
|
|
131
|
+
function registerCyberPack() {
|
|
132
|
+
registerEffects(CYBER_FX);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export { CYBER_FX, decodeFrame, registerCyberPack };
|
|
136
|
+
//# sourceMappingURL=fx-cyber.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fx-cyber.js","sources":["../../src/components/fx2/cyber.ts"],"sourcesContent":["/**\n * 8.4 — Cyber / sci-fi pack (`motionary/fx/cyber`, also `motionary/components/fx-cyber`):\n *\n * - `hud-frame` (enter) — corner brackets draw in around the element and a\n * scan bar sweeps across it, like a HUD locking on (`color`).\n * - `scanline-sweep` (attention) — a bright horizontal scanline runs down\n * the element (`color`, `passes`).\n * - `hologram` (loop) — a flickering, translucent cyan hologram look with\n * drifting scan bands; the cleanup restores the element (`color`).\n * - `data-decode` (enter) — the text resolves from random glyphs to the real\n * characters, left to right (`speed`).\n *\n * Reduced motion: hud-frame / data-decode just show, scanline-sweep does\n * nothing, hologram is skipped. Overlays are `aria-hidden` and removed.\n */\nimport type { EffectContext, EffectDefinition } from '../fx/registry';\nimport { registerEffects } from '../fx/registry';\n\nconst GLYPHS = '01<>/\\\\[]{}#$%&*+=ABCDEFXYZ';\n/** The `k`-th frame of decoding `text` over `n` frames: resolved prefix + random glyphs (8.4). */\nexport function decodeFrame(text: string, k: number, n: number, rnd: () => number = Math.random): string {\n const done = Math.floor((Math.min(n, Math.max(0, k)) / n) * text.length);\n let out = text.slice(0, done);\n for (let i = done; i < text.length; i++) out += /\\s/.test(text[i]) ? text[i] : GLYPHS[Math.floor(rnd() * GLYPHS.length)];\n return out;\n}\n\nconst overlay = (el: HTMLElement, ctx: EffectContext) => {\n if (getComputedStyle(el).position === 'static') {\n const prev = el.style.position;\n el.style.position = 'relative';\n ctx.onCleanup(() => (el.style.position = prev));\n }\n const o = document.createElement('span');\n o.setAttribute('aria-hidden', 'true');\n Object.assign(o.style, { position: 'absolute', inset: '0', pointerEvents: 'none', overflow: 'hidden', borderRadius: 'inherit' });\n el.appendChild(o);\n ctx.onCleanup(() => o.remove());\n return o;\n};\nconst bar = (o: HTMLElement, color: string, h = '2px') => {\n const b = document.createElement('span');\n Object.assign(b.style, { position: 'absolute', left: '0', right: '0', top: '0', height: h, background: color, boxShadow: `0 0 10px 2px ${color}` });\n o.appendChild(b);\n return b;\n};\n\nexport const CYBER_FX: EffectDefinition[] = [\n {\n name: 'hud-frame',\n kind: 'enter',\n description: 'Corner brackets draw in around the element and a scan bar sweeps across it, like a HUD locking on (`color`).',\n defaults: { color: '#22d3ee', duration: 900 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n if (ctx.reduced) return;\n const ov = overlay(el, ctx);\n ov.style.overflow = 'visible';\n const runs: (Promise<unknown> | undefined)[] = [];\n ['0 0', '100% 0', '0 100%', '100% 100%'].forEach((pos, i) => {\n const c = document.createElement('span');\n const [x, y] = pos.split(' ');\n Object.assign(c.style, { position: 'absolute', width: '14px', height: '14px', left: x === '0' ? '-4px' : 'calc(100% - 10px)', top: y === '0' ? '-4px' : 'calc(100% - 10px)', borderColor: o.color, borderStyle: 'solid', borderWidth: `${y === '0' ? 2 : 0}px ${x !== '0' ? 2 : 0}px ${y !== '0' ? 2 : 0}px ${x === '0' ? 2 : 0}px` });\n ov.appendChild(c);\n const dx = x === '0' ? -14 : 14;\n const dy = y === '0' ? -14 : 14;\n runs.push(ctx.animate(c, [{ transform: `translate(${dx}px,${dy}px)`, opacity: 0 }, { transform: 'none', opacity: 1, offset: 0.5 }, { transform: 'none', opacity: 1, offset: 0.85 }, { transform: 'none', opacity: 0 }], { duration: o.duration + 500, delay: i * 60, easing: 'ease-out', fill: 'backwards' })?.finished.catch(() => undefined));\n });\n const b = bar(ov, o.color);\n runs.push(ctx.animate(b, [{ transform: 'translateY(0)', opacity: 0 }, { opacity: 1, offset: 0.1 }, { transform: `translateY(${el.clientHeight || 80}px)`, opacity: 0 }], { duration: o.duration, delay: 250, easing: 'ease-in-out', fill: 'backwards' })?.finished.catch(() => undefined));\n runs.push(ctx.animate(el, [{ opacity: 0, filter: 'brightness(2) saturate(0)' }, { opacity: 1, filter: 'none' }], { duration: o.duration, easing: 'steps(6, end)', fill: 'backwards' })?.finished.catch(() => undefined));\n return Promise.all(runs).then(() => ov.remove());\n },\n },\n {\n name: 'scanline-sweep',\n kind: 'attention',\n description: 'A bright horizontal scanline runs down the element (`color`, `passes`).',\n defaults: { color: 'rgba(34,211,238,.9)', passes: 1, duration: 800 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n if (ctx.reduced) return;\n const ov = overlay(el, ctx);\n const b = bar(ov, o.color, '3px');\n const a = ctx.animate(b, [{ transform: 'translateY(-4px)' }, { transform: `translateY(${(el.clientHeight || 80) + 4}px)` }], { duration: o.duration, iterations: Math.max(1, Math.min(5, Number(o.passes) || 1)), easing: 'linear' });\n const end = () => ov.remove();\n return a ? a.finished.then(end, end) : (end(), undefined);\n },\n },\n {\n name: 'hologram',\n kind: 'loop',\n description: 'A flickering, translucent hologram look with drifting scan bands until the cleanup runs (`color`).',\n defaults: { color: '#22d3ee', duration: 2400 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n const ov = overlay(el, ctx);\n ov.style.background = `repeating-linear-gradient(0deg, transparent 0 3px, ${o.color}33 3px 4px)`;\n ov.style.mixBlendMode = 'screen';\n const prev = el.style.filter;\n el.style.filter = `drop-shadow(0 0 6px ${o.color}) saturate(1.4)`;\n const a = ctx.animate(el, [{ opacity: 0.85 }, { opacity: 0.6, offset: 0.08 }, { opacity: 0.9, offset: 0.12 }, { opacity: 0.8, offset: 0.5 }, { opacity: 0.55, offset: 0.52 }, { opacity: 0.85 }], { duration: o.duration, iterations: Infinity });\n const b = ctx.animate(ov, [{ backgroundPosition: '0 0' }, { backgroundPosition: '0 40px' }], { duration: 1600, iterations: Infinity, easing: 'linear' });\n return () => {\n a?.cancel();\n b?.cancel();\n ov.remove();\n el.style.filter = prev;\n };\n },\n },\n {\n name: 'data-decode',\n kind: 'enter',\n description: 'The text resolves from random glyphs to the real characters, left to right (`speed` ms per frame).',\n defaults: { speed: 40, frames: 16 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n if (ctx.reduced) return;\n const text = el.textContent || '';\n if (!text.trim() || el.children.length) return;\n const n = Math.max(4, Math.min(60, Number(o.frames) || 16));\n el.setAttribute('aria-label', text);\n let k = 0;\n let timer = 0 as unknown as ReturnType<typeof setTimeout>;\n const restore = () => {\n clearTimeout(timer);\n el.textContent = text;\n el.removeAttribute('aria-label');\n };\n ctx.onCleanup(restore);\n return new Promise<void>((resolve) => {\n const step = () => {\n if (k > n) {\n restore();\n return resolve();\n }\n el.textContent = decodeFrame(text, k++, n);\n timer = setTimeout(step, Math.max(10, Number(o.speed) || 40));\n };\n step();\n });\n },\n },\n];\n\n/** Register hud-frame, scanline-sweep, hologram and data-decode (8.4). */\nexport function registerCyberPack(): void {\n registerEffects(CYBER_FX);\n}\n"],"names":[],"mappings":";;;AAkBA,MAAM,MAAM,GAAG,6BAA6B;AAC5C;AACM,SAAU,WAAW,CAAC,IAAY,EAAE,CAAS,EAAE,CAAS,EAAE,GAAA,GAAoB,IAAI,CAAC,MAAM,EAAA;AAC7F,IAAA,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC;IACxE,IAAI,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC;AAC7B,IAAA,KAAK,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE;AAAE,QAAA,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;AACxH,IAAA,OAAO,GAAG;AACZ;AAEA,MAAM,OAAO,GAAG,CAAC,EAAe,EAAE,GAAkB,KAAI;IACtD,IAAI,gBAAgB,CAAC,EAAE,CAAC,CAAC,QAAQ,KAAK,QAAQ,EAAE;AAC9C,QAAA,MAAM,IAAI,GAAG,EAAE,CAAC,KAAK,CAAC,QAAQ;AAC9B,QAAA,EAAE,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU;AAC9B,QAAA,GAAG,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;IACjD;IACA,MAAM,CAAC,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AC,YAAY,EAAE,IAAI,CAAC;YACnC,IAAI,CAAC,GAAG,CAAC;YACT,IAAI,KAAK,GAAG,CAA6C;YACzD,MAAM,OAAO,GAAG,MAAK;gBACnB,YAAY,CAAC,KAAK,CAAC;AACnB,gBAAA,EAAE,CAAC,WAAW,GAAG,IAAI;AACrB,gBAAA,EAAE,CAAC,eAAe,CAAC,YAAY,CAAC;AAClC,YAAA,CAAC;AACD,YAAA,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC;AACtB,YAAA,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,KAAI;gBACnC,MAAM,IAAI,GAAG,MAAK;AAChB,oBAAA,IAAI,CAAC,GAAG,CAAC,EAAE;AACT,wBAAA,OAAO,EAAE;wBACT,OAAO,OAAO,EAAE;oBAClB;AACA,oBAAA,EAAE,CAAC,WAAW,GAAG,WAAW,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;oBAC1C,KAAK,GAAG,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;AAC/D,gBAAA,CAAC;AACD,gBAAA,IAAI,EAAE;AACR,YAAA,CAAC,CAAC;QACJ,CAAC;AACF,KAAA;;AAGH;SACgB,iBAAiB,GAAA;IAC/B,eAAe,CAAC,QAAQ,CAAC;AAC3B;;;;"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var registry = require('../chunks/registry-BVklOepd.cjs');
|
|
4
|
+
require('../chunks/base-DoRUZBy-.cjs');
|
|
5
|
+
|
|
6
|
+
/** A deterministic PRNG in [0, 1) from a seed (8.5). */
|
|
7
|
+
function paperRandom(seed) {
|
|
8
|
+
let s = Math.abs(Math.round(seed * 1000)) % 233280 || 11;
|
|
9
|
+
return () => (s = (s * 9301 + 49297) % 233280) / 233280;
|
|
10
|
+
}
|
|
11
|
+
/** A hand-drawn SVG path from (x1,y1) to (x2,y2): a slightly bowed, wobbly line (8.5). */
|
|
12
|
+
function roughLine(x1, y1, x2, y2, seed = 1, amp = 1.5) {
|
|
13
|
+
const r = paperRandom(seed);
|
|
14
|
+
const j = () => (r() - 0.5) * 2 * amp;
|
|
15
|
+
const mx = (x1 + x2) / 2 + j() * 1.5;
|
|
16
|
+
const my = (y1 + y2) / 2 + j() * 1.5;
|
|
17
|
+
const f = (n) => Math.round(n * 10) / 10;
|
|
18
|
+
return `M${f(x1 + j())} ${f(y1 + j())} Q${f(mx)} ${f(my)} ${f(x2 + j())} ${f(y2 + j())}`;
|
|
19
|
+
}
|
|
20
|
+
const fade = (el, ctx) => ctx.animate(el, [{ opacity: 0 }, { opacity: 1 }], { duration: 250 })?.finished.catch(() => undefined);
|
|
21
|
+
const PAPER_FX = [
|
|
22
|
+
{
|
|
23
|
+
name: 'paper-unfold',
|
|
24
|
+
kind: 'enter',
|
|
25
|
+
description: 'The element unfolds like a folded sheet of paper, with a soft crease shadow (`folds`).',
|
|
26
|
+
defaults: { duration: 900, folds: 2 },
|
|
27
|
+
run: (el, o, ctx) => {
|
|
28
|
+
if (ctx.reduced)
|
|
29
|
+
return fade(el, ctx);
|
|
30
|
+
const n = Math.max(1, Math.min(4, Math.round(Number(o.folds) || 2)));
|
|
31
|
+
const frames = [{ transform: 'perspective(800px) rotateX(-90deg)', opacity: 0, filter: 'brightness(.7)', offset: 0 }];
|
|
32
|
+
for (let i = 1; i <= n; i++)
|
|
33
|
+
frames.push({ transform: `perspective(800px) rotateX(${i % 2 ? 25 : -12}deg) scaleY(${(0.5 + (0.5 * i) / (n + 1)).toFixed(2)})`, opacity: 1, filter: 'brightness(.85)', offset: (i / (n + 1)) * 0.9 });
|
|
34
|
+
frames.push({ transform: 'none', opacity: 1, filter: 'none', offset: 1 });
|
|
35
|
+
const prev = el.style.transformOrigin;
|
|
36
|
+
el.style.transformOrigin = 'top center';
|
|
37
|
+
ctx.onCleanup(() => (el.style.transformOrigin = prev));
|
|
38
|
+
return ctx.animate(el, frames, { duration: o.duration, easing: 'ease-out', fill: 'backwards' })?.finished.catch(() => undefined);
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: 'pencil-sketch',
|
|
43
|
+
kind: 'enter',
|
|
44
|
+
description: 'SVG strokes inside are sketched in with a slightly wobbly pencil, one after another (`duration`, `stagger`).',
|
|
45
|
+
defaults: { duration: 700, stagger: 120 },
|
|
46
|
+
run: (el, o, ctx) => {
|
|
47
|
+
if (ctx.reduced)
|
|
48
|
+
return;
|
|
49
|
+
const strokes = Array.from(el.querySelectorAll('path, line, polyline, rect, circle, ellipse'));
|
|
50
|
+
const runs = strokes.map((p, i) => {
|
|
51
|
+
let len = 200;
|
|
52
|
+
try {
|
|
53
|
+
len = p.getTotalLength?.() || 200;
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
/* not rendered */
|
|
57
|
+
}
|
|
58
|
+
const prev = p.style.strokeDasharray;
|
|
59
|
+
p.style.strokeDasharray = `${len}`;
|
|
60
|
+
ctx.onCleanup(() => (p.style.strokeDasharray = prev));
|
|
61
|
+
return ctx.animate(p, [{ strokeDashoffset: `${len}`, transform: 'translate(0.6px,-0.4px)' }, { transform: 'translate(-0.5px,0.5px)', offset: 0.5 }, { strokeDashoffset: '0', transform: 'none' }], { duration: o.duration, delay: i * (Number(o.stagger) || 0), easing: 'cubic-bezier(.5,.1,.4,1)', fill: 'backwards' })?.finished.catch(() => undefined);
|
|
62
|
+
});
|
|
63
|
+
return Promise.all(runs).then(() => undefined);
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: 'watercolor',
|
|
68
|
+
kind: 'enter',
|
|
69
|
+
description: 'The element bleeds in like wet watercolour — blurred and saturated, spreading from the middle — then dries (`duration`).',
|
|
70
|
+
defaults: { duration: 1400 },
|
|
71
|
+
run: (el, o, ctx) => {
|
|
72
|
+
if (ctx.reduced)
|
|
73
|
+
return fade(el, ctx);
|
|
74
|
+
return ctx.animate(el, [
|
|
75
|
+
{ opacity: 0, filter: 'blur(10px) saturate(2.2)', clipPath: 'circle(8% at 50% 50%)' },
|
|
76
|
+
{ opacity: 0.9, filter: 'blur(4px) saturate(1.8)', clipPath: 'circle(55% at 48% 52%)', offset: 0.5 },
|
|
77
|
+
{ opacity: 1, filter: 'blur(0) saturate(1)', clipPath: 'circle(150% at 50% 50%)' },
|
|
78
|
+
], { duration: o.duration, easing: 'ease-out', fill: 'backwards' })?.finished.catch(() => undefined);
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: 'crumple',
|
|
83
|
+
kind: 'attention',
|
|
84
|
+
description: 'The element scrunches like crumpled paper and springs back flat.',
|
|
85
|
+
defaults: { duration: 700 },
|
|
86
|
+
run: (el, o, ctx) => {
|
|
87
|
+
if (ctx.reduced)
|
|
88
|
+
return;
|
|
89
|
+
return ctx.animate(el, [
|
|
90
|
+
{ transform: 'none' },
|
|
91
|
+
{ transform: 'scale(.82,.9) rotate(-4deg) skewX(6deg)', filter: 'brightness(.9)', offset: 0.3 },
|
|
92
|
+
{ transform: 'scale(.9,.8) rotate(3deg) skewY(-5deg)', offset: 0.5 },
|
|
93
|
+
{ transform: 'scale(1.04) rotate(-1deg)', filter: 'none', offset: 0.8 },
|
|
94
|
+
{ transform: 'none' },
|
|
95
|
+
], { duration: o.duration, easing: 'ease-in-out' })?.finished.catch(() => undefined);
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
];
|
|
99
|
+
/** Register paper-unfold, pencil-sketch, watercolor and crumple (8.5). */
|
|
100
|
+
function registerPaperPack() {
|
|
101
|
+
registry.registerEffects(PAPER_FX);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
exports.PAPER_FX = PAPER_FX;
|
|
105
|
+
exports.paperRandom = paperRandom;
|
|
106
|
+
exports.registerPaperPack = registerPaperPack;
|
|
107
|
+
exports.roughLine = roughLine;
|
|
108
|
+
//# sourceMappingURL=fx-paper.cjs.map
|