@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,88 @@
|
|
|
1
|
+
// Closed shapes as point lists, so any two can be morphed: every shape has the same
|
|
2
|
+
// number of points, spaced evenly along its outline and starting at 12 o'clock,
|
|
3
|
+
// turning clockwise. Pure; a blob takes a seed.
|
|
4
|
+
import { rng } from "./ease.js";
|
|
5
|
+
export const SHAPES = ['circle', 'square', 'squircle', 'triangle', 'diamond', 'hexagon', 'star', 'pill', 'plus', 'blob'];
|
|
6
|
+
/** A polygon outline from corners, on a unit box centred on 0,0. */
|
|
7
|
+
const poly = (corners) => corners;
|
|
8
|
+
const regular = (n, r = 1, turn = 0) => Array.from({ length: n }, (_, i) => {
|
|
9
|
+
const a = -Math.PI / 2 + turn + (i / n) * Math.PI * 2;
|
|
10
|
+
return [Math.cos(a) * r, Math.sin(a) * r];
|
|
11
|
+
});
|
|
12
|
+
/** Points along a closed polyline, evenly spaced by length. */
|
|
13
|
+
function resample(outline, n) {
|
|
14
|
+
const segs = outline.map((p, i) => [p, outline[(i + 1) % outline.length]]);
|
|
15
|
+
const lens = segs.map(([a, b]) => Math.hypot(b[0] - a[0], b[1] - a[1]));
|
|
16
|
+
const total = lens.reduce((x, y) => x + y, 0);
|
|
17
|
+
const out = [];
|
|
18
|
+
let seg = 0, acc = 0;
|
|
19
|
+
for (let i = 0; i < n; i++) {
|
|
20
|
+
const d = (i / n) * total;
|
|
21
|
+
while (seg < segs.length - 1 && acc + lens[seg] < d) {
|
|
22
|
+
acc += lens[seg];
|
|
23
|
+
seg++;
|
|
24
|
+
}
|
|
25
|
+
const [a, b] = segs[seg], k = lens[seg] > 0 ? (d - acc) / lens[seg] : 0;
|
|
26
|
+
out.push([a[0] + (b[0] - a[0]) * k, a[1] + (b[1] - a[1]) * k]);
|
|
27
|
+
}
|
|
28
|
+
return out;
|
|
29
|
+
}
|
|
30
|
+
/** Turns the list so it starts at the point nearest straight up. */
|
|
31
|
+
function startAtTop(pts) {
|
|
32
|
+
let best = 0, bestA = Infinity;
|
|
33
|
+
pts.forEach(([x, y], i) => {
|
|
34
|
+
const a = Math.abs(Math.atan2(x, -y));
|
|
35
|
+
if (a < bestA) {
|
|
36
|
+
bestA = a;
|
|
37
|
+
best = i;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
return [...pts.slice(best), ...pts.slice(0, best)];
|
|
41
|
+
}
|
|
42
|
+
function outline(name, seed) {
|
|
43
|
+
const fine = (f, n = 360) => Array.from({ length: n }, (_, i) => {
|
|
44
|
+
const a = -Math.PI / 2 + (i / n) * Math.PI * 2;
|
|
45
|
+
const r = f(a);
|
|
46
|
+
return [Math.cos(a) * r, Math.sin(a) * r];
|
|
47
|
+
});
|
|
48
|
+
switch (name) {
|
|
49
|
+
case 'square': return poly([[0, -1], [1, -1], [1, 1], [-1, 1], [-1, -1]]);
|
|
50
|
+
case 'squircle': return fine((a) => 1 / Math.pow(Math.pow(Math.abs(Math.cos(a)), 5) + Math.pow(Math.abs(Math.sin(a)), 5), 1 / 5));
|
|
51
|
+
case 'triangle': return regular(3, 1.12, 0).map(([x, y]) => [x, y + 0.14]);
|
|
52
|
+
case 'diamond': return regular(4, 1.1);
|
|
53
|
+
case 'hexagon': return regular(6, 1.04);
|
|
54
|
+
case 'star': return regular(10, 1).map(([x, y], i) => (i % 2 ? [x * 0.46, y * 0.46] : [x * 1.08, y * 1.08]));
|
|
55
|
+
case 'pill': return fine((a) => {
|
|
56
|
+
// A stadium twice as wide as tall.
|
|
57
|
+
const c = Math.cos(a), s = Math.sin(a);
|
|
58
|
+
const r = 0.5, half = 0.5;
|
|
59
|
+
let lo = 0, hi = 2;
|
|
60
|
+
for (let i = 0; i < 30; i++) {
|
|
61
|
+
const m = (lo + hi) / 2, x = c * m, y = s * m;
|
|
62
|
+
const dx = Math.max(0, Math.abs(x) - half);
|
|
63
|
+
if (Math.hypot(dx, y) > r)
|
|
64
|
+
hi = m;
|
|
65
|
+
else
|
|
66
|
+
lo = m;
|
|
67
|
+
}
|
|
68
|
+
return lo * 1.9;
|
|
69
|
+
});
|
|
70
|
+
case 'plus': {
|
|
71
|
+
const w = 0.36;
|
|
72
|
+
return poly([[-w, -1], [w, -1], [w, -w], [1, -w], [1, w], [w, w], [w, 1], [-w, 1], [-w, w], [-1, w], [-1, -w], [-w, -w]]);
|
|
73
|
+
}
|
|
74
|
+
case 'blob': {
|
|
75
|
+
const r = rng(seed * 53 + 11);
|
|
76
|
+
const k = [r(), r(), r(), r()].map((v) => v * Math.PI * 2);
|
|
77
|
+
return fine((a) => 0.9 + 0.08 * Math.sin(2 * a + k[0]) + 0.06 * Math.sin(3 * a + k[1]) + 0.04 * Math.sin(5 * a + k[2]) + 0.02 * Math.sin(7 * a + k[3]));
|
|
78
|
+
}
|
|
79
|
+
default: return fine(() => 1);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/** `n` points around a named shape that fills a box from -1 to 1. */
|
|
83
|
+
export function shapePoints(name, n = 120, seed = 1) {
|
|
84
|
+
return startAtTop(resample(outline(name, seed), n));
|
|
85
|
+
}
|
|
86
|
+
export const lerpPoints = (a, b, k) => a.map(([x, y], i) => [x + (b[i][0] - x) * k, y + (b[i][1] - y) * k]);
|
|
87
|
+
/** SVG path data for a closed point list, scaled by r around cx, cy. */
|
|
88
|
+
export const pointsPath = (pts, cx, cy, r) => `M${pts.map(([x, y]) => `${(cx + x * r).toFixed(2)},${(cy + y * r).toFixed(2)}`).join('L')}Z`;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const STAGGER_FROM: readonly ["start", "end", "center", "edges", "random"];
|
|
2
|
+
export type StaggerFrom = (typeof STAGGER_FROM)[number];
|
|
3
|
+
/**
|
|
4
|
+
* The step at which each of `n` units starts, 0 for the first to go. Units the
|
|
5
|
+
* same distance from the origin share a step, so a stagger from the centre of a
|
|
6
|
+
* line starts its two middle letters together. A `grid` of [columns, rows]
|
|
7
|
+
* measures distance in two dimensions, which turns a stagger into a wave.
|
|
8
|
+
*/
|
|
9
|
+
export declare function staggerSteps(n: number, from?: StaggerFrom | string, seed?: number, grid?: [number, number]): number[];
|
|
10
|
+
/** Steps scaled so the last unit starts at `(span) * stagger` seconds. */
|
|
11
|
+
export declare function staggerDelays(n: number, stagger: number, from?: StaggerFrom | string, seed?: number, grid?: [number, number]): number[];
|
|
12
|
+
/** How many stagger steps the group spans: the last delay divided by the stagger. */
|
|
13
|
+
export declare function staggerSpan(n: number, from?: StaggerFrom | string, seed?: number, grid?: [number, number]): number;
|
|
14
|
+
/**
|
|
15
|
+
* Steps for units at known positions, nearest to `focus` first. Units at the
|
|
16
|
+
* same distance (within `tie` px) share a step, so a symmetric layout opens
|
|
17
|
+
* symmetrically. Works in any unit; positions and focus must share it.
|
|
18
|
+
*/
|
|
19
|
+
export declare function staggerByDistance(points: readonly (readonly [number, number])[], focus: readonly [number, number], tie?: number): number[];
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// Stagger distribution: in what order a group of units starts, and how far apart.
|
|
2
|
+
// Pure, so a primitive's duration can be computed in Node.
|
|
3
|
+
import { rng } from "./ease.js";
|
|
4
|
+
export const STAGGER_FROM = ['start', 'end', 'center', 'edges', 'random'];
|
|
5
|
+
/**
|
|
6
|
+
* The step at which each of `n` units starts, 0 for the first to go. Units the
|
|
7
|
+
* same distance from the origin share a step, so a stagger from the centre of a
|
|
8
|
+
* line starts its two middle letters together. A `grid` of [columns, rows]
|
|
9
|
+
* measures distance in two dimensions, which turns a stagger into a wave.
|
|
10
|
+
*/
|
|
11
|
+
export function staggerSteps(n, from = 'start', seed = 1, grid) {
|
|
12
|
+
if (n <= 0)
|
|
13
|
+
return [];
|
|
14
|
+
if (from === 'random') {
|
|
15
|
+
// A seeded shuffle: every unit gets its own step, in an order that repeats.
|
|
16
|
+
const r = rng(seed * 977 + n);
|
|
17
|
+
const order = Array.from({ length: n }, (_, i) => i);
|
|
18
|
+
for (let i = n - 1; i > 0; i--) {
|
|
19
|
+
const j = Math.floor(r() * (i + 1));
|
|
20
|
+
[order[i], order[j]] = [order[j], order[i]];
|
|
21
|
+
}
|
|
22
|
+
// On a grid, a random order spans as many steps as a wave across it would.
|
|
23
|
+
const scale = grid && n > 1 ? Math.hypot(grid[0] - 1, grid[1] - 1) / (n - 1) : 1;
|
|
24
|
+
const steps = new Array(n);
|
|
25
|
+
order.forEach((unit, step) => { steps[unit] = step * scale; });
|
|
26
|
+
return steps;
|
|
27
|
+
}
|
|
28
|
+
const [cols, rows] = grid ?? [n, 1];
|
|
29
|
+
const pos = (i) => [i % cols, Math.floor(i / cols)];
|
|
30
|
+
const cx = (cols - 1) / 2, cy = (rows - 1) / 2;
|
|
31
|
+
const dist = (i) => {
|
|
32
|
+
const [x, y] = pos(i);
|
|
33
|
+
if (from === 'end')
|
|
34
|
+
return Math.hypot(cols - 1 - x, rows - 1 - y);
|
|
35
|
+
if (from === 'center')
|
|
36
|
+
return Math.hypot(x - cx, y - cy);
|
|
37
|
+
if (from === 'edges')
|
|
38
|
+
return Math.hypot(cx, cy) - Math.hypot(x - cx, y - cy);
|
|
39
|
+
return Math.hypot(x, y);
|
|
40
|
+
};
|
|
41
|
+
const d = Array.from({ length: n }, (_, i) => dist(i));
|
|
42
|
+
// On a line, the two middle units of an even count share step 0.
|
|
43
|
+
if (!grid)
|
|
44
|
+
return d.map((v) => Math.floor(v + 1e-9));
|
|
45
|
+
return d; // on a grid the steps are continuous: a ripple, not rows
|
|
46
|
+
}
|
|
47
|
+
/** Steps scaled so the last unit starts at `(span) * stagger` seconds. */
|
|
48
|
+
export function staggerDelays(n, stagger, from = 'start', seed = 1, grid) {
|
|
49
|
+
const steps = staggerSteps(n, from, seed, grid);
|
|
50
|
+
const max = Math.max(0, ...steps);
|
|
51
|
+
// A line staggered from its centre takes half as many steps as one from its start;
|
|
52
|
+
// keep the per-step delay, which is what a designer tunes.
|
|
53
|
+
return steps.map((s) => (max > 0 ? s * stagger : 0));
|
|
54
|
+
}
|
|
55
|
+
/** How many stagger steps the group spans: the last delay divided by the stagger. */
|
|
56
|
+
export function staggerSpan(n, from = 'start', seed = 1, grid) {
|
|
57
|
+
return Math.max(0, ...staggerSteps(n, from, seed, grid));
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Steps for units at known positions, nearest to `focus` first. Units at the
|
|
61
|
+
* same distance (within `tie` px) share a step, so a symmetric layout opens
|
|
62
|
+
* symmetrically. Works in any unit; positions and focus must share it.
|
|
63
|
+
*/
|
|
64
|
+
export function staggerByDistance(points, focus, tie = 0.5) {
|
|
65
|
+
const d = points.map(([x, y]) => Math.hypot(x - focus[0], y - focus[1]));
|
|
66
|
+
const order = d.map((v, i) => [v, i]).sort((a, b) => a[0] - b[0] || a[1] - b[1]);
|
|
67
|
+
const steps = new Array(points.length);
|
|
68
|
+
let step = -1, last = -Infinity;
|
|
69
|
+
for (const [v, i] of order) {
|
|
70
|
+
if (v - last > tie) {
|
|
71
|
+
step++;
|
|
72
|
+
last = v;
|
|
73
|
+
}
|
|
74
|
+
steps[i] = step;
|
|
75
|
+
}
|
|
76
|
+
return steps;
|
|
77
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Seconds the control takes to go down: it is fully down at the tap. */
|
|
2
|
+
export declare const PRESS_DOWN = 0.08;
|
|
3
|
+
/** Seconds it takes to come back up, past rest and home. */
|
|
4
|
+
export declare const PRESS_UP = 0.35;
|
|
5
|
+
/** How far down it goes: 7% smaller. */
|
|
6
|
+
export declare const PRESS_DEPTH = 0.07;
|
|
7
|
+
/** Seconds the ring takes to leave. */
|
|
8
|
+
export declare const RING_LIFE = 0.5;
|
|
9
|
+
/** Px the ring grows by while it leaves. */
|
|
10
|
+
export declare const RING_GROW = 12;
|
|
11
|
+
/** The ring's opacity as it starts. */
|
|
12
|
+
export declare const RING_OPACITY = 0.7;
|
|
13
|
+
/** The control's scale at `t` for taps at the given times (seconds, same clock). */
|
|
14
|
+
export declare function pressAt(taps: readonly number[], t: number): number;
|
|
15
|
+
/** The ring of the latest tap still leaving at `t`, or none. */
|
|
16
|
+
export declare function ringAt(taps: readonly number[], t: number): {
|
|
17
|
+
grow: number;
|
|
18
|
+
opacity: number;
|
|
19
|
+
} | undefined;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// A tap on a control, as a viewer reads it: the control goes down under the finger
|
|
2
|
+
// and lands on the moment of the tap, comes back up past rest and home, and a thin
|
|
3
|
+
// ring leaves it in its own shape. Pure functions of time, so a tap looks the same
|
|
4
|
+
// at any frame rate and from any seek.
|
|
5
|
+
import { bezier as cubicBezier } from "./ease.js";
|
|
6
|
+
/** Seconds the control takes to go down: it is fully down at the tap. */
|
|
7
|
+
export const PRESS_DOWN = 0.08;
|
|
8
|
+
/** Seconds it takes to come back up, past rest and home. */
|
|
9
|
+
export const PRESS_UP = 0.35;
|
|
10
|
+
/** How far down it goes: 7% smaller. */
|
|
11
|
+
export const PRESS_DEPTH = 0.07;
|
|
12
|
+
/** Seconds the ring takes to leave. */
|
|
13
|
+
export const RING_LIFE = 0.5;
|
|
14
|
+
/** Px the ring grows by while it leaves. */
|
|
15
|
+
export const RING_GROW = 12;
|
|
16
|
+
/** The ring's opacity as it starts. */
|
|
17
|
+
export const RING_OPACITY = 0.7;
|
|
18
|
+
const bounce = cubicBezier(0.34, 1.36, 0.64, 1);
|
|
19
|
+
// The reel's smoothOut: quick away from the control, slow as it fades.
|
|
20
|
+
const smoothOut = cubicBezier(0.22, 1, 0.36, 1);
|
|
21
|
+
/** The control's scale at `t` for taps at the given times (seconds, same clock). */
|
|
22
|
+
export function pressAt(taps, t) {
|
|
23
|
+
let s = 1;
|
|
24
|
+
for (const at of taps) {
|
|
25
|
+
const d = t - at;
|
|
26
|
+
if (d < -PRESS_DOWN || d > PRESS_UP)
|
|
27
|
+
continue;
|
|
28
|
+
s *= d < 0 ? 1 - PRESS_DEPTH * ((d + PRESS_DOWN) / PRESS_DOWN) : 1 - PRESS_DEPTH + PRESS_DEPTH * bounce(d / PRESS_UP);
|
|
29
|
+
}
|
|
30
|
+
return s;
|
|
31
|
+
}
|
|
32
|
+
/** The ring of the latest tap still leaving at `t`, or none. */
|
|
33
|
+
export function ringAt(taps, t) {
|
|
34
|
+
let latest;
|
|
35
|
+
for (const at of taps)
|
|
36
|
+
if (t >= at && t - at <= RING_LIFE && (latest === undefined || at > latest))
|
|
37
|
+
latest = at;
|
|
38
|
+
if (latest === undefined)
|
|
39
|
+
return undefined;
|
|
40
|
+
const p = (t - latest) / RING_LIFE;
|
|
41
|
+
return { grow: RING_GROW * smoothOut(p), opacity: RING_OPACITY * (1 - p) };
|
|
42
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type Bezier, type EaseSpec } from './ease.ts';
|
|
2
|
+
/** `[time in seconds, value, ease of the move arriving here]` */
|
|
3
|
+
export type Key = readonly [number, number] | readonly [number, number, EaseSpec];
|
|
4
|
+
export declare function track(keys: readonly Key[], defaultEase?: EaseSpec, overrides?: Record<string, Bezier>): (t: number) => number;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Keyframe tracks: a value over time. The ease on a key shapes the move that
|
|
2
|
+
// arrives at that key, so a key reads "be at v by t, getting there like this".
|
|
3
|
+
import { resolveEase } from "./ease.js";
|
|
4
|
+
export function track(keys, defaultEase = 'sine.inOut', overrides = {}) {
|
|
5
|
+
if (keys.length === 0)
|
|
6
|
+
throw new Error('A track needs at least one key');
|
|
7
|
+
const sorted = [...keys].sort((a, b) => a[0] - b[0]);
|
|
8
|
+
const eases = sorted.map((k) => resolveEase(k[2] ?? defaultEase, overrides));
|
|
9
|
+
return (t) => {
|
|
10
|
+
const first = sorted[0], last = sorted[sorted.length - 1];
|
|
11
|
+
if (t <= first[0])
|
|
12
|
+
return first[1];
|
|
13
|
+
if (t >= last[0])
|
|
14
|
+
return last[1];
|
|
15
|
+
let i = 1;
|
|
16
|
+
while (sorted[i][0] < t)
|
|
17
|
+
i++;
|
|
18
|
+
const a = sorted[i - 1], b = sorted[i];
|
|
19
|
+
const span = b[0] - a[0];
|
|
20
|
+
const k = span <= 0 ? 1 : eases[i]((t - a[0]) / span);
|
|
21
|
+
return a[1] + (b[1] - a[1]) * k;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import type { Artboard, Film, Issue, Timeline, Tune } from '../film/types.ts';
|
|
2
|
+
import type { FrameSequence } from '../primitives/types.ts';
|
|
3
|
+
import { type Tokens } from '../tokens.ts';
|
|
4
|
+
export declare class FilmError extends Error {
|
|
5
|
+
issues: Issue[];
|
|
6
|
+
constructor(issues: Issue[]);
|
|
7
|
+
}
|
|
8
|
+
export interface MountOptions {
|
|
9
|
+
tune?: Tune;
|
|
10
|
+
/** Fill `el/slot` layers, by slot name. Called once, when the film is mounted. */
|
|
11
|
+
slots?: Record<string, (el: HTMLElement) => void>;
|
|
12
|
+
/** Draw at the film's own pixel size instead of fitting the host. Used when rendering. */
|
|
13
|
+
fixed?: boolean;
|
|
14
|
+
/** Footage frames pulled by the CLI, by `"<scene>/<layer>"`. Without them el/video plays a video element. */
|
|
15
|
+
frames?: Record<string, FrameSequence>;
|
|
16
|
+
}
|
|
17
|
+
export interface LayerBox {
|
|
18
|
+
scene: string;
|
|
19
|
+
layer: string;
|
|
20
|
+
use: string;
|
|
21
|
+
/** Stage px. */
|
|
22
|
+
x: number;
|
|
23
|
+
y: number;
|
|
24
|
+
width: number;
|
|
25
|
+
height: number;
|
|
26
|
+
/** How far the layer reaches past each stage edge, in px. Zero when inside. */
|
|
27
|
+
off: {
|
|
28
|
+
left: number;
|
|
29
|
+
top: number;
|
|
30
|
+
right: number;
|
|
31
|
+
bottom: number;
|
|
32
|
+
};
|
|
33
|
+
empty: boolean;
|
|
34
|
+
}
|
|
35
|
+
export interface Mounted {
|
|
36
|
+
film: Film;
|
|
37
|
+
timeline: Timeline;
|
|
38
|
+
tokens: Tokens;
|
|
39
|
+
issues: Issue[];
|
|
40
|
+
/** Tune overrides whose target is no longer in the film. */
|
|
41
|
+
orphans: string[];
|
|
42
|
+
duration: number;
|
|
43
|
+
fps: number;
|
|
44
|
+
stage: HTMLElement;
|
|
45
|
+
/** Resolves when images are decoded and fonts are loaded: the first moment frames are final. */
|
|
46
|
+
ready: Promise<void>;
|
|
47
|
+
seek(t: number): void;
|
|
48
|
+
/** Resolves when everything the last seek asked for has loaded, such as a frame of footage. */
|
|
49
|
+
settled(): Promise<void>;
|
|
50
|
+
/** Where every visible layer sits at time t. Seeks to t. */
|
|
51
|
+
audit(t: number): LayerBox[];
|
|
52
|
+
destroy(): void;
|
|
53
|
+
}
|
|
54
|
+
/** How wide a placed layer can be, in % of the stage, before its anchor pushes it off stage. */
|
|
55
|
+
export declare function placedRoom(place: {
|
|
56
|
+
x: number;
|
|
57
|
+
anchor?: string;
|
|
58
|
+
}): number;
|
|
59
|
+
interface Pose {
|
|
60
|
+
x: number;
|
|
61
|
+
y: number;
|
|
62
|
+
scale: number;
|
|
63
|
+
rotate: number;
|
|
64
|
+
opacity: number;
|
|
65
|
+
blur: number;
|
|
66
|
+
rotateX: number;
|
|
67
|
+
rotateY: number;
|
|
68
|
+
skew: number;
|
|
69
|
+
/** Travel as a share of the layer's own height, for masks. */
|
|
70
|
+
yShare: number;
|
|
71
|
+
/** Clipped share of each side, 0..1: top, right, bottom, left. */
|
|
72
|
+
clip: [number, number, number, number];
|
|
73
|
+
/** For the camera: the screen point (px from the stage centre) its tilt turns about. */
|
|
74
|
+
pivot?: [number, number];
|
|
75
|
+
/** Px a slot move has carried the layer down (positive) or up (negative), clipped at its box. */
|
|
76
|
+
slot?: number;
|
|
77
|
+
/** An angled wipe: its direction in degrees, the share of the box still covered, and whether it is leaving. */
|
|
78
|
+
cut?: {
|
|
79
|
+
angle: number;
|
|
80
|
+
hidden: number;
|
|
81
|
+
leaving: boolean;
|
|
82
|
+
};
|
|
83
|
+
/** A soft edge for masks and straight wipes: px, or true for a tenth of the line height. */
|
|
84
|
+
feather?: number | true;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* The side a wipe clips, as an index into Pose.clip (top, right, bottom, left). The edge
|
|
88
|
+
* travels in the named direction: wipe-right uncovers from the left edge rightwards, so on
|
|
89
|
+
* the way in the clip sits on the right and shrinks; on the way out it grows from the left.
|
|
90
|
+
*/
|
|
91
|
+
export declare function wipeSide(move: string, leaving: boolean): 0 | 1 | 2 | 3;
|
|
92
|
+
/**
|
|
93
|
+
* The mask for a feathered mask or wipe on a w × h box: the same window `clipFor` cuts, with
|
|
94
|
+
* each edge fading out over `f` px beyond it rather than cut, so a line rises out of a soft
|
|
95
|
+
* edge. A wipe's edge travels its share of the box plus the feather, so it starts and ends
|
|
96
|
+
* fully off the box: nothing changes the frame the move ends and the mask comes off. The
|
|
97
|
+
* image spans well past the box so overhangs, accents and italics are not cut.
|
|
98
|
+
*/
|
|
99
|
+
export declare function featherMask(p: Pick<Pose, 'clip' | 'yShare'>, w: number, h: number, pad: number, f: number): {
|
|
100
|
+
image: string;
|
|
101
|
+
size: string;
|
|
102
|
+
position: string;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* The most a placed layer without its own width may run: on a still stage, the room its
|
|
106
|
+
* anchor leaves; on a canvas the camera travels, no limit, since a rule or a picture
|
|
107
|
+
* there is meant to run past the stage's edge.
|
|
108
|
+
*/
|
|
109
|
+
export declare const placedMaxWidth: (place: Parameters<typeof placedRoom>[0], canvas: boolean, stageWidth: number) => string;
|
|
110
|
+
/** Where an artboard sits on the stage: its scale, and the stage px of its top-left corner. */
|
|
111
|
+
export declare function artboardFit(stage: [number, number], board: Pick<Artboard, 'width' | 'height' | 'fit' | 'align'>): {
|
|
112
|
+
scale: number;
|
|
113
|
+
x: number;
|
|
114
|
+
y: number;
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* What an angled wipe leaves showing of a w × h box, as a polygon in the box's px: the box,
|
|
118
|
+
* less any straight wipes (`inset`, shares of top, right, bottom, left), cut by a line square
|
|
119
|
+
* to `angle`. Entering, the line runs from the box's trailing corner to its leading one and
|
|
120
|
+
* shows what it has passed; leaving, it hides what it has passed. `hidden` is the share of
|
|
121
|
+
* the sweep still to come, or already gone.
|
|
122
|
+
*/
|
|
123
|
+
export declare function cutPolygon(w: number, h: number, inset: [number, number, number, number], cut: NonNullable<Pose['cut']>): [number, number][];
|
|
124
|
+
/** The clip-path for a pose's wipes and masks, or '' when nothing is clipped. `size` is the box, needed for an angled wipe. */
|
|
125
|
+
export declare function clipFor(p: Pick<Pose, 'clip' | 'yShare' | 'slot' | 'cut'>, size?: [number, number]): string;
|
|
126
|
+
export declare function mount(host: HTMLElement, source: Film, options?: MountOptions): Mounted;
|
|
127
|
+
export {};
|