@usemosio/cli-linux-x64 1.0.0-next.1 → 1.0.0-next.4
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/THIRD_PARTY_NOTICES.md +22 -0
- package/apps/studio/dist/assets/Workspace-Dr-hVeFd.js +34 -0
- package/apps/studio/dist/assets/{agent-panel-CqJuv5Sn.js → agent-panel-DMrVed-J.js} +5 -5
- package/apps/studio/dist/assets/{boundary-bK2S8z05.js → boundary-DL9veUlN.js} +1 -1
- package/apps/studio/dist/assets/{feedback-BqzXUdVd.js → feedback-x6ZumR_x.js} +1 -1
- package/apps/studio/dist/assets/index-C6juWzGV.js +1984 -0
- package/apps/studio/dist/assets/index-CjDBKmB_.css +2 -0
- package/apps/studio/dist/assets/inspector3d-sqergHSP.js +1 -0
- package/apps/studio/dist/index.html +4 -3
- package/apps/studio/dist-host/studio-host.mjs +262 -3
- package/bin/mosio +0 -0
- package/bin/mosio-agent +0 -0
- package/crates/mosio/src/adapters/mosio-three.js +112 -8
- package/crates/mosio/src/adapters/room-env-pmrem.json +1 -0
- package/crates/mosio/src/runtime.js +205 -6
- package/fixtures/camera-inspect/mosio.json +56 -0
- package/fixtures/camera-inspect/scenes/behind.html +22 -0
- package/fixtures/camera-inspect/scenes/cut.html +18 -0
- package/fixtures/camera-inspect/scenes/edges.html +18 -0
- package/fixtures/camera-inspect/scenes/good.html +23 -0
- package/fixtures/camera-inspect/scenes/read.html +22 -0
- package/fixtures/camera-inspect/scenes/shake.html +23 -0
- package/fixtures/camera-inspect/scenes/speed.html +18 -0
- package/fixtures/camera-inspect-vertical/mosio.json +31 -0
- package/fixtures/camera-inspect-vertical/scenes/good.html +20 -0
- package/fixtures/camera-inspect-vertical/scenes/safe.html +18 -0
- package/fixtures/cloudrun-gpu/audio/music.wav +0 -0
- package/fixtures/cloudrun-gpu/audio/vo.wav +0 -0
- package/fixtures/cloudrun-gpu/mosio.json +18 -0
- package/fixtures/cloudrun-gpu/scenes/cube.html +25 -0
- package/fixtures/direct-seek/mosio.json +4 -0
- package/fixtures/direct-seek/scenes/clock.html +9 -0
- package/fixtures/direct-seek/scenes/meta.html +11 -0
- package/fixtures/direct-seek/scenes/pure.html +11 -0
- package/fixtures/direct-seek/scenes/slow.html +11 -0
- package/fixtures/direct-seek-media/mosio.json +6 -0
- package/fixtures/direct-seek-media/scenes/pure.html +11 -0
- package/fixtures/gl-readback/mosio.json +16 -0
- package/fixtures/gl-readback/scenes/compositor.html +23 -0
- package/fixtures/gl-readback/scenes/readback.html +23 -0
- package/fixtures/inspect-physics/expect.json +18 -0
- package/fixtures/inspect-physics/mosio.json +29 -0
- package/fixtures/inspect-physics/scenes/calm.html +46 -0
- package/fixtures/inspect-physics/scenes/physics.html +47 -0
- package/package.json +1 -1
- package/primitives/README.md +23 -2
- package/primitives/example/shared/mosio-prims.js +349 -1
- package/primitives/impact-burst/golden/f030.png +0 -0
- package/primitives/impact-burst/golden/f032.png +0 -0
- package/primitives/impact-burst/golden/f036.png +0 -0
- package/primitives/impact-burst/impact-burst.js +51 -0
- package/primitives/impact-burst/primitive.json +130 -0
- package/primitives/impact-burst/scene.html +24 -0
- package/primitives/stick-figure/golden/f030.png +0 -0
- package/primitives/stick-figure/golden/f092.png +0 -0
- package/primitives/stick-figure/golden/f140.png +0 -0
- package/primitives/stick-figure/primitive.json +179 -0
- package/primitives/stick-figure/scene.html +40 -0
- package/primitives/stick-figure/stick-figure.js +297 -0
- package/primitives/zoom-through/primitive.json +7 -2
- package/primitives/zoom-through/zoom-through.js +6 -5
- package/scripts/3d-acceptance.sh +8 -1
- package/scripts/3d-attach-bench.mjs +119 -0
- package/scripts/3d-bake-room-env.mjs +74 -0
- package/scripts/3d-e2b-job.sh +1 -0
- package/scripts/3d-gen-heavy-fixture.py +65 -0
- package/scripts/3d-trace-summary.py +14 -0
- package/scripts/acceptance/camera-inspect.sh +49 -0
- package/scripts/acceptance/direct-seek.sh +68 -0
- package/scripts/acceptance/export.sh +5 -3
- package/scripts/acceptance/frames.sh +7 -2
- package/scripts/acceptance/hardening.sh +37 -6
- package/scripts/acceptance/hub.sh +208 -0
- package/scripts/acceptance/inspect.sh +21 -2
- package/scripts/acceptance/revisions-git.sh +137 -0
- package/scripts/acceptance/revisions-sync.sh +323 -0
- package/scripts/acceptance/revisions.sh +118 -4
- package/scripts/acceptance/segcache.sh +100 -0
- package/scripts/acceptance/split.sh +78 -0
- package/scripts/bootstrap.sh +20 -1
- package/scripts/check-error-codes.py +9 -1
- package/scripts/check-file-size.sh +45 -0
- package/scripts/ci.sh +4 -4
- package/scripts/dedupe-report.sh +47 -0
- package/scripts/e2b/template/provision.sh +1 -1
- package/scripts/fastpath/cdp.mjs +25 -0
- package/scripts/fastpath/dbg.mjs +11 -0
- package/scripts/fastpath/e2b.mjs +40 -0
- package/scripts/fastpath/features/gen.py +109 -0
- package/scripts/fastpath/features/mosio.json +100 -0
- package/scripts/fastpath/features/scenes/backdrop.html +11 -0
- package/scripts/fastpath/features/scenes/blend.html +11 -0
- package/scripts/fastpath/features/scenes/canvas2d.html +11 -0
- package/scripts/fastpath/features/scenes/filter.html +11 -0
- package/scripts/fastpath/features/scenes/gradient.html +11 -0
- package/scripts/fastpath/features/scenes/iframe.html +11 -0
- package/scripts/fastpath/features/scenes/image.html +11 -0
- package/scripts/fastpath/features/scenes/svg.html +11 -0
- package/scripts/fastpath/features/scenes/text.html +11 -0
- package/scripts/fastpath/features/scenes/typo.html +11 -0
- package/scripts/fastpath/features/scenes/video.html +11 -0
- package/scripts/fastpath/features/scenes/video2.html +11 -0
- package/scripts/fastpath/features-xfade/mosio.json +49 -0
- package/scripts/fastpath/features-xfade/scenes/image.html +11 -0
- package/scripts/fastpath/features-xfade/scenes/video.html +11 -0
- package/scripts/fastpath/fixtures/gen_layout.py +80 -0
- package/scripts/fastpath/fixtures/l12-no-reset/assets/img/photo-1015.jpg +0 -0
- package/scripts/fastpath/fixtures/l12-no-reset/mosio.json +34 -0
- package/scripts/fastpath/fixtures/l12-no-reset/scenes/main.html +20 -0
- package/scripts/fastpath/fp.mjs +91 -0
- package/scripts/fastpath/inpage.js +68 -0
- package/scripts/fastpath/recipes.py +49 -0
- package/scripts/fastpath/sandbox.sh +68 -0
- package/scripts/fastpath/sandbox10.sh +57 -0
- package/scripts/fastpath/sandbox11.sh +18 -0
- package/scripts/fastpath/sandbox12.sh +30 -0
- package/scripts/fastpath/sandbox13.sh +16 -0
- package/scripts/fastpath/sandbox14.sh +28 -0
- package/scripts/fastpath/sandbox15.sh +36 -0
- package/scripts/fastpath/sandbox16.sh +60 -0
- package/scripts/fastpath/sandbox17.sh +34 -0
- package/scripts/fastpath/sandbox18.sh +59 -0
- package/scripts/fastpath/sandbox19.sh +67 -0
- package/scripts/fastpath/sandbox2.sh +41 -0
- package/scripts/fastpath/sandbox20.sh +34 -0
- package/scripts/fastpath/sandbox21.sh +22 -0
- package/scripts/fastpath/sandbox22.sh +22 -0
- package/scripts/fastpath/sandbox23.sh +21 -0
- package/scripts/fastpath/sandbox3.sh +151 -0
- package/scripts/fastpath/sandbox4.sh +161 -0
- package/scripts/fastpath/sandbox5.sh +69 -0
- package/scripts/fastpath/sandbox6.sh +85 -0
- package/scripts/fastpath/sandbox7.sh +81 -0
- package/scripts/fastpath/sandbox8.sh +62 -0
- package/scripts/fastpath/sandbox9.sh +130 -0
- package/scripts/fastpath/srv.mjs +15 -0
- package/scripts/fastpath/www/probe.html +1 -0
- package/scripts/gen-media-fixtures.sh +1 -0
- package/scripts/gl-readback-check.sh +26 -0
- package/scripts/hpbench/make-bench-fixtures.sh +43 -0
- package/scripts/hpbench/render-cgroup.sh +56 -0
- package/scripts/install.sh +2 -1
- package/scripts/npm-clean-install-proof-win.sh +64 -0
- package/scripts/platform-smoke.sh +80 -0
- package/scripts/prim.mjs +31 -13
- package/scripts/user-journey.sh +68 -0
- package/skills/mosio-3d/SKILL.md +31 -3
- package/skills/mosio-brief/SKILL.md +80 -0
- package/skills/mosio-brief/references/brief.md +141 -0
- package/skills/mosio-brief/references/copy.md +99 -0
- package/skills/mosio-brief/references/narration.md +61 -0
- package/skills/mosio-brief/references/storyboard.md +98 -0
- package/skills/mosio-collab/SKILL.md +104 -0
- package/skills/mosio-collab/references/hub.md +62 -0
- package/skills/mosio-engine/SKILL.md +44 -13
- package/skills/mosio-engine/references/camera.md +12 -2
- package/skills/mosio-engine/references/character.md +88 -0
- package/skills/mosio-engine/references/checks.md +11 -4
- package/skills/mosio-engine/references/delivery.md +29 -2
- package/skills/mosio-engine/references/kit-primitives.md +8 -4
- package/skills/mosio-engine/references/layout.md +8 -0
- package/skills/mosio-engine/references/plan.md +3 -1
- package/skills/mosio-engine/references/project.md +15 -3
- package/skills/mosio-engine/references/publish.md +79 -0
- package/skills/mosio-engine/references/registry.md +27 -15
- package/skills/mosio-engine/references/timeline.md +19 -1
- package/skills/mosio-engine/references/timing.md +2 -1
- package/skills/mosio-import/SKILL.md +1 -1
- package/skills/mosio-import/references/from-hyperframes.md +1 -1
- package/skills/mosio-import/references/from-remotion.md +1 -1
- package/skills/mosio-media/SKILL.md +16 -4
- package/skills/mosio-media/references/audio.md +29 -11
- package/skills/mosio-media/references/captions.md +26 -5
- package/skills/mosio-media/references/editing.md +70 -0
- package/skills/mosio-media/references/footage.md +40 -8
- package/skills/mosio-media/references/voice.md +52 -7
- package/skills/mosio-replicate/references/mosio.md +1 -1
- package/toolchain.lock.json +151 -4
- package/apps/studio/dist/assets/Workspace-KSOFeEgc.js +0 -32
- package/apps/studio/dist/assets/index-B-uuTqe9.js +0 -1785
- package/apps/studio/dist/assets/index-CajSh04l.css +0 -2
- package/apps/studio/dist/assets/inspector3d-vDz97X99.js +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<!doctype html><html><head><meta charset="utf-8"><style>* { margin: 0; padding: 0; } html, body { width: 320px; height: 180px; overflow: hidden; background: #102030; }</style></head>
|
|
2
|
+
<body><canvas width="320" height="180" data-mosio-id="meta/canvas"></canvas>
|
|
3
|
+
<script>
|
|
4
|
+
// The picture is a pure function of the frame number, so any frame can be reached without the frames before it.
|
|
5
|
+
const c = document.querySelector("canvas").getContext("2d");
|
|
6
|
+
__mosio.onSeek((t, f) => {
|
|
7
|
+
c.fillStyle = "#102030"; c.fillRect(0, 0, 320, 180);
|
|
8
|
+
c.fillStyle = "hsl(" + ((f * 7) % 360) + " 80% 55%)"; c.fillRect((f * 3) % 280, 70, 40, 40);
|
|
9
|
+
c.fillStyle = "#ffffff"; c.fillRect(0, 170, Math.round((f / 299) * 320), 10);
|
|
10
|
+
});
|
|
11
|
+
</script></body></html>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<!doctype html><html><head><meta charset="utf-8"><style>* { margin: 0; padding: 0; } html, body { width: 320px; height: 180px; overflow: hidden; background: #102030; }</style></head>
|
|
2
|
+
<body><canvas width="320" height="180" data-mosio-id="pure/canvas"></canvas>
|
|
3
|
+
<script>
|
|
4
|
+
// The picture is a pure function of the frame number, so any frame can be reached without the frames before it.
|
|
5
|
+
const c = document.querySelector("canvas").getContext("2d");
|
|
6
|
+
__mosio.onSeek((t, f) => {
|
|
7
|
+
c.fillStyle = "#102030"; c.fillRect(0, 0, 320, 180);
|
|
8
|
+
c.fillStyle = "hsl(" + ((f * 7) % 360) + " 80% 55%)"; c.fillRect((f * 3) % 280, 70, 40, 40);
|
|
9
|
+
c.fillStyle = "#ffffff"; c.fillRect(0, 170, Math.round((f / 299) * 320), 10);
|
|
10
|
+
});
|
|
11
|
+
</script></body></html>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<!doctype html><html><head><meta charset="utf-8"><style>* { margin: 0; padding: 0; } html, body { width: 320px; height: 180px; overflow: hidden; background: #102030; }</style></head>
|
|
2
|
+
<body><canvas width="320" height="180" data-mosio-id="slow/canvas"></canvas>
|
|
3
|
+
<script>
|
|
4
|
+
// A heavy frame (tens of ms of CPU per seek), so replaying to a late frame takes seconds: the replay reports progress.
|
|
5
|
+
const c = document.querySelector("canvas").getContext("2d");
|
|
6
|
+
__mosio.onSeek((t, f) => {
|
|
7
|
+
let x = 0; for (let i = 0; i < 2e7; i++) x += Math.sqrt(i);
|
|
8
|
+
c.fillStyle = "#102030"; c.fillRect(0, 0, 320, 180);
|
|
9
|
+
c.fillStyle = "#38bdf8"; c.fillRect((f * 3) % 280, 70, 40, 40 + (x > 0 ? 0 : 1));
|
|
10
|
+
});
|
|
11
|
+
</script></body></html>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{ "mosio": 0, "name": "direct-seek-media", "description": "media frame with a scene that seeks straight to the frame (\"seek\": \"direct\"): one scene frame instead of the scene's whole run.",
|
|
2
|
+
"width": 320, "height": 180, "fps": 30, "seed": 0, "background": "#000000", "libraries": [], "shared": [], "assets": ["assets/dot.png"],
|
|
3
|
+
"scenes": [ { "id": "pure", "src": "scenes/pure.html", "frames": 300, "seek": "direct" } ],
|
|
4
|
+
"html_layer": { "z": 0 },
|
|
5
|
+
"tracks": [ { "id": "badge", "kind": "video", "z": 1, "clips": [ { "id": "dot", "src": "assets/dot.png", "start": 0, "frames": 300, "fit": "none" } ] } ],
|
|
6
|
+
"transitions": [], "audio": [] }
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<!doctype html><html><head><meta charset="utf-8"><style>* { margin: 0; padding: 0; } html, body { width: 320px; height: 180px; overflow: hidden; background: #102030; }</style></head>
|
|
2
|
+
<body><canvas width="320" height="180" data-mosio-id="pure/canvas"></canvas>
|
|
3
|
+
<script>
|
|
4
|
+
// The picture is a pure function of the frame number, so any frame can be reached without the frames before it.
|
|
5
|
+
const c = document.querySelector("canvas").getContext("2d");
|
|
6
|
+
__mosio.onSeek((t, f) => {
|
|
7
|
+
c.fillStyle = "#102030"; c.fillRect(0, 0, 320, 180);
|
|
8
|
+
c.fillStyle = "hsl(" + ((f * 7) % 360) + " 80% 55%)"; c.fillRect((f * 3) % 280, 70, 40, 40);
|
|
9
|
+
c.fillStyle = "#ffffff"; c.fillRect(0, 170, Math.round((f / 299) * 320), 10);
|
|
10
|
+
});
|
|
11
|
+
</script></body></html>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mosio": 0,
|
|
3
|
+
"name": "gl-readback",
|
|
4
|
+
"description": "A plain WebGL canvas drawn from onSeek (no adapter), shown through the runtime's readback present and through the compositor. On SwiftShader both must give the same bytes on every frame, and the frames must change (scripts/gl-readback-check.sh).",
|
|
5
|
+
"width": 640, "height": 360, "fps": 30, "seed": 2,
|
|
6
|
+
"background": "#202020",
|
|
7
|
+
"libraries": [],
|
|
8
|
+
"shared": [],
|
|
9
|
+
"assets": [],
|
|
10
|
+
"scenes": [
|
|
11
|
+
{ "id": "readback", "src": "scenes/readback.html", "frames": 30 },
|
|
12
|
+
{ "id": "compositor", "src": "scenes/compositor.html", "frames": 30 }
|
|
13
|
+
],
|
|
14
|
+
"transitions": [],
|
|
15
|
+
"audio": []
|
|
16
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en"><head><meta charset="utf-8">
|
|
3
|
+
<style>* { margin: 0; padding: 0; } html, body { width: 640px; height: 360px; overflow: hidden; background: #202020; }
|
|
4
|
+
#stage { position: absolute; left: 40px; top: 30px; width: 400px; height: 240px; }
|
|
5
|
+
#gl { position: absolute; left: 20px; top: 10px; width: 320px; height: 200px; border: 4px solid #f0c020; }
|
|
6
|
+
.over { position: absolute; left: 300px; top: 120px; width: 200px; height: 80px; background: rgba(40, 120, 255, .6); }</style>
|
|
7
|
+
</head><body>
|
|
8
|
+
<div id="stage"><canvas id="gl" width="320" height="200" data-mosio-present="compositor"></canvas></div><div class="over"></div>
|
|
9
|
+
<script>
|
|
10
|
+
// three.js-style: a plain WebGL context without preserveDrawingBuffer, drawn only from onSeek
|
|
11
|
+
const gl = document.getElementById("gl").getContext("webgl", { antialias: false });
|
|
12
|
+
const sh = (type, src) => { const s = gl.createShader(type); gl.shaderSource(s, src); gl.compileShader(s); return s; };
|
|
13
|
+
const p = gl.createProgram();
|
|
14
|
+
gl.attachShader(p, sh(gl.VERTEX_SHADER, "attribute vec2 a; void main(){ gl_Position = vec4(a, 0., 1.); }"));
|
|
15
|
+
gl.attachShader(p, sh(gl.FRAGMENT_SHADER, "precision mediump float; uniform float u_t; void main(){ vec2 uv = gl_FragCoord.xy / vec2(320., 200.); gl_FragColor = vec4(fract(uv.x + u_t), uv.y, fract(u_t * 3.), 1.); }"));
|
|
16
|
+
gl.linkProgram(p); gl.useProgram(p);
|
|
17
|
+
gl.bindBuffer(gl.ARRAY_BUFFER, gl.createBuffer());
|
|
18
|
+
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]), gl.STATIC_DRAW);
|
|
19
|
+
const loc = gl.getAttribLocation(p, "a"); gl.enableVertexAttribArray(loc); gl.vertexAttribPointer(loc, 2, gl.FLOAT, false, 0, 0);
|
|
20
|
+
const ut = gl.getUniformLocation(p, "u_t");
|
|
21
|
+
__mosio.onSeek((t) => { gl.uniform1f(ut, t); gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4); });
|
|
22
|
+
</script>
|
|
23
|
+
</body></html>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en"><head><meta charset="utf-8">
|
|
3
|
+
<style>* { margin: 0; padding: 0; } html, body { width: 640px; height: 360px; overflow: hidden; background: #202020; }
|
|
4
|
+
#stage { position: absolute; left: 40px; top: 30px; width: 400px; height: 240px; }
|
|
5
|
+
#gl { position: absolute; left: 20px; top: 10px; width: 320px; height: 200px; border: 4px solid #f0c020; }
|
|
6
|
+
.over { position: absolute; left: 300px; top: 120px; width: 200px; height: 80px; background: rgba(40, 120, 255, .6); }</style>
|
|
7
|
+
</head><body>
|
|
8
|
+
<div id="stage"><canvas id="gl" width="320" height="200" data-mosio-present="readback"></canvas></div><div class="over"></div>
|
|
9
|
+
<script>
|
|
10
|
+
// three.js-style: a plain WebGL context without preserveDrawingBuffer, drawn only from onSeek
|
|
11
|
+
const gl = document.getElementById("gl").getContext("webgl", { antialias: false });
|
|
12
|
+
const sh = (type, src) => { const s = gl.createShader(type); gl.shaderSource(s, src); gl.compileShader(s); return s; };
|
|
13
|
+
const p = gl.createProgram();
|
|
14
|
+
gl.attachShader(p, sh(gl.VERTEX_SHADER, "attribute vec2 a; void main(){ gl_Position = vec4(a, 0., 1.); }"));
|
|
15
|
+
gl.attachShader(p, sh(gl.FRAGMENT_SHADER, "precision mediump float; uniform float u_t; void main(){ vec2 uv = gl_FragCoord.xy / vec2(320., 200.); gl_FragColor = vec4(fract(uv.x + u_t), uv.y, fract(u_t * 3.), 1.); }"));
|
|
16
|
+
gl.linkProgram(p); gl.useProgram(p);
|
|
17
|
+
gl.bindBuffer(gl.ARRAY_BUFFER, gl.createBuffer());
|
|
18
|
+
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]), gl.STATIC_DRAW);
|
|
19
|
+
const loc = gl.getAttribLocation(p, "a"); gl.enableVertexAttribArray(loc); gl.vertexAttribPointer(loc, 2, gl.FLOAT, false, 0, 0);
|
|
20
|
+
const ut = gl.getUniformLocation(p, "u_t");
|
|
21
|
+
__mosio.onSeek((t) => { gl.uniform1f(ut, t); gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4); });
|
|
22
|
+
</script>
|
|
23
|
+
</body></html>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"kind": "inspection",
|
|
3
|
+
"expect_findings": [
|
|
4
|
+
{ "scene": "physics", "code": "W_MOTION_FAST_UNBLURRED", "id": "physics/streak" },
|
|
5
|
+
{ "scene": "physics", "code": "W_TEXT_MOVES_WHILE_READ", "id": "physics/drift" },
|
|
6
|
+
{ "scene": "physics", "code": "W_MOTION_OVERSHOOT_TEXT", "id": "physics/bounce", "source": "measured" },
|
|
7
|
+
{ "scene": "physics", "code": "I_MIXED_DIRECTIONS", "id": "physics/row" },
|
|
8
|
+
{ "scene": "physics", "code": "W_POINTER_MISS", "id": "physics/subscribe" }
|
|
9
|
+
],
|
|
10
|
+
"expect_clean": [
|
|
11
|
+
{ "scene": "calm", "code": "W_MOTION_FAST_UNBLURRED" },
|
|
12
|
+
{ "scene": "calm", "code": "W_TEXT_MOVES_WHILE_READ" },
|
|
13
|
+
{ "scene": "calm", "code": "W_MOTION_OVERSHOOT_TEXT" },
|
|
14
|
+
{ "scene": "calm", "code": "I_MIXED_DIRECTIONS" },
|
|
15
|
+
{ "scene": "calm", "code": "W_POINTER_MISS" },
|
|
16
|
+
{ "scene": "physics", "code": "W_MOTION_OVERSHOOT_TEXT", "id": "physics/drift" }
|
|
17
|
+
]
|
|
18
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mosio": 0,
|
|
3
|
+
"name": "inspect-physics",
|
|
4
|
+
"description": "Motion-physics fixture. The first scene has one seeded defect per check: a box that streaks across the frame with no blur, a line that drifts the whole time it is legible, a title that bounces past its place (with a function ease, so only the measured check can see it), a row whose items enter from two sides in the same beat, and a cursor whose tip presses beside the Subscribe button. The second scene is the clean control: the same moves blurred, settled, eased without overshoot, from one side, and on target.",
|
|
5
|
+
"width": 1280,
|
|
6
|
+
"height": 720,
|
|
7
|
+
"fps": 30,
|
|
8
|
+
"seed": 7,
|
|
9
|
+
"background": "#0b1020",
|
|
10
|
+
"libraries": [
|
|
11
|
+
"gsap@3.15.1"
|
|
12
|
+
],
|
|
13
|
+
"shared": [],
|
|
14
|
+
"assets": [],
|
|
15
|
+
"scenes": [
|
|
16
|
+
{
|
|
17
|
+
"id": "physics",
|
|
18
|
+
"src": "scenes/physics.html",
|
|
19
|
+
"frames": 150
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"id": "calm",
|
|
23
|
+
"src": "scenes/calm.html",
|
|
24
|
+
"frames": 150
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"transitions": [],
|
|
28
|
+
"audio": []
|
|
29
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<!doctype html><html><head><meta charset="utf-8">
|
|
2
|
+
<script src="/_lib/gsap@3.15.1/gsap.min.js"></script>
|
|
3
|
+
<style>
|
|
4
|
+
* { margin: 0; padding: 0; box-sizing: border-box; } html, body { width: 1280px; height: 720px; overflow: hidden; background: #0b1020; color: #f8fafc; font-family: sans-serif; }
|
|
5
|
+
.box { position: absolute; width: 80px; height: 80px; background: #38bdf8; border-radius: 8px; }
|
|
6
|
+
.t { position: absolute; left: 80px; font-size: 36px; font-weight: 700; white-space: nowrap; }
|
|
7
|
+
.row { position: absolute; left: 80px; top: 360px; width: 600px; height: 100px; }
|
|
8
|
+
.row .box { top: 10px; }
|
|
9
|
+
.btn { position: absolute; left: 900px; top: 560px; width: 200px; height: 56px; background: #f43f5e; border-radius: 28px; font: 700 24px sans-serif; display: flex; align-items: center; justify-content: center; }
|
|
10
|
+
.layer { position: absolute; inset: 0; }
|
|
11
|
+
.cursor { position: absolute; width: 32px; height: 32px; background: #fff; clip-path: polygon(12.5% 8.3%, 12.5% 79%, 33% 60%, 48% 92%, 60% 86%, 46% 55%, 75% 54%); }
|
|
12
|
+
</style></head><body>
|
|
13
|
+
<div class="box" data-mosio-id="calm/streak" style="left:0;top:40px;filter:blur(6px)"></div>
|
|
14
|
+
<div class="t" data-mosio-id="calm/drift" style="top:160px;opacity:0">Words settling on the screen</div>
|
|
15
|
+
<div class="t" data-mosio-id="calm/bounce" style="top:260px;opacity:0">Launch day</div>
|
|
16
|
+
<div class="row" data-mosio-id="calm/row">
|
|
17
|
+
<div class="box" data-mosio-id="calm/row-a" style="left:0"></div>
|
|
18
|
+
<div class="box" data-mosio-id="calm/row-b" style="left:160px"></div>
|
|
19
|
+
<div class="box" data-mosio-id="calm/row-c" style="left:320px"></div>
|
|
20
|
+
</div>
|
|
21
|
+
<div class="btn" data-mosio-id="calm/subscribe">Subscribe</div>
|
|
22
|
+
<div class="layer" data-mosio-id="calm/layer"><div class="cursor" data-mp="cursor" data-mosio-id="calm/cursor"></div></div>
|
|
23
|
+
<script>
|
|
24
|
+
const tl = gsap.timeline({ paused: true });
|
|
25
|
+
const $ = (id) => '[data-mosio-id="calm/' + id + '"]';
|
|
26
|
+
// the same fast move, blurred while it moves
|
|
27
|
+
tl.fromTo($("streak"), { x: 0 }, { x: 1100, duration: 0.3, ease: "none" }, 0.2);
|
|
28
|
+
tl.set($("streak"), { filter: "none" }, 0.6);
|
|
29
|
+
// the line slides in, settles within half a second and holds still while it is read
|
|
30
|
+
tl.fromTo($("drift"), { opacity: 0, x: 40 }, { opacity: 1, x: 0, duration: 0.5, ease: "power3.out" }, 0);
|
|
31
|
+
tl.to($("drift"), { opacity: 0, duration: 0.1, ease: "none" }, 3.7);
|
|
32
|
+
// an ease that stops at its end
|
|
33
|
+
tl.fromTo($("bounce"), { y: 80, opacity: 0 }, { y: 0, opacity: 1, duration: 0.6, ease: "power3.out" }, 0.5);
|
|
34
|
+
// all three items rise from below
|
|
35
|
+
tl.fromTo($("row-a"), { y: 60, opacity: 0 }, { y: 0, opacity: 1, duration: 0.5, ease: "power3.out" }, 1.0);
|
|
36
|
+
tl.fromTo($("row-b"), { y: 60, opacity: 0 }, { y: 0, opacity: 1, duration: 0.5, ease: "power3.out" }, 1.05);
|
|
37
|
+
tl.fromTo($("row-c"), { y: 60, opacity: 0 }, { y: 0, opacity: 1, duration: 0.5, ease: "power3.out" }, 1.1);
|
|
38
|
+
// the tip presses the centre of the button
|
|
39
|
+
const cur = $("cursor");
|
|
40
|
+
gsap.set(cur, { transformOrigin: "12.5% 8.3%", xPercent: -12.5, yPercent: -8.3, left: 200, top: 650 });
|
|
41
|
+
tl.fromTo(cur, { left: 200, top: 650 }, { left: 1000, top: 588, duration: 0.8, ease: "power2.inOut", immediateRender: false }, 2.6);
|
|
42
|
+
tl.fromTo(cur, { scale: 1 }, { scale: 0.85, duration: 0.1, ease: "power2.in", yoyo: true, repeat: 1, immediateRender: false }, 3.5);
|
|
43
|
+
tl.fromTo($("subscribe"), { scale: 1 }, { scale: 0.95, duration: 0.1, ease: "power2.in", yoyo: true, repeat: 1, immediateRender: false }, 3.5);
|
|
44
|
+
__mosio.timeline(tl);
|
|
45
|
+
</script>
|
|
46
|
+
</body></html>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<!doctype html><html><head><meta charset="utf-8">
|
|
2
|
+
<script src="/_lib/gsap@3.15.1/gsap.min.js"></script>
|
|
3
|
+
<style>
|
|
4
|
+
* { margin: 0; padding: 0; box-sizing: border-box; } html, body { width: 1280px; height: 720px; overflow: hidden; background: #0b1020; color: #f8fafc; font-family: sans-serif; }
|
|
5
|
+
.box { position: absolute; width: 80px; height: 80px; background: #38bdf8; border-radius: 8px; }
|
|
6
|
+
.t { position: absolute; left: 80px; font-size: 36px; font-weight: 700; white-space: nowrap; }
|
|
7
|
+
.row { position: absolute; left: 80px; top: 360px; width: 600px; height: 100px; }
|
|
8
|
+
.row .box { top: 10px; }
|
|
9
|
+
.btn { position: absolute; left: 900px; top: 560px; width: 200px; height: 56px; background: #f43f5e; border-radius: 28px; font: 700 24px sans-serif; display: flex; align-items: center; justify-content: center; }
|
|
10
|
+
.layer { position: absolute; inset: 0; }
|
|
11
|
+
.cursor { position: absolute; width: 32px; height: 32px; background: #fff; clip-path: polygon(12.5% 8.3%, 12.5% 79%, 33% 60%, 48% 92%, 60% 86%, 46% 55%, 75% 54%); }
|
|
12
|
+
</style></head><body>
|
|
13
|
+
<div class="box" data-mosio-id="physics/streak" style="left:0;top:40px"></div>
|
|
14
|
+
<div class="t" data-mosio-id="physics/drift" style="top:160px;opacity:0">Words drifting across the screen</div>
|
|
15
|
+
<div class="t" data-mosio-id="physics/bounce" style="top:260px;opacity:0">Launch day</div>
|
|
16
|
+
<div class="row" data-mosio-id="physics/row">
|
|
17
|
+
<div class="box" data-mosio-id="physics/row-a" style="left:0"></div>
|
|
18
|
+
<div class="box" data-mosio-id="physics/row-b" style="left:160px"></div>
|
|
19
|
+
<div class="box" data-mosio-id="physics/row-c" style="left:320px"></div>
|
|
20
|
+
</div>
|
|
21
|
+
<div class="btn" data-mosio-id="physics/subscribe">Subscribe</div>
|
|
22
|
+
<div class="layer" data-mosio-id="physics/layer"><div class="cursor" data-mp="cursor" data-mosio-id="physics/cursor"></div></div>
|
|
23
|
+
<script>
|
|
24
|
+
const tl = gsap.timeline({ paused: true });
|
|
25
|
+
const $ = (id) => '[data-mosio-id="physics/' + id + '"]';
|
|
26
|
+
// 1100 px in 9 frames (about 122 px per frame, limit 64) with no blur
|
|
27
|
+
tl.fromTo($("streak"), { x: 0 }, { x: 1100, duration: 0.3, ease: "none" }, 0.2);
|
|
28
|
+
// a five-word line legible for 3.6 s while it drifts 100 px/s the whole time
|
|
29
|
+
tl.fromTo($("drift"), { opacity: 0 }, { opacity: 1, duration: 0.1, ease: "none" }, 0);
|
|
30
|
+
tl.fromTo($("drift"), { x: 0 }, { x: 380, duration: 3.8, ease: "none" }, 0);
|
|
31
|
+
tl.to($("drift"), { opacity: 0, duration: 0.1, ease: "none" }, 3.7);
|
|
32
|
+
// back.out written as a function, so the static lint cannot see it: overshoots about 10 %
|
|
33
|
+
const backOut = (p) => 1 + 2.70158 * Math.pow(p - 1, 3) + 1.70158 * Math.pow(p - 1, 2);
|
|
34
|
+
tl.fromTo($("bounce"), { y: 80, opacity: 0 }, { y: 0, opacity: 1, duration: 0.6, ease: backOut }, 0.5);
|
|
35
|
+
// two items rise from below, the third slides in from the left, in the same beat
|
|
36
|
+
tl.fromTo($("row-a"), { y: 60, opacity: 0 }, { y: 0, opacity: 1, duration: 0.5, ease: "power3.out" }, 1.0);
|
|
37
|
+
tl.fromTo($("row-b"), { y: 60, opacity: 0 }, { y: 0, opacity: 1, duration: 0.5, ease: "power3.out" }, 1.05);
|
|
38
|
+
tl.fromTo($("row-c"), { x: -120, opacity: 0 }, { x: 0, opacity: 1, duration: 0.5, ease: "power3.out" }, 1.1);
|
|
39
|
+
// the click point was taken before the button moved: the tip presses 50 px right of its right edge (1100)
|
|
40
|
+
const cur = $("cursor");
|
|
41
|
+
gsap.set(cur, { transformOrigin: "12.5% 8.3%", xPercent: -12.5, yPercent: -8.3, left: 200, top: 650 });
|
|
42
|
+
tl.fromTo(cur, { left: 200, top: 650 }, { left: 1150, top: 588, duration: 0.8, ease: "power2.inOut", immediateRender: false }, 2.6);
|
|
43
|
+
tl.fromTo(cur, { scale: 1 }, { scale: 0.85, duration: 0.1, ease: "power2.in", yoyo: true, repeat: 1, immediateRender: false }, 3.5);
|
|
44
|
+
tl.fromTo($("subscribe"), { scale: 1 }, { scale: 0.95, duration: 0.1, ease: "power2.in", yoyo: true, repeat: 1, immediateRender: false }, 3.5);
|
|
45
|
+
__mosio.timeline(tl);
|
|
46
|
+
</script>
|
|
47
|
+
</body></html>
|
package/package.json
CHANGED
package/primitives/README.md
CHANGED
|
@@ -13,6 +13,7 @@ so they render the same on every machine: no randomness, no endless repeats, no
|
|
|
13
13
|
| Transition | `iris` `zoom-through` `blur-swap` `dip-to-color` `whip-pan` `shape-wipe` `split-screen` `glitch-cut` |
|
|
14
14
|
| Commerce | `receipt-print` `voucher-ticket` `qr-pay-scan` `order-tracker` `product-callouts` `rating-summary` `price-drop` `review-card-stack` `loyalty-stamp-card` `bundle-builder` `product-grid-reveal` `variant-picker` `store-location-pin` `open-sign-flip` `payment-methods-row` `scroll-menu-phone` `glass-price-card` `before-after-wipe` `split-screen-compare` `step-explainer` `chat-review-typed` `flash-sale-burst` `menu-price-board` (see below) |
|
|
15
15
|
| Particles | `confetti-burst` `confetti-rain` `sparks` `snow` `dust-drift` `smoke-puff` (canvas 2D, closed form; see below) |
|
|
16
|
+
| Character | `stick-figure` `impact-burst` (see below) |
|
|
16
17
|
|
|
17
18
|
Rules for picking and tuning them (ease per role, stagger, exit, hold formula): [`skills/mosio-engine/references/timing.md`](../skills/mosio-engine/references/timing.md).
|
|
18
19
|
|
|
@@ -32,8 +33,9 @@ node scripts/prim.mjs install my-video rise,pop # copies shared/{mosio-prims.js
|
|
|
32
33
|
__mosio.timeline(tl);
|
|
33
34
|
</script>
|
|
34
35
|
```
|
|
35
|
-
Every call returns `{ at, end, entrance_end, exit_at, hold_s }`, so the next primitive can start where the last one ends. `
|
|
36
|
-
|
|
36
|
+
Every call returns `{ at, end, entrance_end, exit_at, hold_s }`, so the next primitive can start where the last one ends. `install` sizes
|
|
37
|
+
`tokens.css` for the project's canvas, and copies and declares Inter when it finds it (`--fonts-from DIR`, `$MOSIO_FONT_DIR`);
|
|
38
|
+
without it `prim.css` carries no `@font-face`, so set `--font-display` / `--font-body` to the project's fonts.
|
|
37
39
|
|
|
38
40
|
## Reels, stacks and maps
|
|
39
41
|
`slot-machine-roll` turns the characters of `[data-mp=value]` into vertical reels (`charset`: `digits`, `letters`, `alnum` or your own list) that start together, stop `stagger` apart and settle with a small overshoot; characters outside the charset stay still. `notification-stack` slides phone-style cards in from the top (pass `items`, or write `.mp-notif` cards in the HTML), `interval` apart, and compresses the older ones behind the newest (`maxVisible`); `clear` slides the stack back out at the end. `indonesia-map` draws the 33 provinces from simplified Natural Earth shapes and lights the provinces of `highlight` (ISO 3166-2:ID codes) in turn, with optional pins and `values`. Source, version and the simplification: [`indonesia-map/README.md`](indonesia-map/README.md). All three are closed form on the frame clock: no randomness, no wall clock.
|
|
@@ -76,6 +78,25 @@ Typed vars (see `node scripts/prim.mjs show snow`): `seed`, `count`, `colors` (t
|
|
|
76
78
|
with the canvas. Caps: `count` above 4000 (150 for `smoke-puff`) throws `E_PRIM_VAR`; `mosio check` warns (`W_PARTICLES_BUDGET`) when the effects of one scene add
|
|
77
79
|
up to more than 2000. Details, the model and the performance budget: [`docs/PARTICLES.md`](../docs/PARTICLES.md).
|
|
78
80
|
|
|
81
|
+
## Characters
|
|
82
|
+
`stick-figure` is a rigged stickman driven by timed acts: `run`/`walk` arrive at `until`, a `jump` takes off at `at` and lands at
|
|
83
|
+
`until`, a `strike` (`punch`, `kick`, `uppercut`) makes contact at `at`, `hit`, `block`, `roll`, `fall`, `get_up`, named poses and faces.
|
|
84
|
+
The craft is built in: a wind-up or crouch before the action, a two-frame snap into contact and a short hold, head and arms trailing
|
|
85
|
+
the body by `overlap` frames, squash on landing and stretch on take-off, the lower foot kept on the floor, a contact shadow, and the far
|
|
86
|
+
limbs drawn dimmer for depth. Joint angles live on `rig.state`, so a custom move is a GSAP tween of those numbers. `impact-burst` is the
|
|
87
|
+
contact frame of a hit: put it, the sound and the camera shake on the `contact` time a strike returns in `times`. Lengths are 1080p design
|
|
88
|
+
px (the shorter side of the box is 1080), so the same acts fit any output size. Directing them: `skills/mosio-engine/references/character.md`.
|
|
89
|
+
```html
|
|
90
|
+
<div class="stage" data-mosio-id="fight/hero"></div><div class="stage" data-mosio-id="fight/fx"></div>
|
|
91
|
+
<script>
|
|
92
|
+
const tl = gsap.timeline({ paused: true });
|
|
93
|
+
const hero = MosioPrims.stickFigure(tl, '[data-mosio-id="fight/hero"]', { x: 200, ground: 860, acts: [
|
|
94
|
+
{ at: 0.2, run: { to: 620, until: 1.1 } }, { at: 1.6, strike: 'punch', lunge: 40 } ] });
|
|
95
|
+
MosioPrims.impactBurst(tl, '[data-mosio-id="fight/fx"]', { at: hero.times[1].contact, point: [52, 55] });
|
|
96
|
+
__mosio.timeline(tl);
|
|
97
|
+
</script>
|
|
98
|
+
```
|
|
99
|
+
|
|
79
100
|
## Layout of a primitive
|
|
80
101
|
```text
|
|
81
102
|
primitives/<id>/primitive.json manifest (mosio.primitive/1): typed vars + defaults, parts, timing, tokens, use_when, avoid_when, pairs_with, usage, golden frames
|