@bydiorama/motion 0.0.0-stage → 0.4.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/CREDITS.md +62 -0
- package/LICENSE +21 -0
- package/README.md +142 -2
- package/catalog.json +4697 -0
- package/dist/npm/brief/brief.d.ts +28 -0
- package/dist/npm/brief/brief.js +159 -0
- package/dist/npm/brief/types.d.ts +75 -0
- package/dist/npm/brief/types.js +2 -0
- package/dist/npm/browser/motion.js +1039 -0
- package/dist/npm/browser/page.js +4821 -0
- package/dist/npm/browser/wizard.js +1511 -0
- package/dist/npm/build/design.d.ts +54 -0
- package/dist/npm/build/design.js +91 -0
- package/dist/npm/build/index.d.ts +39 -0
- package/dist/npm/build/index.js +66 -0
- package/dist/npm/build/iso.d.ts +41 -0
- package/dist/npm/build/iso.js +71 -0
- package/dist/npm/catalog.d.ts +24 -0
- package/dist/npm/catalog.js +23 -0
- package/dist/npm/cli/browser.d.ts +26 -0
- package/dist/npm/cli/browser.js +66 -0
- package/dist/npm/cli/capture.d.ts +26 -0
- package/dist/npm/cli/capture.js +94 -0
- package/dist/npm/cli/files.d.ts +14 -0
- package/dist/npm/cli/files.js +87 -0
- package/dist/npm/cli/frames.d.ts +27 -0
- package/dist/npm/cli/frames.js +125 -0
- package/dist/npm/cli/guard.d.ts +23 -0
- package/dist/npm/cli/guard.js +158 -0
- package/dist/npm/cli/library.d.ts +2 -0
- package/dist/npm/cli/library.js +55 -0
- package/dist/npm/cli/main.d.ts +17 -0
- package/dist/npm/cli/main.js +964 -0
- package/dist/npm/cli/motion.d.ts +2 -0
- package/dist/npm/cli/motion.js +6 -0
- package/dist/npm/cli/record.d.ts +36 -0
- package/dist/npm/cli/record.js +142 -0
- package/dist/npm/cli/review.d.ts +45 -0
- package/dist/npm/cli/review.js +139 -0
- package/dist/npm/cli/schema.d.ts +852 -0
- package/dist/npm/cli/schema.js +120 -0
- package/dist/npm/cli/server.d.ts +17 -0
- package/dist/npm/cli/server.js +135 -0
- package/dist/npm/core/ease.d.ts +39 -0
- package/dist/npm/core/ease.js +176 -0
- package/dist/npm/core/frame.d.ts +52 -0
- package/dist/npm/core/frame.js +60 -0
- package/dist/npm/core/shapes.d.ts +8 -0
- package/dist/npm/core/shapes.js +88 -0
- package/dist/npm/core/stagger.d.ts +19 -0
- package/dist/npm/core/stagger.js +77 -0
- package/dist/npm/core/tap.d.ts +19 -0
- package/dist/npm/core/tap.js +42 -0
- package/dist/npm/core/track.d.ts +4 -0
- package/dist/npm/core/track.js +23 -0
- package/dist/npm/dom/mount.d.ts +127 -0
- package/dist/npm/dom/mount.js +950 -0
- package/dist/npm/dom/page.d.ts +37 -0
- package/dist/npm/dom/page.js +77 -0
- package/dist/npm/dom/soundtrack.d.ts +13 -0
- package/dist/npm/dom/soundtrack.js +37 -0
- package/dist/npm/dom/stage.css.d.ts +1 -0
- package/dist/npm/dom/stage.css.js +44 -0
- package/dist/npm/dom/tokens.d.ts +10 -0
- package/dist/npm/dom/tokens.js +38 -0
- package/dist/npm/dom/ui-themes.css.d.ts +8 -0
- package/dist/npm/dom/ui-themes.css.js +9 -0
- package/dist/npm/film/beats.d.ts +64 -0
- package/dist/npm/film/beats.js +282 -0
- package/dist/npm/film/pace.d.ts +94 -0
- package/dist/npm/film/pace.js +396 -0
- package/dist/npm/film/resolve.d.ts +16 -0
- package/dist/npm/film/resolve.js +997 -0
- package/dist/npm/film/tempo.d.ts +19 -0
- package/dist/npm/film/tempo.js +34 -0
- package/dist/npm/film/tune.d.ts +17 -0
- package/dist/npm/film/tune.js +68 -0
- package/dist/npm/film/types.d.ts +416 -0
- package/dist/npm/film/types.js +16 -0
- package/dist/npm/index.d.ts +18 -0
- package/dist/npm/index.js +11 -0
- package/dist/npm/primitives/blur.d.ts +14 -0
- package/dist/npm/primitives/blur.js +59 -0
- package/dist/npm/primitives/canvas.d.ts +5 -0
- package/dist/npm/primitives/canvas.js +13 -0
- package/dist/npm/primitives/el/box.d.ts +2 -0
- package/dist/npm/primitives/el/box.js +24 -0
- package/dist/npm/primitives/el/frames.d.ts +15 -0
- package/dist/npm/primitives/el/frames.js +71 -0
- package/dist/npm/primitives/el/html.d.ts +2 -0
- package/dist/npm/primitives/el/html.js +14 -0
- package/dist/npm/primitives/el/image.d.ts +2 -0
- package/dist/npm/primitives/el/image.js +43 -0
- package/dist/npm/primitives/el/slot.d.ts +2 -0
- package/dist/npm/primitives/el/slot.js +25 -0
- package/dist/npm/primitives/el/text.d.ts +2 -0
- package/dist/npm/primitives/el/text.js +13 -0
- package/dist/npm/primitives/el/video.d.ts +6 -0
- package/dist/npm/primitives/el/video.js +179 -0
- package/dist/npm/primitives/fx/counter-roll.d.ts +2 -0
- package/dist/npm/primitives/fx/counter-roll.js +32 -0
- package/dist/npm/primitives/fx/depth-drift.d.ts +2 -0
- package/dist/npm/primitives/fx/depth-drift.js +44 -0
- package/dist/npm/primitives/fx/grid-ripple.d.ts +2 -0
- package/dist/npm/primitives/fx/grid-ripple.js +59 -0
- package/dist/npm/primitives/fx/odometer.d.ts +2 -0
- package/dist/npm/primitives/fx/odometer.js +80 -0
- package/dist/npm/primitives/fx/pan-across.d.ts +17 -0
- package/dist/npm/primitives/fx/pan-across.js +76 -0
- package/dist/npm/primitives/fx/path-draw.d.ts +2 -0
- package/dist/npm/primitives/fx/path-draw.js +105 -0
- package/dist/npm/primitives/fx/pin-drop.d.ts +2 -0
- package/dist/npm/primitives/fx/pin-drop.js +92 -0
- package/dist/npm/primitives/fx/shape-morph.d.ts +2 -0
- package/dist/npm/primitives/fx/shape-morph.js +65 -0
- package/dist/npm/primitives/fx/slow-push.d.ts +13 -0
- package/dist/npm/primitives/fx/slow-push.js +56 -0
- package/dist/npm/primitives/fx/stagger-fill.d.ts +2 -0
- package/dist/npm/primitives/fx/stagger-fill.js +33 -0
- package/dist/npm/primitives/index.d.ts +4 -0
- package/dist/npm/primitives/index.js +78 -0
- package/dist/npm/primitives/rig/browser-window.d.ts +2 -0
- package/dist/npm/primitives/rig/browser-window.js +142 -0
- package/dist/npm/primitives/rig/camera.d.ts +36 -0
- package/dist/npm/primitives/rig/camera.js +81 -0
- package/dist/npm/primitives/rig/footage-plane.d.ts +27 -0
- package/dist/npm/primitives/rig/footage-plane.js +257 -0
- package/dist/npm/primitives/rig/layer-stack.d.ts +39 -0
- package/dist/npm/primitives/rig/layer-stack.js +276 -0
- package/dist/npm/primitives/rig/orbit-ring.d.ts +2 -0
- package/dist/npm/primitives/rig/orbit-ring.js +59 -0
- package/dist/npm/primitives/rig/tab-stack.d.ts +9 -0
- package/dist/npm/primitives/rig/tab-stack.js +143 -0
- package/dist/npm/primitives/scene/bar-chart.d.ts +2 -0
- package/dist/npm/primitives/scene/bar-chart.js +83 -0
- package/dist/npm/primitives/scene/bento-grid.d.ts +49 -0
- package/dist/npm/primitives/scene/bento-grid.js +293 -0
- package/dist/npm/primitives/scene/grid-wall.d.ts +18 -0
- package/dist/npm/primitives/scene/grid-wall.js +110 -0
- package/dist/npm/primitives/scene/line-chart.d.ts +2 -0
- package/dist/npm/primitives/scene/line-chart.js +121 -0
- package/dist/npm/primitives/scene/logo-reveal.d.ts +2 -0
- package/dist/npm/primitives/scene/logo-reveal.js +117 -0
- package/dist/npm/primitives/scene/marquee-wall.d.ts +2 -0
- package/dist/npm/primitives/scene/marquee-wall.js +82 -0
- package/dist/npm/primitives/scene/post-carousel.d.ts +16 -0
- package/dist/npm/primitives/scene/post-carousel.js +195 -0
- package/dist/npm/primitives/scene/strip-cycle.d.ts +49 -0
- package/dist/npm/primitives/scene/strip-cycle.js +237 -0
- package/dist/npm/primitives/split.d.ts +34 -0
- package/dist/npm/primitives/split.js +105 -0
- package/dist/npm/primitives/texture/beat-field.d.ts +13 -0
- package/dist/npm/primitives/texture/beat-field.js +113 -0
- package/dist/npm/primitives/texture/gradient-drift.d.ts +2 -0
- package/dist/npm/primitives/texture/gradient-drift.js +56 -0
- package/dist/npm/primitives/texture/grain.d.ts +2 -0
- package/dist/npm/primitives/texture/grain.js +54 -0
- package/dist/npm/primitives/texture/halftone-field.d.ts +2 -0
- package/dist/npm/primitives/texture/halftone-field.js +36 -0
- package/dist/npm/primitives/texture/signal-field.d.ts +4 -0
- package/dist/npm/primitives/texture/signal-field.js +107 -0
- package/dist/npm/primitives/texture/vignette.d.ts +2 -0
- package/dist/npm/primitives/texture/vignette.js +23 -0
- package/dist/npm/primitives/transition/band-sweep.d.ts +22 -0
- package/dist/npm/primitives/transition/band-sweep.js +111 -0
- package/dist/npm/primitives/transition/beat-cut.d.ts +2 -0
- package/dist/npm/primitives/transition/beat-cut.js +10 -0
- package/dist/npm/primitives/transition/blur-dissolve.d.ts +2 -0
- package/dist/npm/primitives/transition/blur-dissolve.js +28 -0
- package/dist/npm/primitives/transition/camera-travel.d.ts +2 -0
- package/dist/npm/primitives/transition/camera-travel.js +69 -0
- package/dist/npm/primitives/transition/cover-reveal.d.ts +2 -0
- package/dist/npm/primitives/transition/cover-reveal.js +52 -0
- package/dist/npm/primitives/transition/curtain.d.ts +2 -0
- package/dist/npm/primitives/transition/curtain.js +40 -0
- package/dist/npm/primitives/transition/dive-in.d.ts +2 -0
- package/dist/npm/primitives/transition/dive-in.js +52 -0
- package/dist/npm/primitives/transition/fly-past.d.ts +2 -0
- package/dist/npm/primitives/transition/fly-past.js +87 -0
- package/dist/npm/primitives/transition/iris.d.ts +2 -0
- package/dist/npm/primitives/transition/iris.js +38 -0
- package/dist/npm/primitives/transition/overlay.d.ts +4 -0
- package/dist/npm/primitives/transition/overlay.js +24 -0
- package/dist/npm/primitives/transition/push.d.ts +2 -0
- package/dist/npm/primitives/transition/push.js +35 -0
- package/dist/npm/primitives/transition/signal-wipe.d.ts +2 -0
- package/dist/npm/primitives/transition/signal-wipe.js +67 -0
- package/dist/npm/primitives/transition/slant-wipe.d.ts +2 -0
- package/dist/npm/primitives/transition/slant-wipe.js +30 -0
- package/dist/npm/primitives/transition/stack-over.d.ts +2 -0
- package/dist/npm/primitives/transition/stack-over.js +38 -0
- package/dist/npm/primitives/transition/step-wipe.d.ts +2 -0
- package/dist/npm/primitives/transition/step-wipe.js +29 -0
- package/dist/npm/primitives/transition/strip-wipe.d.ts +40 -0
- package/dist/npm/primitives/transition/strip-wipe.js +121 -0
- package/dist/npm/primitives/transition/whip-pan.d.ts +2 -0
- package/dist/npm/primitives/transition/whip-pan.js +45 -0
- package/dist/npm/primitives/type/block-reveal.d.ts +2 -0
- package/dist/npm/primitives/type/block-reveal.js +61 -0
- package/dist/npm/primitives/type/char-cascade.d.ts +2 -0
- package/dist/npm/primitives/type/char-cascade.js +45 -0
- package/dist/npm/primitives/type/echo.d.ts +2 -0
- package/dist/npm/primitives/type/echo.js +57 -0
- package/dist/npm/primitives/type/fill-text.d.ts +14 -0
- package/dist/npm/primitives/type/fill-text.js +82 -0
- package/dist/npm/primitives/type/mask-reveal.d.ts +2 -0
- package/dist/npm/primitives/type/mask-reveal.js +58 -0
- package/dist/npm/primitives/type/scramble.d.ts +2 -0
- package/dist/npm/primitives/type/scramble.js +34 -0
- package/dist/npm/primitives/type/scribble-highlight.d.ts +2 -0
- package/dist/npm/primitives/type/scribble-highlight.js +84 -0
- package/dist/npm/primitives/type/shimmer.d.ts +2 -0
- package/dist/npm/primitives/type/shimmer.js +35 -0
- package/dist/npm/primitives/type/tracking-in.d.ts +2 -0
- package/dist/npm/primitives/type/tracking-in.js +37 -0
- package/dist/npm/primitives/type/typed-title.d.ts +2 -0
- package/dist/npm/primitives/type/typed-title.js +33 -0
- package/dist/npm/primitives/type/word-build.d.ts +2 -0
- package/dist/npm/primitives/type/word-build.js +44 -0
- package/dist/npm/primitives/type/word-roller.d.ts +2 -0
- package/dist/npm/primitives/type/word-roller.js +80 -0
- package/dist/npm/primitives/types.d.ts +183 -0
- package/dist/npm/primitives/types.js +5 -0
- package/dist/npm/primitives/ui/cursor-click.d.ts +4 -0
- package/dist/npm/primitives/ui/cursor-click.js +68 -0
- package/dist/npm/primitives/ui/page-scroll.d.ts +17 -0
- package/dist/npm/primitives/ui/page-scroll.js +98 -0
- package/dist/npm/review/fft.d.ts +4 -0
- package/dist/npm/review/fft.js +71 -0
- package/dist/npm/review/measure.d.ts +170 -0
- package/dist/npm/review/measure.js +577 -0
- package/dist/npm/tokens.d.ts +50 -0
- package/dist/npm/tokens.js +49 -0
- package/dist/npm/version.d.ts +1 -0
- package/dist/npm/version.js +1 -0
- package/examples/builder.film.mjs +18 -0
- package/films/feature-announcement.film.json +70 -0
- package/library/narratives/app-demo.md +64 -0
- package/library/narratives/brand-identity.md +78 -0
- package/library/narratives/capability-through-type.md +53 -0
- package/library/narratives/data-story.md +59 -0
- package/library/narratives/explainer.md +64 -0
- package/library/narratives/feature-announcement.md +68 -0
- package/library/narratives/infinite-loop.md +28 -0
- package/library/narratives/platform-launch.md +81 -0
- package/library/narratives/social-teaser.md +45 -0
- package/library/narratives/title-sequence.md +55 -0
- package/library/narratives/website-launch.md +65 -0
- package/library/primitives/fx/card-arrangements.md +26 -0
- package/library/primitives/fx/counter-roll.md +27 -0
- package/library/primitives/fx/depth-drift.md +32 -0
- package/library/primitives/fx/grid-ripple.md +58 -0
- package/library/primitives/fx/letter-interleave.md +26 -0
- package/library/primitives/fx/marquee-highlight.md +27 -0
- package/library/primitives/fx/mosaic-fill.md +23 -0
- package/library/primitives/fx/odometer.md +44 -0
- package/library/primitives/fx/pan-across.md +63 -0
- package/library/primitives/fx/path-draw.md +54 -0
- package/library/primitives/fx/pin-drop.md +51 -0
- package/library/primitives/fx/radial-burst.md +33 -0
- package/library/primitives/fx/shape-morph.md +45 -0
- package/library/primitives/fx/slow-push.md +63 -0
- package/library/primitives/fx/stagger-fill.md +28 -0
- package/library/primitives/rig/browser-window.md +113 -0
- package/library/primitives/rig/flip-ticker.md +26 -0
- package/library/primitives/rig/footage-plane.md +90 -0
- package/library/primitives/rig/layer-stack.md +168 -0
- package/library/primitives/rig/orbit-ring.md +43 -0
- package/library/primitives/rig/rolodex.md +31 -0
- package/library/primitives/rig/tab-stack.md +116 -0
- package/library/primitives/rig/tumbling-object.md +27 -0
- package/library/primitives/scene/bar-chart.md +49 -0
- package/library/primitives/scene/bento-grid.md +74 -0
- package/library/primitives/scene/end-card.md +28 -0
- package/library/primitives/scene/grid-wall.md +61 -0
- package/library/primitives/scene/hero-object.md +33 -0
- package/library/primitives/scene/kinetic-headline.md +34 -0
- package/library/primitives/scene/line-chart.md +47 -0
- package/library/primitives/scene/logo-reveal.md +53 -0
- package/library/primitives/scene/marquee-wall.md +33 -0
- package/library/primitives/scene/mosaic.md +28 -0
- package/library/primitives/scene/post-carousel.md +68 -0
- package/library/primitives/scene/specimen-grid.md +28 -0
- package/library/primitives/scene/stat-with-evidence.md +34 -0
- package/library/primitives/scene/strip-cycle.md +122 -0
- package/library/primitives/scene/zoomed-ui.md +29 -0
- package/library/primitives/texture/ascii.md +22 -0
- package/library/primitives/texture/beat-field.md +85 -0
- package/library/primitives/texture/depth-fade.md +23 -0
- package/library/primitives/texture/dither.md +27 -0
- package/library/primitives/texture/gradient-drift.md +50 -0
- package/library/primitives/texture/grain.md +39 -0
- package/library/primitives/texture/halftone-field.md +26 -0
- package/library/primitives/texture/signal-field.md +61 -0
- package/library/primitives/texture/vignette.md +53 -0
- package/library/primitives/transition/band-sweep.md +63 -0
- package/library/primitives/transition/beat-cut.md +27 -0
- package/library/primitives/transition/blur-dissolve.md +36 -0
- package/library/primitives/transition/camera-travel.md +57 -0
- package/library/primitives/transition/collapse-to-anchor.md +27 -0
- package/library/primitives/transition/cover-reveal.md +47 -0
- package/library/primitives/transition/curtain.md +42 -0
- package/library/primitives/transition/dive-in.md +51 -0
- package/library/primitives/transition/fly-past.md +51 -0
- package/library/primitives/transition/iris.md +49 -0
- package/library/primitives/transition/layout-locked-swap.md +28 -0
- package/library/primitives/transition/light-dark-flip.md +27 -0
- package/library/primitives/transition/push.md +47 -0
- package/library/primitives/transition/signal-wipe.md +52 -0
- package/library/primitives/transition/slant-wipe.md +44 -0
- package/library/primitives/transition/stack-over.md +51 -0
- package/library/primitives/transition/step-wipe.md +32 -0
- package/library/primitives/transition/strip-wipe.md +80 -0
- package/library/primitives/transition/torn-edge.md +26 -0
- package/library/primitives/transition/whip-pan.md +47 -0
- package/library/primitives/transition/zoom-through-letter.md +27 -0
- package/library/primitives/type/accent-number.md +22 -0
- package/library/primitives/type/block-reveal.md +41 -0
- package/library/primitives/type/char-cascade.md +65 -0
- package/library/primitives/type/echo.md +44 -0
- package/library/primitives/type/fill-text.md +63 -0
- package/library/primitives/type/focus-blur.md +22 -0
- package/library/primitives/type/inline-chips.md +27 -0
- package/library/primitives/type/mask-reveal.md +65 -0
- package/library/primitives/type/parting.md +23 -0
- package/library/primitives/type/per-word-restyle.md +28 -0
- package/library/primitives/type/scramble.md +26 -0
- package/library/primitives/type/scribble-highlight.md +47 -0
- package/library/primitives/type/shimmer.md +39 -0
- package/library/primitives/type/split-flap.md +26 -0
- package/library/primitives/type/style-multiply.md +23 -0
- package/library/primitives/type/tracking-in.md +40 -0
- package/library/primitives/type/typed-title.md +27 -0
- package/library/primitives/type/word-build.md +37 -0
- package/library/primitives/type/word-roller.md +52 -0
- package/library/primitives/type/writing-ticker.md +27 -0
- package/library/primitives/ui/collab-cursors.md +27 -0
- package/library/primitives/ui/cursor-click.md +61 -0
- package/library/primitives/ui/page-scroll.md +58 -0
- package/library/primitives/ui/prompt-typing.md +29 -0
- package/library/primitives/ui/streamed-result.md +23 -0
- package/library/primitives/ui/tour-hold.md +27 -0
- package/library/styles/brand-system.md +49 -0
- package/library/styles/clean-explainer.md +42 -0
- package/library/styles/dark-showcase.md +48 -0
- package/library/styles/editorial-type.md +37 -0
- package/library/styles/kinetic-poster.md +54 -0
- package/library/styles/product-ui.md +44 -0
- package/library/styles/studio-loop.md +41 -0
- package/library.json +1467 -0
- package/package.json +64 -4
- package/schema/film.schema.json +1316 -0
- package/showcase/vendor/DIALKIT-LICENSE +21 -0
- package/src/studio/theme/fonts/OFL.txt +94 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Catalog } from '../catalog.ts';
|
|
2
|
+
import type { Answers, Feel, Format, Library, LibraryNarrative } from './types.ts';
|
|
3
|
+
export declare const FORMATS: Record<Format, {
|
|
4
|
+
size: [number, number];
|
|
5
|
+
label: string;
|
|
6
|
+
}>;
|
|
7
|
+
/** How a feel changes the film's timing tokens. Crisp is the library default. */
|
|
8
|
+
export declare const FEELS: Record<Feel, {
|
|
9
|
+
label: string;
|
|
10
|
+
summary: string;
|
|
11
|
+
tokens: Record<string, unknown>;
|
|
12
|
+
}>;
|
|
13
|
+
export interface Beat {
|
|
14
|
+
name: string;
|
|
15
|
+
start: number;
|
|
16
|
+
end: number;
|
|
17
|
+
content: string;
|
|
18
|
+
moves: string[];
|
|
19
|
+
}
|
|
20
|
+
/** The narrative's beats laid over the chosen length. The last beat takes the rounding. */
|
|
21
|
+
export declare function beats(narrative: LibraryNarrative, duration: number): Beat[];
|
|
22
|
+
export interface BriefContext {
|
|
23
|
+
catalog: Catalog;
|
|
24
|
+
library: Library;
|
|
25
|
+
}
|
|
26
|
+
/** Answers that point at nothing, before a brief is written. Empty when they are fine. */
|
|
27
|
+
export declare function checkAnswers(a: Answers, { library }: BriefContext): string[];
|
|
28
|
+
export declare function writeBrief(a: Answers, ctx: BriefContext): string;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
export const FORMATS = {
|
|
2
|
+
'16:9': { size: [1920, 1080], label: 'Landscape' },
|
|
3
|
+
'1:1': { size: [1080, 1080], label: 'Square' },
|
|
4
|
+
'4:5': { size: [1080, 1350], label: 'Portrait' },
|
|
5
|
+
'9:16': { size: [1080, 1920], label: 'Vertical' },
|
|
6
|
+
};
|
|
7
|
+
/** How a feel changes the film's timing tokens. Crisp is the library default. */
|
|
8
|
+
export const FEELS = {
|
|
9
|
+
calm: {
|
|
10
|
+
label: 'Calm', summary: 'Slow, soft arrivals and long holds. Lets the message breathe.',
|
|
11
|
+
tokens: { duration: { base: 0.8, slow: 1.2 }, stagger: { base: 0.12 }, ease_enter: 'sine.out', hold: 1, transitions: 'calm' },
|
|
12
|
+
},
|
|
13
|
+
crisp: {
|
|
14
|
+
label: 'Crisp', summary: 'Fast arrivals that settle precisely. The library default.',
|
|
15
|
+
tokens: { duration: { base: 0.5, slow: 0.8 }, stagger: { base: 0.08 }, ease_enter: 'expo.out', hold: 0.6 },
|
|
16
|
+
},
|
|
17
|
+
lively: {
|
|
18
|
+
label: 'Lively', summary: 'Quick, springy, a little overshoot. For social and launches.',
|
|
19
|
+
tokens: { duration: { base: 0.4, slow: 0.6 }, stagger: { base: 0.05 }, ease_enter: { spring: { duration: 0.4, bounce: 0.3 } }, hold: 0.4 },
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
const title = (slug) => {
|
|
23
|
+
const name = slug.split('/').pop() ?? slug;
|
|
24
|
+
return name.charAt(0).toUpperCase() + name.slice(1).replace(/-/g, ' ');
|
|
25
|
+
};
|
|
26
|
+
const fps = 60;
|
|
27
|
+
/** Seconds, snapped to whole frames and printed without float noise. */
|
|
28
|
+
const sec = (n) => `${Number((Math.round(n * fps) / fps).toFixed(2))} s`;
|
|
29
|
+
const lines = (text) => (text ?? '').split('\n').map((l) => l.trim()).filter(Boolean);
|
|
30
|
+
/** The narrative's beats laid over the chosen length. The last beat takes the rounding. */
|
|
31
|
+
export function beats(narrative, duration) {
|
|
32
|
+
let at = 0;
|
|
33
|
+
return narrative.beats.map((b, i, all) => {
|
|
34
|
+
const end = i === all.length - 1 ? duration : at + Math.round((duration * b.share) / 100 * 10) / 10;
|
|
35
|
+
const beat = { name: b.name, start: at, end, content: b.content, moves: b.primitives };
|
|
36
|
+
at = end;
|
|
37
|
+
return beat;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/** Answers that point at nothing, before a brief is written. Empty when they are fine. */
|
|
41
|
+
export function checkAnswers(a, { library }) {
|
|
42
|
+
const problems = [];
|
|
43
|
+
const narrative = library.narratives.find((n) => n.slug === a.type);
|
|
44
|
+
if (!narrative)
|
|
45
|
+
problems.push(`Unknown video type "${a.type}". Known: ${library.narratives.map((n) => n.slug).join(', ')}`);
|
|
46
|
+
if (!library.styles.some((s) => s.slug === a.style))
|
|
47
|
+
problems.push(`Unknown look "${a.style}". Known: ${library.styles.map((s) => s.slug).join(', ')}`);
|
|
48
|
+
if (!(a.feel in FEELS))
|
|
49
|
+
problems.push(`Unknown feel "${a.feel}". Known: ${Object.keys(FEELS).join(', ')}`);
|
|
50
|
+
if (!a.formats.length)
|
|
51
|
+
problems.push('Pick at least one format.');
|
|
52
|
+
for (const f of a.formats)
|
|
53
|
+
if (!(f in FORMATS))
|
|
54
|
+
problems.push(`Unknown format "${f}". Known: ${Object.keys(FORMATS).join(', ')}`);
|
|
55
|
+
if (!a.subject.trim())
|
|
56
|
+
problems.push('Say what the video is about.');
|
|
57
|
+
if (!a.message.trim())
|
|
58
|
+
problems.push('Say the one thing a viewer should remember.');
|
|
59
|
+
if (!(a.duration > 0))
|
|
60
|
+
problems.push('The length must be a number of seconds.');
|
|
61
|
+
return problems;
|
|
62
|
+
}
|
|
63
|
+
export function writeBrief(a, ctx) {
|
|
64
|
+
const problems = checkAnswers(a, ctx);
|
|
65
|
+
if (problems.length)
|
|
66
|
+
throw new Error(problems.join('\n'));
|
|
67
|
+
const { catalog, library } = ctx;
|
|
68
|
+
const narrative = library.narratives.find((n) => n.slug === a.type);
|
|
69
|
+
const style = library.styles.find((s) => s.slug === a.style);
|
|
70
|
+
const feel = FEELS[a.feel];
|
|
71
|
+
const runtime = new Map([...catalog.primitives, ...catalog.transitions].map((p) => [p.slug, p]));
|
|
72
|
+
const entry = new Map(library.primitives.map((p) => [p.slug, p]));
|
|
73
|
+
const formats = [...a.formats].sort((x, y) => Object.keys(FORMATS).indexOf(x) - Object.keys(FORMATS).indexOf(y));
|
|
74
|
+
const [w, h] = FORMATS[formats[0]].size;
|
|
75
|
+
const story = beats(narrative, a.duration);
|
|
76
|
+
// Moves: what the story and the look suggest, plus what the person picked, in a stable order.
|
|
77
|
+
const wanted = [...new Set([...story.flatMap((b) => b.moves), ...style.uses, ...(a.moves ?? [])])].filter((s) => !style.avoids.includes(s));
|
|
78
|
+
const drawable = wanted.filter((s) => runtime.has(s)).sort();
|
|
79
|
+
const missing = wanted.filter((s) => !runtime.has(s)).sort();
|
|
80
|
+
const describe = (slug) => {
|
|
81
|
+
const p = runtime.get(slug);
|
|
82
|
+
const params = Object.entries(p.params)
|
|
83
|
+
.map(([k, s]) => `${k} ${JSON.stringify(s.default)}${s.min !== undefined ? ` (${s.min}–${s.max}${s.unit ? ` ${s.unit}` : ''})` : ''}`);
|
|
84
|
+
const props = 'props' in p ? Object.keys(p.props) : [];
|
|
85
|
+
return `- \`${slug}\`: ${p.summary}${props.length ? ` Props: ${props.join(', ')}.` : ''}${params.length ? ` Params: ${params.join(', ')}.` : ''}`;
|
|
86
|
+
};
|
|
87
|
+
const tokens = { beat: style.beat ?? catalog.tokens.beat, ...(style.transitions ? { transitions: style.transitions } : {}), ...feel.tokens };
|
|
88
|
+
const theme = { ...(a.scheme ? { scheme: a.scheme } : {}), ...(a.accent ? { accent: a.accent } : {}) };
|
|
89
|
+
const sizeNote = formats.length > 1
|
|
90
|
+
? `Make the ${formats[0]} film first. Then make one film per other format (${formats.slice(1).map((f) => `${f} at ${FORMATS[f].size.join('×')}`).join(', ')}) with the same scenes, re-laid for the frame, not cropped.`
|
|
91
|
+
: '';
|
|
92
|
+
const outOfRange = a.duration < narrative.duration.min || a.duration > narrative.duration.max;
|
|
93
|
+
const out = [];
|
|
94
|
+
const push = (...l) => out.push(...l);
|
|
95
|
+
push(`# Motion brief: ${a.subject.trim()}`, '');
|
|
96
|
+
push(a.target === 'agent'
|
|
97
|
+
? 'You are directing a short motion video with the bydiorama motion library, in its repository. You write the film as JSON; the runtime draws, checks and renders it. A person will tune it afterwards in the studio and leave notes for you.'
|
|
98
|
+
: 'You are directing a short motion video for the bydiorama motion library. You cannot run it: write the film as JSON exactly as described below, and the person will paste it into the library to preview, tune and render it.', '');
|
|
99
|
+
push('## The video', '');
|
|
100
|
+
push(`- Type: ${title(narrative.slug)}. ${narrative.summary}`);
|
|
101
|
+
push(`- Look: ${title(style.slug)}. ${style.summary}${style.character ? ` ${style.character}` : ''}`);
|
|
102
|
+
push(`- Feel: ${feel.label}. ${feel.summary}`);
|
|
103
|
+
push(`- Length: ${sec(a.duration)} at ${fps} fps.${outOfRange ? ` This type usually runs ${narrative.duration.min}–${narrative.duration.max} s, so compress or stretch the beats to fit.` : ''}`);
|
|
104
|
+
push(`- Formats: ${formats.map((f) => `${f} (${FORMATS[f].size.join('×')})`).join(', ')}.${sizeNote ? ` ${sizeNote}` : ''}`);
|
|
105
|
+
if (Object.keys(theme).length)
|
|
106
|
+
push(`- Brand: ${[a.scheme ? `${a.scheme} scheme` : '', a.accent ? `accent ${a.accent}` : ''].filter(Boolean).join(', ')}. Use the accent once per scene at most.`);
|
|
107
|
+
push('');
|
|
108
|
+
push('## What it says', '');
|
|
109
|
+
push(`- About: ${a.subject.trim()}`, `- Remember: ${a.message.trim()}`);
|
|
110
|
+
if (a.intent.trim())
|
|
111
|
+
push(`- Afterwards the viewer should: ${a.intent.trim()}`);
|
|
112
|
+
if (a.audience?.trim())
|
|
113
|
+
push(`- Audience: ${a.audience.trim()}`);
|
|
114
|
+
const content = lines(a.content);
|
|
115
|
+
if (content.length)
|
|
116
|
+
push('- Use this content, word for word where it is quoted:', ...content.map((l) => ` - ${l}`));
|
|
117
|
+
if (a.avoid?.trim())
|
|
118
|
+
push(`- Avoid: ${a.avoid.trim()}`);
|
|
119
|
+
push('- Every word on screen must be short enough to read twice in the time it stays.', '');
|
|
120
|
+
push('## Story', '', '| # | Beat | Time | What happens | Suggested moves |', '|---|---|---|---|---|');
|
|
121
|
+
story.forEach((b, i) => push(`| ${i + 1} | ${b.name} | ${sec(b.start)}–${sec(b.end)} | ${b.content} | ${b.moves.map((m) => `\`${m}\``).join(', ') || '–'} |`));
|
|
122
|
+
push('', 'One scene per beat is a good start; merge beats that are shorter than 1.5 s. Scenes hand over with a transition (`out`), and the overlap counts toward both.', '');
|
|
123
|
+
push('## Moves', '', 'Drawable now (use these slugs in `use`):', '');
|
|
124
|
+
push(...drawable.map(describe));
|
|
125
|
+
const basics = [...runtime.keys()].filter((s) => s.startsWith('el/')).sort();
|
|
126
|
+
push(`- Plain elements for anything else: ${basics.map((s) => `\`${s}\``).join(', ')}.`);
|
|
127
|
+
if (missing.length) {
|
|
128
|
+
push('', 'In the library but not drawable yet. Get the effect from the moves above, or say which one you would need:', '');
|
|
129
|
+
push(...missing.map((s) => `- \`${s}\`: ${entry.get(s)?.summary ?? 'no entry yet'}`));
|
|
130
|
+
}
|
|
131
|
+
if (style.avoids.length)
|
|
132
|
+
push('', `Do not use: ${style.avoids.map((s) => `\`${s}\``).join(', ')}.`);
|
|
133
|
+
push('');
|
|
134
|
+
push('## Timing', '', 'Put these in the film\'s `tokens` and refer to them (`"$duration.base"`) instead of writing numbers:', '', '```json', JSON.stringify(tokens, null, 2), '```', '');
|
|
135
|
+
push('## The film', '');
|
|
136
|
+
const skeleton = {
|
|
137
|
+
motion: catalog.motion, title: a.subject.trim(), size: [w, h], fps, narrative: narrative.slug, style: style.slug,
|
|
138
|
+
...(Object.keys(theme).length ? { theme } : {}),
|
|
139
|
+
tokens,
|
|
140
|
+
scenes: story.slice(0, 2).map((b, i) => ({
|
|
141
|
+
id: b.name.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '') || `scene-${i + 1}`,
|
|
142
|
+
intent: b.content,
|
|
143
|
+
layers: [{ id: 'title', use: drawable.find((s) => s.startsWith('type/')) ?? 'el/text', props: { text: i === 0 ? a.message.trim() : '…' }, style: { size: i === 0 ? 'headline' : 'title' } }],
|
|
144
|
+
...(i === 0 ? { out: { use: drawable.find((s) => s.startsWith('transition/')) ?? 'transition/blur-dissolve' } } : {}),
|
|
145
|
+
})),
|
|
146
|
+
};
|
|
147
|
+
push('Start from this shape and complete every beat:', '', '```json', JSON.stringify(skeleton, null, 2), '```', '');
|
|
148
|
+
push('Rules: ids are lowercase with dashes. `props` hold content, `params` hold motion. A layer starts at `at` (seconds, or relative such as `"title.end + 0.2"`). Moves are `enter`/`exit`: `fade`, `rise`, `drop`, `scale`, `blur`, `slide-left`, `slide-right`. Text sizes: `hero`, `headline`, `title`, `body`, `caption`.');
|
|
149
|
+
push('');
|
|
150
|
+
push('## How to deliver', '');
|
|
151
|
+
if (a.target === 'agent') {
|
|
152
|
+
push('1. Read `catalog.json` (every prop, param, ease and token) and `library.json` (styles and narratives). Use the motion-film skill if it is installed.', `2. Write \`films/<name>.film.json\`. Run \`node bin/motion.mjs validate films/<name>.film.json\` and fix every error; the hints name the fix.`, '3. Run `node bin/motion.mjs stills films/<name>.film.json` and look at the contact sheet. Fix text that collides, leaves the frame or cannot be read.', '4. Run `node bin/motion.mjs check films/<name>.film.json`. It must say the frames repeat exactly.', '5. Tell the person to open the studio: `node bin/motion.mjs preview films/<name>.film.json`. Never edit the `.tune.json` file; read its notes with `node bin/motion.mjs notes` and answer them in the film.');
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
push('1. Reply with the complete film as one JSON code block, and nothing else in the block.', '2. Under it, list any beat you could not draw with the moves above and what you would need.', '3. The person saves it as `films/<name>.film.json` and runs `node bin/motion.mjs validate` on it. If they paste errors back, fix exactly those and return the whole film again.');
|
|
156
|
+
}
|
|
157
|
+
push('', '## Done when', '', '- Every beat above is on screen, in order, inside the length.', '- The message is readable for at least 1.5 s.', '- Only drawable moves are used, with params inside their ranges.', '- Nothing leaves the frame by accident, and the last frame can hold as a poster.', '');
|
|
158
|
+
return out.join('\n');
|
|
159
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export interface LibraryStyle {
|
|
2
|
+
slug: string;
|
|
3
|
+
summary: string;
|
|
4
|
+
character: string;
|
|
5
|
+
uses: string[];
|
|
6
|
+
avoids: string[];
|
|
7
|
+
formats: string[];
|
|
8
|
+
duration: {
|
|
9
|
+
min: number;
|
|
10
|
+
max: number;
|
|
11
|
+
};
|
|
12
|
+
/** Seconds per beat, when the style sets its own rhythm. */
|
|
13
|
+
beat?: number | undefined;
|
|
14
|
+
/** "calm" when the look wants quiet transitions. */
|
|
15
|
+
transitions?: 'standard' | 'calm' | undefined;
|
|
16
|
+
}
|
|
17
|
+
export interface LibraryBeat {
|
|
18
|
+
name: string;
|
|
19
|
+
share: number;
|
|
20
|
+
content: string;
|
|
21
|
+
primitives: string[];
|
|
22
|
+
}
|
|
23
|
+
/** What a video is for, as the wizard groups video types. */
|
|
24
|
+
export type Family = 'product' | 'brand' | 'graphics' | 'social';
|
|
25
|
+
export interface LibraryNarrative {
|
|
26
|
+
slug: string;
|
|
27
|
+
summary: string;
|
|
28
|
+
family: Family;
|
|
29
|
+
duration: {
|
|
30
|
+
min: number;
|
|
31
|
+
max: number;
|
|
32
|
+
};
|
|
33
|
+
fits: string[];
|
|
34
|
+
beats: LibraryBeat[];
|
|
35
|
+
}
|
|
36
|
+
export interface LibraryPrimitive {
|
|
37
|
+
slug: string;
|
|
38
|
+
summary: string;
|
|
39
|
+
status: string;
|
|
40
|
+
}
|
|
41
|
+
export interface Library {
|
|
42
|
+
styles: LibraryStyle[];
|
|
43
|
+
narratives: LibraryNarrative[];
|
|
44
|
+
primitives: LibraryPrimitive[];
|
|
45
|
+
}
|
|
46
|
+
export type Feel = 'calm' | 'crisp' | 'lively';
|
|
47
|
+
export type Format = '16:9' | '1:1' | '4:5' | '9:16';
|
|
48
|
+
/** Who reads the brief: an agent working in this repository, or a chat assistant with no tools. */
|
|
49
|
+
export type Target = 'agent' | 'chat';
|
|
50
|
+
/** Everything the wizard asks. The brief is a pure function of this. */
|
|
51
|
+
export interface Answers {
|
|
52
|
+
/** A narrative slug: the kind of video. */
|
|
53
|
+
type: string;
|
|
54
|
+
/** A style slug: the look. */
|
|
55
|
+
style: string;
|
|
56
|
+
feel: Feel;
|
|
57
|
+
/** What the video is about, in a few words. Used as its title. */
|
|
58
|
+
subject: string;
|
|
59
|
+
/** The one thing a viewer should remember. */
|
|
60
|
+
message: string;
|
|
61
|
+
/** What the viewer should feel or do afterwards. */
|
|
62
|
+
intent: string;
|
|
63
|
+
audience?: string;
|
|
64
|
+
/** Lines, numbers and names the video should use, one per line. */
|
|
65
|
+
content?: string;
|
|
66
|
+
avoid?: string;
|
|
67
|
+
/** Seconds. */
|
|
68
|
+
duration: number;
|
|
69
|
+
formats: Format[];
|
|
70
|
+
accent?: string;
|
|
71
|
+
scheme?: 'light' | 'dark';
|
|
72
|
+
/** Primitive slugs the person picked on top of the ones the story suggests. */
|
|
73
|
+
moves?: string[];
|
|
74
|
+
target: Target;
|
|
75
|
+
}
|