@johnoscott/isometric-engine 0.14.1 → 0.15.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 +1 -1
- package/iso-editor.js +199 -190
- package/iso-render.js +157 -148
- package/iso-systems.js +170 -159
- package/js/iso-objects/ants.js +36 -0
- package/js/iso-objects/index.js +47 -1
- package/js/iso-objects/looks.js +25 -0
- package/js/iso-objects/motion-builder.js +130 -0
- package/js/iso-objects/motion-doc.js +500 -0
- package/js/iso-objects/motion-entry.js +32 -0
- package/js/iso-objects/motion.js +635 -0
- package/js/iso-objects/resolve.js +238 -0
- package/js/iso-objects/scene.js +15 -13
- package/js/iso-objects/timeline.js +553 -0
- package/js/iso-systems/compile.js +59 -1
- package/js/iso-systems/index.js +4 -1
- package/js/iso-systems/render.js +20 -0
- package/js/iso-systems/schema.json +39 -0
- package/js/iso-viewer/page.js +2 -1
- package/js/iso-viewer/player.js +23 -34
- package/package.json +46 -1
- package/src/iso-objects/ants.ts +53 -0
- package/src/iso-objects/compile.ts +4 -1
- package/src/iso-objects/index.ts +14 -1
- package/src/iso-objects/looks.ts +21 -0
- package/src/iso-objects/motion-builder.ts +79 -0
- package/src/iso-objects/motion-doc.ts +361 -0
- package/src/iso-objects/motion-entry.ts +12 -0
- package/src/iso-objects/motion.ts +616 -0
- package/src/iso-objects/resolve.ts +196 -0
- package/src/iso-objects/scene.ts +29 -13
- package/src/iso-objects/timeline.ts +443 -0
- package/src/iso-objects/types.ts +20 -2
- package/src/iso-systems/compile.ts +58 -3
- package/src/iso-systems/index.ts +4 -1
- package/src/iso-systems/render.ts +41 -0
- package/src/iso-systems/schema.json +39 -0
- package/src/iso-viewer/page.ts +2 -1
- package/src/iso-viewer/player.ts +24 -41
- package/types/iso-objects/ants.d.ts +33 -0
- package/types/iso-objects/compile.d.ts +3 -0
- package/types/iso-objects/index.d.ts +14 -1
- package/types/iso-objects/looks.d.ts +4 -0
- package/types/iso-objects/motion-builder.d.ts +105 -0
- package/types/iso-objects/motion-doc.d.ts +787 -0
- package/types/iso-objects/motion-entry.d.ts +10 -0
- package/types/iso-objects/motion.d.ts +200 -0
- package/types/iso-objects/resolve.d.ts +20 -0
- package/types/iso-objects/scene.d.ts +11 -0
- package/types/iso-objects/timeline.d.ts +46 -0
- package/types/iso-objects/types.d.ts +32 -0
- package/types/iso-systems/compile.d.ts +20 -3
- package/types/iso-systems/index.d.ts +4 -1
- package/types/iso-systems/render.d.ts +21 -0
|
@@ -29,6 +29,29 @@
|
|
|
29
29
|
"scenes": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/scene" } }
|
|
30
30
|
},
|
|
31
31
|
"$defs": {
|
|
32
|
+
"motion": {
|
|
33
|
+
"type": "object", "additionalProperties": false, "minProperties": 1,
|
|
34
|
+
"description": "how this piece (a region: its contents too) moves when the drawing assembles or disassembles",
|
|
35
|
+
"properties": {
|
|
36
|
+
"style": { "enum": ["edge", "drop", "rise", "fly", "pop", "scatter", "build", "fade"], "description": "how it arrives" },
|
|
37
|
+
"out": { "enum": ["explode", "lift-off", "sink", "scatter", "fly-out", "collapse", "fade", "reverse"], "description": "how it leaves" },
|
|
38
|
+
"easing": { "enum": ["linear", "ease", "ease-in", "ease-out", "settle", "spring", "bounce"] },
|
|
39
|
+
"from": { "enum": ["left", "right", "top", "bottom"], "description": "fly: the side it comes from" },
|
|
40
|
+
"delay": { "type": "number", "minimum": 0, "description": "ms after its turn" },
|
|
41
|
+
"duration": { "type": "number", "exclusiveMinimum": 0, "description": "ms its own move takes" }
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"variants": {
|
|
45
|
+
"type": "object", "minProperties": 1, "propertyNames": { "$ref": "#/$defs/id" },
|
|
46
|
+
"description": "other looks of it, by name, for a motion to switch to (its box stays as it is)",
|
|
47
|
+
"additionalProperties": {
|
|
48
|
+
"type": "object", "additionalProperties": false, "minProperties": 1,
|
|
49
|
+
"properties": {
|
|
50
|
+
"role": { "type": "string" }, "ghost": { "type": "boolean" }, "label": { "type": "string" }, "sub": { "type": "string" },
|
|
51
|
+
"face": { "type": "string", "pattern": "^[a-z][a-z0-9-]*$" }, "deco": { "type": "array", "items": { "$ref": "#/$defs/deco" } }
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
32
55
|
"id": { "type": "string", "pattern": "^[A-Za-z][A-Za-z0-9_-]*$" },
|
|
33
56
|
"grid": {
|
|
34
57
|
"type": "object",
|
|
@@ -88,6 +111,18 @@
|
|
|
88
111
|
"properties": {
|
|
89
112
|
"id": { "$ref": "#/$defs/id" },
|
|
90
113
|
"title": { "type": "string" },
|
|
114
|
+
"ants": {
|
|
115
|
+
"description": "its connectors march, showing which way they flow: all that may, these, or with a speed (units a second) and a dash",
|
|
116
|
+
"anyOf": [
|
|
117
|
+
{ "type": "boolean" },
|
|
118
|
+
{ "type": "array", "items": { "type": "string" } },
|
|
119
|
+
{ "type": "object", "additionalProperties": false, "properties": {
|
|
120
|
+
"ids": { "type": "array", "items": { "type": "string" } },
|
|
121
|
+
"speed": { "type": "number" },
|
|
122
|
+
"dash": { "type": "array", "items": { "type": "number", "exclusiveMinimum": 0 }, "minItems": 2, "maxItems": 2 } } }
|
|
123
|
+
]
|
|
124
|
+
},
|
|
125
|
+
"motion": { "type": "object", "description": "the scene's motion document (isomotion/1; its `isomotion: 1` may be left out)" },
|
|
91
126
|
"caption": { "type": "string" },
|
|
92
127
|
"aria": { "type": "string" },
|
|
93
128
|
"gap": { "type": "number", "exclusiveMinimum": 0 },
|
|
@@ -143,6 +178,8 @@
|
|
|
143
178
|
},
|
|
144
179
|
"around": { "type": "array", "items": { "$ref": "#/$defs/id" }, "description": "tunnel: routes it wraps" },
|
|
145
180
|
"regions": { "type": "array", "items": { "$ref": "#/$defs/region" } },
|
|
181
|
+
"motion": { "$ref": "#/$defs/motion" },
|
|
182
|
+
"variants": { "$ref": "#/$defs/variants" },
|
|
146
183
|
"nodes": { "type": "array", "items": { "$ref": "#/$defs/node" } }
|
|
147
184
|
}
|
|
148
185
|
},
|
|
@@ -188,6 +225,8 @@
|
|
|
188
225
|
"dy": { "type": "number" }
|
|
189
226
|
}
|
|
190
227
|
},
|
|
228
|
+
"motion": { "$ref": "#/$defs/motion" },
|
|
229
|
+
"variants": { "$ref": "#/$defs/variants" },
|
|
191
230
|
"nodes": { "type": "array", "items": { "$ref": "#/$defs/node" }, "description": "nodes standing on top of this one" }
|
|
192
231
|
}
|
|
193
232
|
},
|
package/src/iso-viewer/page.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// The HTML page around the scenes: header, one section per scene, theme toggle. One file, no network.
|
|
2
2
|
|
|
3
|
+
import { motionModel } from '../iso-objects/motion.ts';
|
|
3
4
|
import { esc } from '../iso-core/kernel.ts';
|
|
4
5
|
import type { Compiled } from '../iso-objects/compile.ts';
|
|
5
6
|
import { themeCss } from '../iso-core/theme.ts';
|
|
@@ -31,7 +32,7 @@ export function stepData(c: Compiled): string {
|
|
|
31
32
|
scenes: c.scenes.map(s => ({
|
|
32
33
|
id: s.id, loop: s.raw.loop ?? true, dim: s.raw.dim ?? 'flows', vis: s.steps.vis,
|
|
33
34
|
steps: s.steps.steps.map(st => ({ ...st, caption: md(st.caption) })),
|
|
34
|
-
assemble: s.assemble, grid: !!s.grid.show,
|
|
35
|
+
assemble: s.assemble, grid: !!s.grid.show, motion: motionModel(s),
|
|
35
36
|
})),
|
|
36
37
|
});
|
|
37
38
|
}
|
package/src/iso-viewer/player.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
// #grid (show the floor grid), #assemble (play the assemble intro) and #assemble&at=MS (freeze it at that moment).
|
|
7
7
|
|
|
8
8
|
import { focusView } from '../iso-objects/focus.ts';
|
|
9
|
+
import { paint, planOf, type MotionModel } from '../iso-objects/motion.ts';
|
|
9
10
|
|
|
10
11
|
interface Token { route: string; kind: string; color: string }
|
|
11
12
|
interface Step {
|
|
@@ -13,17 +14,14 @@ interface Step {
|
|
|
13
14
|
phases: Token[][]; pulses: [number, number, number, number][]; lit: string[]; duration: number;
|
|
14
15
|
focus?: [number, number, number, number];
|
|
15
16
|
}
|
|
16
|
-
interface Piece { id: string; kind: 'region' | 'node'; dx: number; dy: number; delay: number; dur: number }
|
|
17
|
-
interface Assembly { pieces: Piece[]; routes: { id: string; delay: number; dur: number }[]; labels: { delay: number; dur: number }; total: number }
|
|
18
17
|
interface SceneData {
|
|
19
18
|
id: string; loop: boolean; dim: 'flows' | 'all'; steps: Step[]; vis: Record<string, boolean[]>;
|
|
20
|
-
assemble: boolean; grid: boolean;
|
|
19
|
+
assemble: boolean; grid: boolean; motion: MotionModel;
|
|
21
20
|
}
|
|
22
21
|
interface Data { scenes: SceneData[] }
|
|
23
22
|
|
|
24
23
|
const NS = 'http://www.w3.org/2000/svg';
|
|
25
24
|
const TRAVEL = 1150;
|
|
26
|
-
const EASE_IN = 'cubic-bezier(.16,.84,.3,1)';
|
|
27
25
|
|
|
28
26
|
function svgEl(tag: string, attrs: Record<string, string | number>, parent: Element): SVGElement {
|
|
29
27
|
const e = document.createElementNS(NS, tag);
|
|
@@ -77,7 +75,7 @@ function init() {
|
|
|
77
75
|
if (sd.dim === 'all') svg.classList.add('dim-all');
|
|
78
76
|
|
|
79
77
|
let cur = 0, playing = false, userPaused = false, active = false, timer = 0, raf = 0, groups = 0, t0 = 0;
|
|
80
|
-
let assembling = false, assembled = false,
|
|
78
|
+
let assembling = false, assembled = false, introTimer = 0, introDone: (() => void) | undefined;
|
|
81
79
|
let tokens: { path: SVGPathElement; len: number; gi: number; stop: boolean; c: SVGElement }[] = [];
|
|
82
80
|
|
|
83
81
|
// ---- grid ----
|
|
@@ -177,50 +175,35 @@ function init() {
|
|
|
177
175
|
function stop() { playing = false; clearTimeout(timer); setBtn(); restartProg(); }
|
|
178
176
|
function userPause() { userPaused = true; stop(); }
|
|
179
177
|
|
|
180
|
-
// ---- assemble:
|
|
181
|
-
const
|
|
182
|
-
|
|
183
|
-
function finishAssemble() {
|
|
184
|
-
if (!assembling) return;
|
|
185
|
-
for (const a of animations) a.finish();
|
|
186
|
-
}
|
|
178
|
+
// ---- assemble: the motion core's plan (the same a video is made from), painted as time goes by ----
|
|
179
|
+
const plan = planOf(sd.motion, 'assemble');
|
|
180
|
+
function finishAssemble() { if (assembling) introDone?.(); }
|
|
187
181
|
function assemble(freezeAt?: number) {
|
|
188
|
-
|
|
189
|
-
|
|
182
|
+
clearTimeout(introTimer);
|
|
183
|
+
introDone = undefined;
|
|
190
184
|
stop();
|
|
191
185
|
if (N) show(cur); // set what is visible at this step; focus comes back at the end
|
|
192
186
|
clearAnim();
|
|
193
187
|
svg.classList.remove('focus', 'pre-assemble', 'all');
|
|
194
188
|
assembling = true;
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
}
|
|
203
|
-
for (const r of A.routes) {
|
|
204
|
-
const g = layer('flows')?.querySelector(`[data-hl="${CSS.escape(r.id)}"]`);
|
|
205
|
-
const path = g?.querySelector<SVGPathElement>('path.flow');
|
|
206
|
-
if (!g || !path) continue;
|
|
207
|
-
const len = path.getTotalLength();
|
|
208
|
-
run(g, [{ opacity: 0 }, { opacity: 1 }], r.delay, 80, 'linear');
|
|
209
|
-
run(path, [{ strokeDasharray: `${len} ${len}`, strokeDashoffset: len }, { strokeDasharray: `${len} ${len}`, strokeDashoffset: 0 }], r.delay, r.dur, 'ease-out');
|
|
210
|
-
}
|
|
211
|
-
for (const name of ['floor', 'labels', 'badges']) {
|
|
212
|
-
const L = layer(name);
|
|
213
|
-
if (L) run(L, [{ opacity: 0 }, { opacity: 1 }], A.labels.delay, A.labels.dur, 'ease-out');
|
|
214
|
-
}
|
|
215
|
-
if (freezeAt !== undefined) {
|
|
216
|
-
for (const a of animations) { a.pause(); a.currentTime = freezeAt; }
|
|
217
|
-
return;
|
|
218
|
-
}
|
|
219
|
-
Promise.all(animations.map(a => a.finished)).then(() => {
|
|
220
|
-
assembling = false; assembled = true; animations = [];
|
|
189
|
+
if (freezeAt !== undefined) { paint(svg, plan.at(freezeAt)); return; }
|
|
190
|
+
const start = performance.now();
|
|
191
|
+
introDone = () => {
|
|
192
|
+
clearTimeout(introTimer);
|
|
193
|
+
introDone = undefined;
|
|
194
|
+
paint(svg, {});
|
|
195
|
+
assembling = false; assembled = true;
|
|
221
196
|
if (N) show(cur);
|
|
222
197
|
if (active && !userPaused) play();
|
|
223
|
-
}
|
|
198
|
+
};
|
|
199
|
+
// a timer, not a frame callback, so it also finishes where no frames are drawn
|
|
200
|
+
const step = () => {
|
|
201
|
+
const t = performance.now() - start;
|
|
202
|
+
if (t >= plan.duration) { introDone?.(); return; }
|
|
203
|
+
paint(svg, plan.at(t));
|
|
204
|
+
introTimer = window.setTimeout(step, 16);
|
|
205
|
+
};
|
|
206
|
+
step();
|
|
224
207
|
}
|
|
225
208
|
asmBtn?.addEventListener('click', () => { userPaused = false; assemble(); });
|
|
226
209
|
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { CompiledScene } from './compile.js';
|
|
2
|
+
export declare const ANT_SPEED: number;
|
|
3
|
+
export declare const ANT_DASH: Record<string, [number, number]>;
|
|
4
|
+
export declare const ANT_STILL: string[];
|
|
5
|
+
export interface AntsOptions {
|
|
6
|
+
/** how it moves (default: smil); 'none': the dashes, standing still */
|
|
7
|
+
by?: 'css' | 'smil' | 'none';
|
|
8
|
+
/** the connectors that march (default: every one that may) */
|
|
9
|
+
ids?: string[];
|
|
10
|
+
/** units a second, in the drawing's units (default: 32 in 1.1 s) */
|
|
11
|
+
speed?: number;
|
|
12
|
+
dash?: [number, number];
|
|
13
|
+
/** the connectors' dashes, by kind: the theme's `kinds` (a dashed kind marches with its own dash) */
|
|
14
|
+
kinds?: Record<string, {
|
|
15
|
+
dash?: 'solid' | 'dashed' | 'dotted';
|
|
16
|
+
}>;
|
|
17
|
+
/** kinds whose connectors stand still (default: blocked, planned) */
|
|
18
|
+
still?: string[];
|
|
19
|
+
}
|
|
20
|
+
/** for 'css': one rule and its keyframes. A page stops them, where they are, with --ants: paused. */
|
|
21
|
+
export declare const ANTS_CSS = "\n.flow.iso-ants{stroke-dasharray:var(--ant-on) var(--ant-off);animation:iso-ants var(--ant-turn) linear infinite;animation-play-state:var(--ants,running)}\n@keyframes iso-ants{to{stroke-dashoffset:var(--ant-to)}}\n";
|
|
22
|
+
/** the dash a connector marches with, or undefined when it stands still */
|
|
23
|
+
export declare function antDash(kind: string, o?: Pick<AntsOptions, 'dash' | 'kinds' | 'still'>): [number, number] | undefined;
|
|
24
|
+
/** what a scene's `ants:` in the file asks for, as options; undefined: none */
|
|
25
|
+
export declare function antsOf(raw: {
|
|
26
|
+
ants?: boolean | string[] | {
|
|
27
|
+
ids?: string[];
|
|
28
|
+
speed?: number;
|
|
29
|
+
dash?: [number, number];
|
|
30
|
+
};
|
|
31
|
+
} | undefined): Pick<AntsOptions, 'ids' | 'speed' | 'dash'> | undefined;
|
|
32
|
+
/** The scene's still, as SVG text, with its connectors marching. */
|
|
33
|
+
export declare function withAnts(scene: Pick<CompiledScene, 'rendered' | 'routes'>, o?: AntsOptions): string;
|
|
@@ -5,6 +5,7 @@ import { type RenderedScene } from './scene.js';
|
|
|
5
5
|
import { type Routed } from './route.js';
|
|
6
6
|
import { type Steps } from './steps.js';
|
|
7
7
|
import { type KindCatalog } from './kinds.js';
|
|
8
|
+
import type { MotionDoc } from './motion-doc.js';
|
|
8
9
|
import type { GridDef, RawDiagram, Theme } from './types.js';
|
|
9
10
|
export interface CompiledScene {
|
|
10
11
|
id: string;
|
|
@@ -15,6 +16,8 @@ export interface CompiledScene {
|
|
|
15
16
|
rendered: RenderedScene;
|
|
16
17
|
grid: GridDef;
|
|
17
18
|
assemble: boolean;
|
|
19
|
+
/** the file's `motion:` on this scene, checked against the drawing (a file with errors in it has none) */
|
|
20
|
+
motion?: MotionDoc;
|
|
18
21
|
}
|
|
19
22
|
export interface Compiled {
|
|
20
23
|
ok: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { Side, StepRef, RawPlacement, RawDeco, RawNode, RawGate, RawRegion, RawNote, RawScene, GridDef, RawDiagram, RegionKindName, Placed, RawRole, RawKind, Theme } from './types.js';
|
|
1
|
+
export type { Side, StepRef, RawPlacement, RawDeco, RawNode, RawGate, RawRegion, RawNote, RawScene, GridDef, RawDiagram, RegionKindName, Placed, RawRole, RawKind, Theme, RawMotion, RawVariant } from './types.js';
|
|
2
2
|
export { regionKind, nodeKind, nodeKindOr, wallHeight, kindsCss } from './kinds.js';
|
|
3
3
|
export type { RegionShape, RegionKind, KindCatalog } from './kinds.js';
|
|
4
4
|
export { drawDecos, boxAsset, plate, cloudPath, drawCloud, defaultLabel, registerMarks, markCss, iconPainter, facePainter, placeholderIcon } from './assets.js';
|
|
@@ -11,6 +11,19 @@ export { silhouette, polyBounds, polyRectArea, rectArea, lineRectArea, Obstacles
|
|
|
11
11
|
export type { Rect, Poly, LabelText, PlacedLabel, CalloutSpot } from './labels.js';
|
|
12
12
|
export { offscreen, assembly } from './assemble.js';
|
|
13
13
|
export type { Edge, Piece, Assembly } from './assemble.js';
|
|
14
|
+
export { ASSEMBLE_STYLES, DISASSEMBLE_STYLES, MOTION_ORDERS, MOTION_EASINGS, motionModel, motionOrder, planOf, assemble, disassemble, alongPath, svgAt, paint, introSvg } from './motion.js';
|
|
15
|
+
export type { AssembleStyle, DisassembleStyle, MotionOrder, MotionEasing, Direction, PieceMotion, AssembleOptions, DisassembleOptions, PlanOptions, MotionPiece, MotionModel, MotionPlan, ScenePlan, SceneState, ItemState, LabelState, RouteState } from './motion.js';
|
|
16
|
+
export { drawLooks } from './looks.js';
|
|
17
|
+
export { withAnts, antsOf, antDash, ANTS_CSS, ANT_SPEED, ANT_DASH, ANT_STILL } from './ants.js';
|
|
18
|
+
export type { AntsOptions } from './ants.js';
|
|
19
|
+
export { motion, MotionBuilder, SeriesBuilder, NodesBuilder } from './motion-builder.js';
|
|
20
|
+
export type { SequenceOptions, Timing, CameraVerbs, Ids as MotionIds } from './motion-builder.js';
|
|
21
|
+
export { bindMotion, motionOfSteps } from './timeline.js';
|
|
22
|
+
export type { Timeline, BindOptions, BeatInfo, Cue } from './timeline.js';
|
|
23
|
+
export { MOTION_SCHEMA, EASING_NAMES, EXTRAPOLATE, checkMotion, msOf, readMs, easeOf, curveAt, springAt, bezier } from './motion-doc.js';
|
|
24
|
+
export type { MotionDoc, MotionNode, MotionTime, MotionEase, EasingName, Extrapolate, SpringConfig, Curve, Say as MotionSay, Focus, ReadTime, Sequence, SeriesItem, Transition, MotionDiag } from './motion-doc.js';
|
|
25
|
+
export { resolveSvg, FONT_STACKS } from './resolve.js';
|
|
26
|
+
export type { ResolveOptions, ThemeMode } from './resolve.js';
|
|
14
27
|
export { durationFor, resolveSteps, midpoint } from './steps.js';
|
|
15
28
|
export type { RawStep, Token, StepData, Say, Mark, Badge, Steps } from './steps.js';
|
|
16
29
|
export { focusView } from './focus.js';
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import type { Curve, Focus, MotionDoc, MotionEase, MotionNode, MotionTime, ReadTime, Say, Sequence, SeriesItem, Transition } from './motion-doc.js';
|
|
2
|
+
import type { AssembleOptions, DisassembleOptions } from './motion.js';
|
|
3
|
+
export interface Timing {
|
|
4
|
+
from?: MotionTime;
|
|
5
|
+
over?: MotionTime;
|
|
6
|
+
easing?: MotionEase;
|
|
7
|
+
}
|
|
8
|
+
/** a sequence's own keys; `read`: as long as its words take (true, or how) */
|
|
9
|
+
export type SequenceOptions = Omit<Sequence, 'name' | 'children' | 'layers' | 'series' | 'duration'> & {
|
|
10
|
+
duration?: MotionTime;
|
|
11
|
+
read?: ReadTime['read'];
|
|
12
|
+
};
|
|
13
|
+
export type Ids = string | string[];
|
|
14
|
+
export interface CameraVerbs<B> {
|
|
15
|
+
focus(on: Ids | [number, number, number, number], o?: Timing & {
|
|
16
|
+
zoom?: number;
|
|
17
|
+
margin?: number;
|
|
18
|
+
}): B;
|
|
19
|
+
fit(o?: Timing): B;
|
|
20
|
+
}
|
|
21
|
+
/** what is in a sequence (or in a document's layers), in the order it is said */
|
|
22
|
+
export declare class NodesBuilder {
|
|
23
|
+
/** @internal */
|
|
24
|
+
readonly nodes: MotionNode[];
|
|
25
|
+
private add;
|
|
26
|
+
assemble(o?: Omit<AssembleOptions, 'duration'>, t?: Timing): this;
|
|
27
|
+
disassemble(o?: Omit<DisassembleOptions, 'duration'>, t?: Timing): this;
|
|
28
|
+
/** tokens along connectors, one after another; a nested list at once; "id:kind" */
|
|
29
|
+
travel(routes: (string | string[])[], o?: Timing & {
|
|
30
|
+
each?: MotionTime;
|
|
31
|
+
hold?: MotionTime;
|
|
32
|
+
loop?: boolean;
|
|
33
|
+
}): this;
|
|
34
|
+
pulse(ids: Ids, o?: Timing & {
|
|
35
|
+
loop?: boolean;
|
|
36
|
+
}): this;
|
|
37
|
+
ants(ids?: Ids | true, o?: Timing & {
|
|
38
|
+
speed?: number;
|
|
39
|
+
dash?: [number, number];
|
|
40
|
+
}): this;
|
|
41
|
+
draw(routes: Ids, o?: Timing & {
|
|
42
|
+
by?: 'stroke' | 'grow';
|
|
43
|
+
stagger?: MotionTime;
|
|
44
|
+
}): this;
|
|
45
|
+
type(ids: Ids, o?: Timing): this;
|
|
46
|
+
move(id: string, o: {
|
|
47
|
+
from?: MotionTime;
|
|
48
|
+
x?: Curve;
|
|
49
|
+
y?: Curve;
|
|
50
|
+
scale?: Curve;
|
|
51
|
+
opacity?: Curve;
|
|
52
|
+
}): this;
|
|
53
|
+
lift(ids: Ids, by: number, o?: Timing & {
|
|
54
|
+
stagger?: MotionTime;
|
|
55
|
+
to?: 'up' | 'down';
|
|
56
|
+
opacity?: Curve;
|
|
57
|
+
}): this;
|
|
58
|
+
focus(lit: Ids, o?: Timing & Omit<Focus, 'lit'> & {
|
|
59
|
+
fade?: MotionTime;
|
|
60
|
+
}): this;
|
|
61
|
+
highlight(ids: Ids, o?: Timing & {
|
|
62
|
+
fade?: MotionTime;
|
|
63
|
+
}): this;
|
|
64
|
+
/** the view: on a thing, some things or a box; or the whole drawing again */
|
|
65
|
+
get camera(): CameraVerbs<this>;
|
|
66
|
+
/** a sequence in this one: a clock of its own, from `from` */
|
|
67
|
+
sequence(name: string | undefined, o?: SequenceOptions, fill?: (b: NodesBuilder) => unknown): this;
|
|
68
|
+
/** sequences one after another */
|
|
69
|
+
series(fill: (s: SeriesBuilder) => unknown): this;
|
|
70
|
+
/** nodes over one another */
|
|
71
|
+
layers(fill: (b: NodesBuilder) => unknown): this;
|
|
72
|
+
}
|
|
73
|
+
export declare class SeriesBuilder {
|
|
74
|
+
/** @internal */
|
|
75
|
+
readonly items: SeriesItem[];
|
|
76
|
+
sequence(name: string | undefined, o?: SequenceOptions, fill?: (b: NodesBuilder) => unknown): this;
|
|
77
|
+
transition(t: Transition): this;
|
|
78
|
+
}
|
|
79
|
+
export declare class MotionBuilder extends SeriesBuilder {
|
|
80
|
+
private over;
|
|
81
|
+
private marks;
|
|
82
|
+
private head;
|
|
83
|
+
constructor(head?: {
|
|
84
|
+
fps?: number;
|
|
85
|
+
seed?: number;
|
|
86
|
+
ambient?: 'on' | 'off';
|
|
87
|
+
});
|
|
88
|
+
/** a beat: a sequence with commentary */
|
|
89
|
+
beat(name: string, say: Say, o?: SequenceOptions, fill?: (b: NodesBuilder) => unknown): this;
|
|
90
|
+
/** the whole drawing arrives (a sequence as long as that takes) */
|
|
91
|
+
assemble(o?: Omit<AssembleOptions, 'duration'>, t?: Timing): this;
|
|
92
|
+
/** the whole drawing leaves */
|
|
93
|
+
disassemble(o?: Omit<DisassembleOptions, 'duration'>, t?: Timing): this;
|
|
94
|
+
/** a name for a moment: ms, or "beat+1200" */
|
|
95
|
+
mark(name: string, at: MotionTime): this;
|
|
96
|
+
/** nodes over the whole document, on its own clock */
|
|
97
|
+
layers(fill: (b: NodesBuilder) => unknown): this;
|
|
98
|
+
toJSON(): MotionDoc;
|
|
99
|
+
}
|
|
100
|
+
/** Start a motion document. */
|
|
101
|
+
export declare const motion: (head?: {
|
|
102
|
+
fps?: number;
|
|
103
|
+
seed?: number;
|
|
104
|
+
ambient?: 'on' | 'off';
|
|
105
|
+
}) => MotionBuilder;
|