huashu-motion 0.1.0 → 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.
Files changed (47) hide show
  1. package/README.en.md +166 -5
  2. package/README.md +167 -6
  3. package/THIRD_PARTY.md +1 -0
  4. package/cli/lib/capture.js +1 -1
  5. package/cli/lib/cdp.js +9 -1
  6. package/cli/lib/check.js +13 -0
  7. package/cli/lib/composed.js +2 -2
  8. package/cli/lib/composer.js +33 -12
  9. package/cli/lib/grab.js +239 -0
  10. package/cli/lib/qa.js +53 -1
  11. package/cli/lib/render-om.js +3 -1
  12. package/cli/lib/render.js +6 -4
  13. package/cli/lib/share.js +101 -0
  14. package/cli/lib/sound.js +4 -0
  15. package/cli/lib/soundprint.js +72 -0
  16. package/cli/lib/swatch.js +7 -3
  17. package/cli/om.js +22 -3
  18. package/package.json +2 -2
  19. package/runtime/om-engine.js +129 -1
  20. package/runtime/om.js +180 -1
  21. package/runtime/three/LICENSE +21 -0
  22. package/runtime/three/entry.js +19 -0
  23. package/runtime/three/om-three.js +280 -0
  24. package/runtime/three/three.min.js +4586 -0
  25. package/skills/huashu-motion/SKILL.md +65 -5
  26. package/skills/huashu-motion/references/about-author.md +101 -0
  27. package/skills/huashu-motion/references/colour.md +16 -11
  28. package/skills/huashu-motion/references/contract.md +27 -1
  29. package/skills/huashu-motion/references/depth.md +109 -0
  30. package/skills/huashu-motion/references/director.md +27 -9
  31. package/skills/huashu-motion/references/library/README.md +1 -1
  32. package/skills/huashu-motion/references/library/languages/3d-object.md +5 -3
  33. package/skills/huashu-motion/references/library/techniques.md +4 -2
  34. package/skills/huashu-motion/references/music.md +411 -0
  35. package/skills/huashu-motion/references/punch-up.md +108 -0
  36. package/skills/huashu-motion/references/scores/first-light.abc +1 -1
  37. package/skills/huashu-motion/references/scores/four-rooms.abc +1 -1
  38. package/skills/huashu-motion/references/sound.md +5 -3
  39. package/templates/object-3d/assets/comment.svg +1 -0
  40. package/templates/object-3d/assets/cursor.svg +1 -0
  41. package/templates/object-3d/assets/studio.jpg +0 -0
  42. package/templates/object-3d/index.html +163 -0
  43. package/templates/object-3d/materials.md +6 -0
  44. package/templates/object-3d/template.json +23 -0
  45. package/templates/ui-space/index.html +150 -0
  46. package/templates/ui-space/materials.md +6 -0
  47. package/templates/ui-space/template.json +22 -0
@@ -0,0 +1,163 @@
1
+ <!doctype html>
2
+ <html lang="zh-CN" data-composition-variables='[
3
+ {"id":"screen","type":"string","label":"屏幕截图(真实界面)","default":"assets/studio.jpg"},
4
+ {"id":"cursorSvg","type":"string","label":"光标 / 标志 SVG","default":"assets/cursor.svg"},
5
+ {"id":"bubbleSvg","type":"string","label":"气泡 SVG","default":"assets/comment.svg"},
6
+ {"id":"comment","type":"string","label":"气泡里的话","default":"标题再大一点"},
7
+ {"id":"title","type":"string","label":"标题","default":"huashu-motion"},
8
+ {"id":"subtitle","type":"string","label":"副标题","default":"对着画面指一下,就能改"},
9
+ {"id":"paper","type":"color","label":"影棚底色","default":"#efece6"},
10
+ {"id":"ink","type":"color","label":"文字色","default":"#1d1b18"},
11
+ {"id":"accent","type":"color","label":"强调色","default":"#d9480f"},
12
+ {"id":"body","type":"color","label":"机身颜色","default":"#1d1b18"},
13
+ {"id":"endHold","type":"number","label":"结尾停留(秒)","default":1.4,"min":0,"max":10,"step":0.1,"group":"节奏"}
14
+ ]'>
15
+ <head>
16
+ <meta charset="utf-8">
17
+ <title>huashu-motion · object-3d</title>
18
+ <script src="vendor/gsap.min.js"></script>
19
+ <script src="vendor/three.min.js"></script>
20
+ <script src="vendor/om.js"></script>
21
+ <script src="vendor/om-three.js"></script>
22
+ <style id="om-fonts">
23
+ @font-face { font-family: "Inter"; src: url("assets/fonts/Inter-var.woff") format("woff"); font-weight: 100 900; }
24
+ @font-face { font-family: "Noto Sans SC"; src: url("assets/fonts/NotoSansSC-700.woff") format("woff"); font-weight: 700; }
25
+ </style>
26
+ <style>
27
+ html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: var(--paper); }
28
+ #film { position: relative; width: 1920px; height: 1080px; overflow: hidden; background: var(--paper); color: var(--ink); font-family: "Inter", "Noto Sans SC", sans-serif; }
29
+ #gl { position: absolute; inset: 0; width: 1920px; height: 1080px; display: block; }
30
+ .type { position: absolute; left: 150px; top: 380px; width: 900px; }
31
+ .type h1 { margin: 0; white-space: nowrap; font-size: 112px; line-height: 1; letter-spacing: -5px; font-weight: 750; }
32
+ .type p { margin: 34px 0 0; font-family: "Noto Sans SC", sans-serif; font-weight: 700; font-size: 50px; line-height: 1.25; }
33
+ .type .bar { width: 120px; height: 10px; background: var(--accent); margin-bottom: 44px; transform-origin: 0 50%; }
34
+ </style>
35
+ </head>
36
+ <body>
37
+ <!--
38
+ A real product object in a lit studio, one continuous camera (OM.space) and a WebGL layer driven by the
39
+ timeline (OM3.film). Type stays in the DOM: sharp, editable, pickable.
40
+ Swap the screenshot, the SVGs and the colours for the product's own — never placeholders.
41
+ -->
42
+ <div id="film" data-composition-id="film" data-width="1920" data-height="1080">
43
+ <canvas id="gl" width="1920" height="1080" data-om-id="scene"></canvas>
44
+ <div class="type" data-om-id="type">
45
+ <div class="bar" data-om-id="bar"></div>
46
+ <h1 data-om-id="title" data-var-text="title">huashu-motion</h1>
47
+ <p data-om-id="subtitle" data-var-text="subtitle">对着画面指一下,就能改</p>
48
+ </div>
49
+ </div>
50
+
51
+ <script>
52
+ const V = OM.vars();
53
+ const D = 10.2 + V.endHold;
54
+
55
+ // ---------- the studio ----------
56
+ const stage = OM3.stage(document.getElementById('gl'), { background: V.paper, fov: 30, dof: { aperture: 0.0022, maxblur: 0.009 }, exposure: 1.05 });
57
+ OM3.lights(stage, { span: 9 });
58
+ OM3.cyc(stage, { color: V.paper, y: 0, depth: 34, radius: 9, z: -2 });
59
+
60
+ // the product: its real interface on a floating device
61
+ const SW = 4.8, SH = SW / 1.6, CY = 2.5; // screen size (the screenshot is 16:10) and centre height
62
+ const device = OM3.screen(V.screen, { width: SW, aspect: 1.6, bezel: 0.07, depth: 0.12, radius: 0.12, body: V.body });
63
+ device.position.set(0, CY, 0);
64
+ stage.add(device);
65
+ // depth around it: two panels lifted out of the same screenshot, at different distances, so every camera
66
+ // move shows parallax (crop: left, top, right, bottom of the image, 0–1)
67
+ const panelA = OM3.screen(V.screen, { width: 1.6, crop: [0.8, 0.05, 1, 0.42], bezel: 0, depth: 0.03, radius: 0.04 });
68
+ panelA.position.set(3.7, CY + 1.0, -1.7); panelA.rotation.set(0, -0.42, 0);
69
+ const panelB = OM3.screen(V.screen, { width: 3.6, crop: [0, 0.865, 0.62, 1], bezel: 0, depth: 0.03, radius: 0.04 });
70
+ panelB.position.set(-2.4, 0.75, 1.9); panelB.rotation.set(-0.5, 0.35, 0);
71
+ stage.add(panelA, panelB);
72
+ const FRONT = 0.12 / 2 + 0.004;
73
+ // a point on the screen, from where it is in the screenshot (0–1 across, 0–1 down)
74
+ const onScreen = (u, v) => new THREE.Vector3((u - 0.5) * SW, CY + (0.5 - v) * SW / 1.6, FRONT);
75
+ const CLICK = onScreen(0.415, 0.735); // the film's title in the studio preview
76
+
77
+ // the cursor: the studio's own select tool, extruded; its tip is at (5, 3) of a 24-unit icon whose box is 5–19 × 3–19
78
+ const CUR = 0.62, k = CUR / 16, cursor = new THREE.Group();
79
+ const curMesh = OM3.logo(V.cursorSvg, { size: CUR, depth: 0.12, bevel: 0.02, roughness: 0.25, metalness: 0.05 });
80
+ curMesh.position.set(7 * k, -8 * k, 0.08); // move the tip to the group's origin
81
+ cursor.add(curMesh);
82
+ stage.add(cursor);
83
+
84
+ // the comment bubble, with the note written on its face
85
+ const bubble = new THREE.Group(), bubbleMesh = OM3.logo(V.bubbleSvg, { size: 0.92, depth: 0.16, bevel: 0.03, roughness: 0.35 });
86
+ bubble.add(bubbleMesh);
87
+ const note = document.createElement('canvas'); note.width = 1024; note.height = 512;
88
+ const noteTex = new THREE.CanvasTexture(note); noteTex.colorSpace = THREE.SRGBColorSpace; noteTex.anisotropy = 8;
89
+ OM3.ready(document.fonts.load('700 120px "Noto Sans SC"').then(() => {
90
+ const g = note.getContext('2d'); g.fillStyle = '#fff'; g.textAlign = 'center'; g.textBaseline = 'middle';
91
+ let fs = 132; g.font = `700 ${fs}px "Noto Sans SC"`;
92
+ while (g.measureText(V.comment).width > 900 && fs > 40) { fs -= 6; g.font = `700 ${fs}px "Noto Sans SC"`; }
93
+ g.fillText(V.comment, 512, 256); noteTex.needsUpdate = true;
94
+ }));
95
+ const label = new THREE.Mesh(new THREE.PlaneGeometry(0.98, 0.49), new THREE.MeshBasicMaterial({ map: noteTex, transparent: true, toneMapped: false }));
96
+ label.position.set(0, 0.1, 0.13);
97
+ bubble.add(label);
98
+ const BUB = CLICK.clone().add(new THREE.Vector3(0.95, 1.15, 0.75)); // up and to the right: the clicked title stays in view
99
+ bubble.position.copy(BUB);
100
+ stage.add(bubble);
101
+
102
+ // the click: a ring on the glass
103
+ const ring = new THREE.Mesh(new THREE.RingGeometry(0.1, 0.13, 64), new THREE.MeshBasicMaterial({ color: V.accent, transparent: true, toneMapped: false }));
104
+ ring.position.copy(CLICK).add(new THREE.Vector3(0, 0, 0.004));
105
+ stage.add(ring);
106
+
107
+ OM3.region('device', device, stage, '设备与截图');
108
+ OM3.region('cursor', cursor, stage, '光标');
109
+ OM3.region('bubble', bubble, stage, '留言气泡');
110
+
111
+ // ---------- one camera ----------
112
+ const tl = gsap.timeline({ paused: true, defaults: { ease: 'power3.out' } });
113
+ const C = new THREE.Vector3(0, CY, 0);
114
+ const cam = OM.space(stage.camera, { fov: 30 });
115
+ // 0 s: low, close and swinging — the first second already moves a lot
116
+ cam.set({ target: [CLICK.x + 0.4, CLICK.y + 0.5, 0], distance: 3.6, yaw: -52, pitch: -6, roll: 5 });
117
+ tl.addLabel('scene:reveal', 0);
118
+ cam.to(tl, 0, { target: [C.x, C.y, 0], distance: 9.6, yaw: -24, pitch: 7, roll: 0, duration: 1.7, ease: 'expo.out' });
119
+ cam.to(tl, 1.7, { yaw: -12, distance: 8.6, duration: 1.3, ease: 'sine.inOut' });
120
+ // 3.0 s: push into the note (the focus follows the target)
121
+ tl.addLabel('scene:point', 2.2);
122
+ cam.to(tl, 3.15, { target: [BUB.x - 0.1, BUB.y, BUB.z], distance: 3.0, yaw: 14, pitch: 4, duration: 1.15, ease: 'expo.inOut' });
123
+ cam.to(tl, 4.3, { distance: 2.75, yaw: 20, duration: 1.5, ease: 'sine.inOut' });
124
+ // 5.8 s: crane up and swing round the whole object
125
+ tl.addLabel('scene:space', 5.8);
126
+ cam.to(tl, 5.8, { target: [C.x, C.y - 0.3, 0], distance: 15, yaw: 42, pitch: 26, duration: 1.9, ease: 'expo.inOut' });
127
+ // 7.7 s: land on the hero frame, object right, type left
128
+ tl.addLabel('scene:end', 7.7);
129
+ cam.to(tl, 7.7, { target: [C.x - 2.75, C.y - 0.1, 0], distance: 12.6, yaw: 20, pitch: 5, duration: 1.6, ease: 'expo.inOut' });
130
+
131
+ // ---------- the objects' motion (plain tweens on plain values; the clock renders them) ----------
132
+ const m = { cx: CLICK.x + 3.4, cy: CLICK.y + 1.9, cz: 1.5, tilt: 0, press: 0, ring: 0, pop: 0, spin: 0, float: 0 };
133
+ tl.fromTo(m, { cx: CLICK.x + 3.4, cy: CLICK.y + 1.9, cz: 1.5 }, { cx: CLICK.x, cy: CLICK.y, cz: FRONT + 0.25, duration: 2.1, ease: 'expo.inOut' }, 0)
134
+ .to(m, { press: 1, duration: 0.12, ease: 'power2.in' }, 2.3)
135
+ .to(m, { press: 0, duration: 0.3, ease: 'power2.out' }, 2.42)
136
+ .fromTo(m, { ring: 0 }, { ring: 1, duration: 0.7, ease: 'expo.out' }, 2.36)
137
+ .fromTo(m, { pop: 0 }, { pop: 1, duration: 0.9, ease: OM.spring(0.35) }, 2.5)
138
+ .to(m, { cx: CLICK.x - 0.35, cy: CLICK.y - 0.45, cz: FRONT + 0.35, duration: 1.0, ease: 'power3.inOut' }, 2.9)
139
+ .fromTo(m, { spin: 0 }, { spin: 1, duration: D - 5.8, ease: 'none' }, 5.8)
140
+ .fromTo(m, { float: 0 }, { float: 1, duration: D, ease: 'none' }, 0);
141
+
142
+ OM3.film(stage, tl, D, cam, () => {
143
+ cursor.position.set(m.cx, m.cy, m.cz - m.press * 0.2);
144
+ cursor.rotation.set(-0.15, 0.35 - m.press * 0.2, 0.06);
145
+ ring.scale.setScalar(0.2 + m.ring * 2.2); ring.material.opacity = (1 - m.ring) * (m.ring > 0 ? 1 : 0);
146
+ bubble.scale.setScalar(Math.max(0.001, m.pop));
147
+ bubble.position.set(BUB.x, BUB.y + Math.sin(m.float * D * 1.6) * 0.035 * m.pop, BUB.z * m.pop + FRONT * (1 - m.pop));
148
+ bubble.rotation.y = -0.18 + Math.sin(m.float * D * 0.9) * 0.05;
149
+ device.rotation.y = -0.12 * m.spin;
150
+ panelA.position.y = CY + 1.0 + Math.sin(m.float * D * 0.7 + 1) * 0.06;
151
+ panelB.position.y = 0.75 + Math.sin(m.float * D * 0.6) * 0.05;
152
+ });
153
+
154
+ // ---------- type ----------
155
+ tl.fromTo('.type .bar', { scaleX: 0 }, { scaleX: 1, duration: 0.8, ease: 'expo.inOut' }, 8.3)
156
+ .fromTo('.type h1', { opacity: 0, y: 40 }, { opacity: 1, y: 0, duration: 0.9, ease: 'expo.out' }, 8.45)
157
+ .fromTo('.type p', { opacity: 0, y: 30 }, { opacity: 1, y: 0, duration: 0.8, ease: 'expo.out' }, 8.7)
158
+ .to({}, { duration: 0 }, D);
159
+
160
+ window.__timelines['film'] = tl;
161
+ </script>
162
+ </body>
163
+ </html>
@@ -0,0 +1,6 @@
1
+ # Materials — where every piece comes from
2
+
3
+ - `studio.jpg` — a screenshot of the huashu-motion studio (`om studio examples/showcase`), 1600×1000 at 2×.
4
+ - `cursor.svg`, `comment.svg` — the studio's own select and comment tool icons (`studio/index.html`), in its ink and accent colours (`studio/studio.css`).
5
+
6
+ Swap in your product's: a screenshot (or several), its logo as an SVG, its colours. Keep this list current (`materials.md` in a film).
@@ -0,0 +1,23 @@
1
+ {
2
+ "title": "3D object in a studio (Three.js)",
3
+ "summary": "The product's real things as objects in a lit studio — its screenshot on a floating device, its logo or icon SVG extruded — with one continuous camera: a low swinging reveal, a push into a detail with the focus following, a crane round the whole object, a hero frame with type.",
4
+ "best_for": [
5
+ "a premium launch or a hero shot",
6
+ "a logo, an icon or a device as a real object",
7
+ "strong camera moves through a space",
8
+ "a first second that already moves"
9
+ ],
10
+ "aspect": "16:9",
11
+ "copy": {
12
+ "templates/blank/vendor/gsap.min.js": "vendor/gsap.min.js",
13
+ "templates/blank/vendor/GSAP-LICENSE.txt": "vendor/GSAP-LICENSE.txt",
14
+ "templates/blank/vendor/GSAP-LICENSE.html": "vendor/GSAP-LICENSE.html",
15
+ "runtime/three/three.min.js": "vendor/three.min.js",
16
+ "runtime/three/LICENSE": "vendor/THREE-LICENSE.txt",
17
+ "runtime/three/om-three.js": "vendor/om-three.js",
18
+ "fonts/Inter-var.woff": "assets/fonts/Inter-var.woff",
19
+ "fonts/NotoSansSC-700.woff": "assets/fonts/NotoSansSC-700.woff",
20
+ "fonts/OFL.txt": "assets/fonts/OFL.txt",
21
+ "fonts/LICENSES.md": "assets/fonts/LICENSES.md"
22
+ }
23
+ }
@@ -0,0 +1,150 @@
1
+ <!doctype html>
2
+ <html lang="zh-CN" data-composition-variables='[
3
+ {"id":"screen","type":"string","label":"界面截图(真实界面,1600×1000 的 2 倍图)","default":"assets/studio.jpg"},
4
+ {"id":"comment","type":"string","label":"留言","default":"标题再大一点"},
5
+ {"id":"reply","type":"string","label":"Agent 回复","default":"已改:标题 96 → 132 px"},
6
+ {"id":"title","type":"string","label":"标题","default":"huashu-motion"},
7
+ {"id":"subtitle","type":"string","label":"副标题","default":"对着画面指一下,就能改"},
8
+ {"id":"paper","type":"color","label":"底色","default":"#f6f5f2"},
9
+ {"id":"ink","type":"color","label":"文字色","default":"#1d1b18"},
10
+ {"id":"accent","type":"color","label":"强调色","default":"#d9480f"},
11
+ {"id":"green","type":"color","label":"完成色","default":"#2f855a"},
12
+ {"id":"endHold","type":"number","label":"结尾停留(秒)","default":1.4,"min":0,"max":10,"step":0.1,"group":"节奏"}
13
+ ]'>
14
+ <head>
15
+ <meta charset="utf-8">
16
+ <title>huashu-motion · ui-space</title>
17
+ <script src="vendor/gsap.min.js"></script>
18
+ <script src="vendor/om.js"></script>
19
+ <style id="om-fonts">
20
+ @font-face { font-family: "Inter"; src: url("assets/fonts/Inter-var.woff") format("woff"); font-weight: 100 900; }
21
+ @font-face { font-family: "Noto Sans SC"; src: url("assets/fonts/NotoSansSC-700.woff") format("woff"); font-weight: 700; }
22
+ @font-face { font-family: "Noto Sans SC"; src: url("assets/fonts/NotoSansSC-500.woff") format("woff"); font-weight: 500; }
23
+ </style>
24
+ <style>
25
+ html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: var(--paper); }
26
+ #film { position: relative; width: 1920px; height: 1080px; overflow: hidden; color: var(--ink); font-family: "Inter", "Noto Sans SC", sans-serif;
27
+ background: radial-gradient(1400px 900px at 50% 40%, #fffdf9, var(--paper) 70%); }
28
+ /* the world: every layer is placed in it with translate3d / rotate; the camera (OM.space) moves the world */
29
+ #world, #world * { transform-style: preserve-3d; }
30
+ #app { position: absolute; left: 160px; top: 40px; width: 1600px; height: 1000px; }
31
+ /* the real interface, cut into layers by background-position: one capture, no extra files */
32
+ .shot { position: absolute; background-image: var(--shot); background-size: 1600px 1000px; }
33
+ .base { left: 0; top: 0; width: 1600px; height: 1000px; border-radius: 14px; box-shadow: 0 60px 120px -40px #1d1b1855, 0 0 0 1px #00000014; }
34
+ .hole { position: absolute; }
35
+ .layer { position: absolute; border-radius: 8px; box-shadow: 0 40px 80px -30px #1d1b1866, 0 0 0 1px #0000001a; }
36
+ #stage { left: 48px; top: 48px; width: 1232px; height: 819px; background-position: -48px -48px; }
37
+ #inspector { left: 1281px; top: 48px; width: 319px; height: 819px; background-position: -1281px -48px; }
38
+ #timeline { left: 0; top: 868px; width: 1600px; height: 132px; background-position: 0 -868px; border-radius: 0 0 14px 14px; }
39
+ /* rebuilt in code: the studio's comment, sharp at any distance, editable, pickable */
40
+ .pin { position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 6px #ffffff, 0 10px 24px #0005; }
41
+ .card { position: absolute; width: 420px; padding: 22px 26px 24px; border-radius: 16px; background: #fff; box-shadow: 0 40px 70px -24px #1d1b1870, 0 0 0 1px #0000000f; font-family: "Noto Sans SC", sans-serif; }
42
+ .card .who { font: 600 17px/1 "Inter", sans-serif; color: #6f695f; letter-spacing: .5px; display: flex; gap: 10px; align-items: center; }
43
+ .card .who i { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
44
+ .card .say { margin-top: 14px; font-weight: 700; font-size: 38px; line-height: 1.2; }
45
+ .card .done { margin-top: 18px; display: inline-flex; gap: 10px; align-items: center; padding: 9px 16px; border-radius: 99px; background: #e3f3e9; color: #276749; font-weight: 500; font-size: 22px; }
46
+ .card .done b { font: 700 22px "Inter"; }
47
+ .ring { position: absolute; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; border: 5px solid var(--accent); }
48
+ .cursor { position: absolute; width: 74px; height: 74px; margin: -8px 0 0 -14px; filter: drop-shadow(0 14px 14px #0004); }
49
+ .type { position: absolute; left: 1960px; top: 360px; width: 900px; }
50
+ .type .bar { width: 130px; height: 12px; background: var(--accent); margin-bottom: 48px; transform-origin: 0 50%; }
51
+ .type h1 { margin: 0; white-space: nowrap; font-size: 140px; line-height: 1; letter-spacing: -6px; font-weight: 760; }
52
+ .type p { margin: 40px 0 0; font-family: "Noto Sans SC", sans-serif; font-weight: 700; font-size: 66px; line-height: 1.25; }
53
+ #endframe { position: absolute; left: 120px; top: 40px; width: 3060px; height: 1000px; pointer-events: none; }
54
+ </style>
55
+ </head>
56
+ <body>
57
+ <!--
58
+ Interface in space: a real screenshot cut into layers that lift apart in depth, pieces rebuilt in code where
59
+ they have to change or stay sharp, one continuous 3D camera (OM.space) that ends on the flat layout.
60
+ Swap the capture and the colours for the product's own; rebuild what moves, never draw placeholder UI.
61
+ -->
62
+ <div id="film" data-composition-id="film" data-width="1920" data-height="1080">
63
+ <div id="world">
64
+ <div id="app" data-om-id="app">
65
+ <div class="shot base" data-om-id="base"></div>
66
+ <!-- where the layers were: the panels' own empty colours, so a lifted layer leaves its slot behind -->
67
+ <div class="hole" style="left:48px;top:48px;width:1232px;height:819px;background:#26241f"></div>
68
+ <div class="hole" style="left:1281px;top:48px;width:319px;height:819px;background:#fff"></div>
69
+ <div class="hole" style="left:0;top:868px;width:1600px;height:132px;background:#fff;border-radius:0 0 14px 14px"></div>
70
+ <div class="shot layer" id="timeline" data-om-id="timeline"></div>
71
+ <div class="shot layer" id="inspector" data-om-id="inspector"></div>
72
+ <div class="shot layer" id="stage" data-om-id="stage">
73
+ <div class="ring" id="ring"></div>
74
+ <div class="pin" id="pin" data-om-id="pin"></div>
75
+ <div class="card" id="card" data-om-id="card">
76
+ <div class="who"><i></i>你 · 刚刚</div>
77
+ <div class="say" data-var-text="comment">标题再大一点</div>
78
+ <div class="done" id="done" data-om-id="done"><b>✓</b><span data-var-text="reply">已改:标题 96 → 132 px</span></div>
79
+ </div>
80
+ <svg class="cursor" id="cursor" viewBox="0 0 24 24" data-om-id="cursor"><path fill="#1d1b18" stroke="#fff" stroke-width="1.2" stroke-linejoin="round" d="M5 3l14 8-6 1.5L10 19z"/></svg>
81
+ </div>
82
+ </div>
83
+ <div class="type" data-om-id="type">
84
+ <div class="bar"></div>
85
+ <h1 data-om-id="title" data-var-text="title">huashu-motion</h1>
86
+ <p data-om-id="subtitle" data-var-text="subtitle">对着画面指一下,就能改</p>
87
+ </div>
88
+ <div id="endframe"></div>
89
+ </div>
90
+ </div>
91
+
92
+ <script>
93
+ const V = OM.vars();
94
+ document.getElementById('film').style.setProperty('--shot', `url("${V.screen}")`);
95
+ const D = 9.6 + V.endHold;
96
+ const tl = gsap.timeline({ paused: true, defaults: { ease: 'power3.out' } });
97
+
98
+ // the point you click: the film's title, in stage-layer pixels
99
+ const P = { x: 518, y: 703 };
100
+ gsap.set('#pin, #ring', { left: P.x, top: P.y });
101
+ gsap.set('#card', { left: P.x + 60, top: P.y - 330 });
102
+ gsap.set('#cursor', { left: P.x, top: P.y });
103
+
104
+ // ---------- the layers in depth ----------
105
+ // exploded: each layer stands off the base; they arrive from far in the first second, collapse at 6.2 s
106
+ const Z = { stage: 230, inspector: 420, timeline: 140 };
107
+ tl.addLabel('scene:explode', 0);
108
+ tl.fromTo('#stage', { z: 760 }, { z: Z.stage, duration: 1.3, ease: 'expo.out' }, 0)
109
+ .fromTo('#inspector', { z: 1000, x: 160 }, { z: Z.inspector, x: 0, duration: 1.5, ease: 'expo.out' }, 0.06)
110
+ .fromTo('#timeline', { z: 560, y: 120 }, { z: Z.timeline, y: 0, duration: 1.4, ease: 'expo.out' }, 0.12);
111
+
112
+ // ---------- one camera ----------
113
+ const cam = OM.space('#world', { fov: 38 });
114
+ cam.set({ target: [700, 600, 300], distance: 1250, yaw: -40, pitch: 28, roll: -5 });
115
+ cam.to(tl, 0, { target: [960, 540, 160], distance: 2050, yaw: -20, pitch: 14, roll: 0, duration: 1.8, ease: 'expo.out' });
116
+ cam.to(tl, 1.8, { yaw: 14, pitch: 9, distance: 1950, duration: 1.5, ease: 'sine.inOut' });
117
+
118
+ // ---------- point, comment, done ----------
119
+ tl.addLabel('scene:point', 2.6);
120
+ tl.fromTo('#cursor', { x: 520, y: -260, z: 260, opacity: 0 }, { x: 0, y: 0, z: 24, opacity: 1, duration: 1.0, ease: 'expo.inOut' }, 2.4)
121
+ .to('#cursor', { scale: 0.86, duration: 0.1, ease: 'power2.in' }, 3.4)
122
+ .to('#cursor', { scale: 1, duration: 0.25 }, 3.5)
123
+ .fromTo('#ring', { scale: 0.2, opacity: 1 }, { scale: 1.8, opacity: 0, duration: 0.8, ease: 'expo.out' }, 3.42)
124
+ .fromTo('#pin', { scale: 0 }, { scale: 1, duration: 0.6, ease: OM.spring(0.4) }, 3.45)
125
+ .fromTo('#card', { scale: 0.4, z: 0, opacity: 0, transformOrigin: '0% 100%' }, { scale: 1, z: 170, opacity: 1, duration: 0.8, ease: OM.spring(0.3) }, 3.55)
126
+ .to('#cursor', { x: -150, y: 120, z: 60, duration: 0.9, ease: 'power3.inOut' }, 3.9)
127
+ .fromTo('#done', { opacity: 0, y: 14 }, { opacity: 1, y: 0, duration: 0.5 }, 5.15);
128
+ // the camera follows: into the comment, the focus of the film
129
+ cam.to(tl, 3.45, { target: '#card', distance: 900, yaw: 6, pitch: 4, duration: 1.2, ease: 'expo.inOut' });
130
+ cam.to(tl, 4.65, { distance: 820, yaw: -4, duration: 1.4, ease: 'sine.inOut' });
131
+
132
+ // ---------- collapse to the flat interface, then the title ----------
133
+ tl.addLabel('scene:flat', 6.1);
134
+ tl.to('#stage', { z: 0, duration: 1.1, ease: 'expo.inOut' }, 6.1)
135
+ .to('#inspector', { z: 0, duration: 1.1, ease: 'expo.inOut' }, 6.16)
136
+ .to('#timeline', { z: 0, duration: 1.1, ease: 'expo.inOut' }, 6.22)
137
+ .to('#card', { z: 0, duration: 1.1, ease: 'expo.inOut' }, 6.1)
138
+ .to('#cursor', { z: 0, duration: 1.1, ease: 'expo.inOut' }, 6.1);
139
+ cam.to(tl, 6.1, { flat: true, duration: 1.2, ease: 'expo.inOut' });
140
+ tl.addLabel('scene:end', 7.5);
141
+ cam.to(tl, 7.5, { fit: '#endframe', pad: 0, duration: 1.3, ease: 'expo.inOut' });
142
+ tl.fromTo('.type .bar', { scaleX: 0 }, { scaleX: 1, duration: 0.8, ease: 'expo.inOut' }, 8.0)
143
+ .fromTo('.type h1', { opacity: 0, y: 40 }, { opacity: 1, y: 0, duration: 0.9, ease: 'expo.out' }, 8.1)
144
+ .fromTo('.type p', { opacity: 0, y: 30 }, { opacity: 1, y: 0, duration: 0.8, ease: 'expo.out' }, 8.35)
145
+ .to({}, { duration: 0 }, D);
146
+
147
+ window.__timelines['film'] = tl;
148
+ </script>
149
+ </body>
150
+ </html>
@@ -0,0 +1,6 @@
1
+ # Materials — where every piece comes from
2
+
3
+ - `studio.jpg` — a screenshot of the huashu-motion studio (`om studio examples/showcase`), 1600×1000 at 2×.
4
+ - `cursor.svg`, `comment.svg` — the studio's own select and comment tool icons (`studio/index.html`), in its ink and accent colours (`studio/studio.css`).
5
+
6
+ Swap in your product's: a screenshot (or several), its logo as an SVG, its colours. Keep this list current (`materials.md` in a film).
@@ -0,0 +1,22 @@
1
+ {
2
+ "title": "Interface in space (CSS 3D)",
3
+ "summary": "A real screenshot cut into layers that fly apart in depth, pieces rebuilt in code where they change, one continuous 3D camera that swings, pushes into a comment and settles on the flat interface, then pans to the title. Text stays sharp and pickable.",
4
+ "best_for": [
5
+ "a software product or an app launch",
6
+ "showing how an interface is built (layers, panels)",
7
+ "a first second that already moves",
8
+ "a UI tour without slides"
9
+ ],
10
+ "aspect": "16:9",
11
+ "copy": {
12
+ "templates/blank/vendor/gsap.min.js": "vendor/gsap.min.js",
13
+ "templates/blank/vendor/GSAP-LICENSE.txt": "vendor/GSAP-LICENSE.txt",
14
+ "templates/blank/vendor/GSAP-LICENSE.html": "vendor/GSAP-LICENSE.html",
15
+ "templates/object-3d/assets/studio.jpg": "assets/studio.jpg",
16
+ "fonts/Inter-var.woff": "assets/fonts/Inter-var.woff",
17
+ "fonts/NotoSansSC-500.woff": "assets/fonts/NotoSansSC-500.woff",
18
+ "fonts/NotoSansSC-700.woff": "assets/fonts/NotoSansSC-700.woff",
19
+ "fonts/OFL.txt": "assets/fonts/OFL.txt",
20
+ "fonts/LICENSES.md": "assets/fonts/LICENSES.md"
21
+ }
22
+ }