@blackbelt-technology/pi-dashboard-deck3d 0.0.0-stage → 0.9.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 (260) hide show
  1. package/.pi/skills/deck3d/SKILL.md +227 -0
  2. package/.pi/skills/deck3d/examples/deck.json +388 -0
  3. package/.pi/skills/deck3d/examples/fixture.md +18 -0
  4. package/.pi/skills/deck3d/examples/snapshot-after.png +0 -0
  5. package/.pi/skills/deck3d/examples/snapshot-before.png +0 -0
  6. package/.pi/skills/deck3d/reference/effects.agent.md +78 -0
  7. package/.pi/skills/deck3d/reference/effects.md +1217 -0
  8. package/.pi/skills/deck3d/reference/ir-fields.agent.md +30 -0
  9. package/.pi/skills/deck3d/reference/ir-fields.md +246 -0
  10. package/README.md +177 -2
  11. package/assets/LICENSE-Poppins.txt +99 -0
  12. package/assets/Poppins-Bold.ttf +0 -0
  13. package/assets/props/LICENSES.txt +4 -0
  14. package/assets/props/brain.glb +0 -0
  15. package/assets/props/cloud.glb +0 -0
  16. package/assets/props/cube.glb +0 -0
  17. package/assets/props/database.glb +0 -0
  18. package/assets/props/laptop.glb +0 -0
  19. package/assets/props/manifest.json +119 -0
  20. package/assets/props/robot.glb +0 -0
  21. package/assets/props/server.glb +0 -0
  22. package/assets/props/shield.glb +0 -0
  23. package/bin/deck3d +49 -0
  24. package/dist/cli.js +10228 -0
  25. package/dist/harvest/harness.js +185718 -0
  26. package/dist/runtime.js +64597 -0
  27. package/fixtures/business-2031/build-deck.mjs +60 -0
  28. package/fixtures/business-2031/build-overrides.mjs +154 -0
  29. package/fixtures/business-2031/deck.json +4220 -0
  30. package/fixtures/business-2031/deck.md +470 -0
  31. package/fixtures/business-2031/fx/closing-mark.js +43 -0
  32. package/fixtures/business-2031/fx/closing-mark.meta.json +26 -0
  33. package/fixtures/business-2031/overrides.json +903 -0
  34. package/fixtures/harvest.md +23 -0
  35. package/fixtures/strategy-lab.json +891 -0
  36. package/fixtures/strategy-lab.md +85 -0
  37. package/package.json +80 -4
  38. package/scripts/build-cli.mjs +29 -0
  39. package/scripts/build-harvest.ts +8 -0
  40. package/scripts/build-runtime.mjs +22 -0
  41. package/scripts/gen-effects.ts +14 -0
  42. package/scripts/gen-ir-fields.ts +34 -0
  43. package/src/check/index.ts +315 -0
  44. package/src/check/rules.ts +393 -0
  45. package/src/cli-io.ts +23 -0
  46. package/src/cli.ts +823 -0
  47. package/src/fx/accent-cycle.meta.json +26 -0
  48. package/src/fx/accent-cycle.ts +8 -0
  49. package/src/fx/agent-depth.meta.json +42 -0
  50. package/src/fx/agent-depth.ts +62 -0
  51. package/src/fx/ascii.meta.json +35 -0
  52. package/src/fx/ascii.ts +4 -0
  53. package/src/fx/aurora.meta.json +26 -0
  54. package/src/fx/aurora.ts +18 -0
  55. package/src/fx/billboards.meta.json +34 -0
  56. package/src/fx/billboards.ts +67 -0
  57. package/src/fx/bloom.meta.json +26 -0
  58. package/src/fx/bloom.ts +4 -0
  59. package/src/fx/camera-drift.meta.json +26 -0
  60. package/src/fx/camera-drift.ts +8 -0
  61. package/src/fx/capital-flows.meta.json +30 -0
  62. package/src/fx/capital-flows.ts +64 -0
  63. package/src/fx/catalogue.ts +89 -0
  64. package/src/fx/chromatic-aberration.meta.json +32 -0
  65. package/src/fx/chromatic-aberration.ts +4 -0
  66. package/src/fx/city-grid.meta.json +37 -0
  67. package/src/fx/city-grid.ts +51 -0
  68. package/src/fx/clipped-solids.meta.json +49 -0
  69. package/src/fx/clipped-solids.ts +171 -0
  70. package/src/fx/cohort-grid.meta.json +48 -0
  71. package/src/fx/cohort-grid.ts +63 -0
  72. package/src/fx/compose.ts +114 -0
  73. package/src/fx/constellation.meta.json +51 -0
  74. package/src/fx/constellation.ts +103 -0
  75. package/src/fx/curve-flow.meta.json +40 -0
  76. package/src/fx/curve-flow.ts +63 -0
  77. package/src/fx/dashed-flow.meta.json +27 -0
  78. package/src/fx/dashed-flow.ts +8 -0
  79. package/src/fx/data-columns.meta.json +30 -0
  80. package/src/fx/data-columns.ts +18 -0
  81. package/src/fx/defaults.ts +92 -0
  82. package/src/fx/depth-of-field.meta.json +40 -0
  83. package/src/fx/depth-of-field.ts +4 -0
  84. package/src/fx/dolly.meta.json +26 -0
  85. package/src/fx/dolly.ts +4 -0
  86. package/src/fx/dot-screen.meta.json +35 -0
  87. package/src/fx/dot-screen.ts +4 -0
  88. package/src/fx/dynamic-instances.meta.json +40 -0
  89. package/src/fx/dynamic-instances.ts +57 -0
  90. package/src/fx/emissive.meta.json +26 -0
  91. package/src/fx/emissive.ts +8 -0
  92. package/src/fx/extruded-shapes.meta.json +62 -0
  93. package/src/fx/extruded-shapes.ts +133 -0
  94. package/src/fx/fab-wafer.meta.json +42 -0
  95. package/src/fx/fab-wafer.ts +72 -0
  96. package/src/fx/fade.meta.json +26 -0
  97. package/src/fx/fade.ts +4 -0
  98. package/src/fx/film.meta.json +26 -0
  99. package/src/fx/film.ts +4 -0
  100. package/src/fx/float.meta.json +26 -0
  101. package/src/fx/float.ts +8 -0
  102. package/src/fx/flythrough.meta.json +26 -0
  103. package/src/fx/flythrough.ts +4 -0
  104. package/src/fx/fog.meta.json +26 -0
  105. package/src/fx/fog.ts +8 -0
  106. package/src/fx/geo-fragments.meta.json +48 -0
  107. package/src/fx/geo-fragments.ts +59 -0
  108. package/src/fx/glass.meta.json +26 -0
  109. package/src/fx/glass.ts +8 -0
  110. package/src/fx/globe-arcs.meta.json +36 -0
  111. package/src/fx/globe-arcs.ts +67 -0
  112. package/src/fx/glow-tube.meta.json +26 -0
  113. package/src/fx/glow-tube.ts +8 -0
  114. package/src/fx/glyph-rain.meta.json +30 -0
  115. package/src/fx/glyph-rain.ts +18 -0
  116. package/src/fx/god-rays.meta.json +40 -0
  117. package/src/fx/god-rays.ts +4 -0
  118. package/src/fx/grid-horizon.meta.json +30 -0
  119. package/src/fx/grid-horizon.ts +18 -0
  120. package/src/fx/hex-grid.meta.json +29 -0
  121. package/src/fx/hex-grid.ts +18 -0
  122. package/src/fx/holo-fresnel.meta.json +26 -0
  123. package/src/fx/holo-fresnel.ts +8 -0
  124. package/src/fx/horizon-gates.meta.json +36 -0
  125. package/src/fx/horizon-gates.ts +60 -0
  126. package/src/fx/index.ts +258 -0
  127. package/src/fx/iridescent.meta.json +26 -0
  128. package/src/fx/iridescent.ts +8 -0
  129. package/src/fx/iris.meta.json +26 -0
  130. package/src/fx/iris.ts +4 -0
  131. package/src/fx/lightformers.meta.json +26 -0
  132. package/src/fx/lightformers.ts +8 -0
  133. package/src/fx/local.ts +200 -0
  134. package/src/fx/market-tape.meta.json +53 -0
  135. package/src/fx/market-tape.ts +97 -0
  136. package/src/fx/matcap.meta.json +26 -0
  137. package/src/fx/matcap.ts +8 -0
  138. package/src/fx/meta.schema.json +49 -0
  139. package/src/fx/metal.meta.json +26 -0
  140. package/src/fx/metal.ts +8 -0
  141. package/src/fx/mirror-floor.meta.json +26 -0
  142. package/src/fx/mirror-floor.ts +8 -0
  143. package/src/fx/neural-mesh.meta.json +54 -0
  144. package/src/fx/neural-mesh.ts +110 -0
  145. package/src/fx/orbit-agents.meta.json +36 -0
  146. package/src/fx/orbit-agents.ts +63 -0
  147. package/src/fx/orbit.meta.json +27 -0
  148. package/src/fx/orbit.ts +8 -0
  149. package/src/fx/outline.meta.json +43 -0
  150. package/src/fx/outline.ts +4 -0
  151. package/src/fx/paper-stack.meta.json +36 -0
  152. package/src/fx/paper-stack.ts +61 -0
  153. package/src/fx/particle-stream.meta.json +27 -0
  154. package/src/fx/particle-stream.ts +8 -0
  155. package/src/fx/particles.meta.json +26 -0
  156. package/src/fx/particles.ts +8 -0
  157. package/src/fx/pixelate.meta.json +28 -0
  158. package/src/fx/pixelate.ts +4 -0
  159. package/src/fx/points-on-geometry.meta.json +61 -0
  160. package/src/fx/points-on-geometry.ts +71 -0
  161. package/src/fx/proof-gate.meta.json +30 -0
  162. package/src/fx/proof-gate.ts +67 -0
  163. package/src/fx/rings.meta.json +27 -0
  164. package/src/fx/rings.ts +8 -0
  165. package/src/fx/room-ibl.meta.json +26 -0
  166. package/src/fx/room-ibl.ts +8 -0
  167. package/src/fx/sao.meta.json +32 -0
  168. package/src/fx/sao.ts +4 -0
  169. package/src/fx/scaffold.ts +172 -0
  170. package/src/fx/scatter.meta.json +49 -0
  171. package/src/fx/scatter.ts +74 -0
  172. package/src/fx/selective-bloom.meta.json +36 -0
  173. package/src/fx/selective-bloom.ts +4 -0
  174. package/src/fx/server-racks.meta.json +36 -0
  175. package/src/fx/server-racks.ts +54 -0
  176. package/src/fx/shader-particles.meta.json +46 -0
  177. package/src/fx/shader-particles.ts +75 -0
  178. package/src/fx/signal-pulse.meta.json +27 -0
  179. package/src/fx/signal-pulse.ts +8 -0
  180. package/src/fx/smaa.meta.json +19 -0
  181. package/src/fx/smaa.ts +4 -0
  182. package/src/fx/sobel.meta.json +24 -0
  183. package/src/fx/sobel.ts +4 -0
  184. package/src/fx/soft-shadows.meta.json +26 -0
  185. package/src/fx/soft-shadows.ts +8 -0
  186. package/src/fx/sprites.meta.json +40 -0
  187. package/src/fx/sprites.ts +57 -0
  188. package/src/fx/stagger-reveal.meta.json +26 -0
  189. package/src/fx/stagger-reveal.ts +8 -0
  190. package/src/fx/starfield.meta.json +32 -0
  191. package/src/fx/starfield.ts +18 -0
  192. package/src/fx/swarm.meta.json +27 -0
  193. package/src/fx/swarm.ts +8 -0
  194. package/src/fx/tessellate.meta.json +39 -0
  195. package/src/fx/tessellate.ts +79 -0
  196. package/src/fx/tokens.meta.json +27 -0
  197. package/src/fx/tokens.ts +8 -0
  198. package/src/fx/trail.meta.json +27 -0
  199. package/src/fx/trail.ts +8 -0
  200. package/src/fx/trust-ledger.meta.json +30 -0
  201. package/src/fx/trust-ledger.ts +47 -0
  202. package/src/fx/types.ts +83 -0
  203. package/src/fx/util.ts +108 -0
  204. package/src/fx/vault-glyphs.meta.json +37 -0
  205. package/src/fx/vault-glyphs.ts +55 -0
  206. package/src/fx/video-screen.meta.json +57 -0
  207. package/src/fx/video-screen.ts +99 -0
  208. package/src/fx/vignette.meta.json +32 -0
  209. package/src/fx/vignette.ts +4 -0
  210. package/src/fx/volume-cloud.meta.json +58 -0
  211. package/src/fx/volume-cloud.ts +87 -0
  212. package/src/fx/volume-perlin.meta.json +46 -0
  213. package/src/fx/volume-perlin.ts +82 -0
  214. package/src/fx/volumetric-spot.meta.json +26 -0
  215. package/src/fx/volumetric-spot.ts +8 -0
  216. package/src/fx/wireframe-overlay.meta.json +27 -0
  217. package/src/fx/wireframe-overlay.ts +8 -0
  218. package/src/ir/defaults.ts +62 -0
  219. package/src/ir/field-reference.ts +96 -0
  220. package/src/ir/hash.ts +34 -0
  221. package/src/ir/ids.ts +65 -0
  222. package/src/ir/merge.ts +155 -0
  223. package/src/ir/schema.json +1211 -0
  224. package/src/ir/types.ts +333 -0
  225. package/src/ir/validate.ts +196 -0
  226. package/src/parse/derive.ts +205 -0
  227. package/src/parse/harvest/bundle.ts +56 -0
  228. package/src/parse/harvest/harness.html +22 -0
  229. package/src/parse/harvest/harness.ts +191 -0
  230. package/src/parse/harvest/index.ts +169 -0
  231. package/src/parse/harvest/shapes.ts +75 -0
  232. package/src/parse/markdown.ts +215 -0
  233. package/src/props/embed.ts +92 -0
  234. package/src/props/fetch.ts +97 -0
  235. package/src/props/generate.ts +152 -0
  236. package/src/props/key.ts +13 -0
  237. package/src/props/search.ts +180 -0
  238. package/src/render/embed-video.ts +80 -0
  239. package/src/render/font.ts +86 -0
  240. package/src/render/index.ts +149 -0
  241. package/src/render/template.html +87 -0
  242. package/src/runtime/backgrounds.ts +146 -0
  243. package/src/runtime/builders.ts +808 -0
  244. package/src/runtime/camera.ts +73 -0
  245. package/src/runtime/hud.ts +887 -0
  246. package/src/runtime/index.ts +1168 -0
  247. package/src/runtime/local-fx.ts +151 -0
  248. package/src/runtime/materials.ts +136 -0
  249. package/src/runtime/measure.ts +73 -0
  250. package/src/runtime/node-geometry.ts +26 -0
  251. package/src/runtime/palette.ts +111 -0
  252. package/src/runtime/post.ts +649 -0
  253. package/src/runtime/props.ts +292 -0
  254. package/src/runtime/quality.ts +20 -0
  255. package/src/runtime/rng.ts +8 -0
  256. package/src/runtime/scene.ts +644 -0
  257. package/src/runtime/text.ts +174 -0
  258. package/src/runtime/types.ts +118 -0
  259. package/src/serve/index.ts +376 -0
  260. package/src/util/paths.ts +35 -0
@@ -0,0 +1,110 @@
1
+ import type { FxContext, FxFactory, FxHandle, FxParams } from "./types.js";
2
+
3
+ /** Layered node mesh with signal lines between adjacent layers (topic: ai). */
4
+ export const create: FxFactory = (ctx: FxContext, params: FxParams): FxHandle => {
5
+ const { THREE, palette, quality, rng } = ctx;
6
+ const density = typeof params.density === "number" ? params.density : 1;
7
+ const speed = typeof params.speed === "number" ? params.speed : 1;
8
+ const drift = typeof params.drift === "number" ? params.drift : 0.5;
9
+ const metalness = typeof params.metalness === "number" ? params.metalness : 0.9;
10
+ const glow = typeof params.glow === "number" ? params.glow : 0.8;
11
+ const perLayer = Math.max(4, Math.round((quality.particles / 90) * density));
12
+ const layers = 4;
13
+ const count = perLayer * layers;
14
+
15
+ const pts: THREE.Vector3[][] = [];
16
+ for (let l = 0; l < layers; l++) {
17
+ const layer: THREE.Vector3[] = [];
18
+ for (let i = 0; i < perLayer; i++) {
19
+ layer.push(new THREE.Vector3((l - (layers - 1) / 2) * 6, (i - (perLayer - 1) / 2) * 2.1 + (rng() - 0.5), (rng() - 0.5) * 3));
20
+ }
21
+ pts.push(layer);
22
+ }
23
+ // Per-node phase: without it every node would swim in lockstep, which reads
24
+ // as the whole mesh sliding rather than as nodes with their own life.
25
+ const phase = Array.from({ length: count }, () => rng() * Math.PI * 2);
26
+
27
+ const nodeGeo = new THREE.SphereGeometry(0.16, 12, 12);
28
+ // Standard (not Basic) so the key and rim lights actually land on the balls;
29
+ // `emissive` is what the bloom pass picks up.
30
+ const nodeMat = new THREE.MeshStandardMaterial({
31
+ color: palette.accent,
32
+ metalness,
33
+ roughness: Math.max(0.05, 0.35 - metalness * 0.25),
34
+ emissive: new THREE.Color(palette.accent),
35
+ emissiveIntensity: glow,
36
+ envMapIntensity: 1.4,
37
+ });
38
+ const nodes = new THREE.InstancedMesh(nodeGeo, nodeMat, count);
39
+
40
+ const lineGeo = new THREE.BufferGeometry();
41
+ const lineMat = new THREE.LineBasicMaterial({ color: palette.second, transparent: true, opacity: 0.25 });
42
+ // Which pairs are wired is fixed; the endpoints move, so the buffer is
43
+ // rewritten each tick from the same index pairs.
44
+ const wires: Array<[number, number]> = [];
45
+ for (let l = 0; l + 1 < layers; l++) {
46
+ for (let a = 0; a < perLayer; a++) {
47
+ for (let b = 0; b < perLayer; b++) {
48
+ if (rng() > 0.35) continue;
49
+ wires.push([l * perLayer + a, (l + 1) * perLayer + b]);
50
+ }
51
+ }
52
+ }
53
+ const linePos = new Float32Array(wires.length * 6);
54
+ lineGeo.setAttribute("position", new THREE.BufferAttribute(linePos, 3));
55
+
56
+ const group = new THREE.Group();
57
+ group.add(nodes, new THREE.LineSegments(lineGeo, lineMat));
58
+ const holder = new THREE.Group();
59
+ holder.add(group);
60
+ holder.userData.count = count;
61
+
62
+ const flat = pts.flat();
63
+ const m = new THREE.Matrix4();
64
+ const at = new THREE.Vector3();
65
+ const nodeAt = (i: number, t: number): THREE.Vector3 => {
66
+ const base = flat[i];
67
+ return at.set(
68
+ base.x + Math.sin(t * 0.7 * speed + phase[i]) * 0.35 * drift,
69
+ base.y + Math.cos(t * 0.9 * speed + phase[i] * 1.3) * 0.5 * drift,
70
+ base.z + Math.sin(t * 0.5 * speed + phase[i] * 0.7) * 0.6 * drift,
71
+ );
72
+ };
73
+
74
+ const place = (t: number): void => {
75
+ for (let i = 0; i < count; i++) {
76
+ const p = nodeAt(i, t);
77
+ nodes.setMatrixAt(i, m.makeTranslation(p.x, p.y, p.z));
78
+ }
79
+ nodes.instanceMatrix.needsUpdate = true;
80
+ wires.forEach(([a, b], w) => {
81
+ const pa = nodeAt(a, t);
82
+ linePos[w * 6] = pa.x;
83
+ linePos[w * 6 + 1] = pa.y;
84
+ linePos[w * 6 + 2] = pa.z;
85
+ const pb = nodeAt(b, t);
86
+ linePos[w * 6 + 3] = pb.x;
87
+ linePos[w * 6 + 4] = pb.y;
88
+ linePos[w * 6 + 5] = pb.z;
89
+ });
90
+ lineGeo.attributes.position.needsUpdate = true;
91
+ };
92
+ place(0);
93
+
94
+ return {
95
+ object: holder,
96
+ tick: (t) => {
97
+ place(t);
98
+ group.rotation.y = Math.sin(t * 0.09 * speed) * 0.5;
99
+ // Pulse the glow rather than the opacity: a metal ball that fades out
100
+ // stops reading as metal.
101
+ nodeMat.emissiveIntensity = glow * (0.65 + Math.sin(t * 1.4 * speed) * 0.35);
102
+ },
103
+ dispose: () => {
104
+ nodeGeo.dispose();
105
+ nodeMat.dispose();
106
+ lineGeo.dispose();
107
+ lineMat.dispose();
108
+ },
109
+ };
110
+ };
@@ -0,0 +1,36 @@
1
+ {
2
+ "id": "orbit-agents",
3
+ "kind": "background",
4
+ "tags": {
5
+ "mood": [
6
+ "dynamic",
7
+ "technical"
8
+ ],
9
+ "content": [
10
+ "agents",
11
+ "network"
12
+ ],
13
+ "topic": [
14
+ "agents"
15
+ ]
16
+ },
17
+ "cost": 3,
18
+ "modes": "both",
19
+ "params": {
20
+ "density": {
21
+ "type": "number",
22
+ "default": 1,
23
+ "minimum": 0.2,
24
+ "maximum": 3
25
+ },
26
+ "speed": {
27
+ "type": "number",
28
+ "default": 1,
29
+ "minimum": 0,
30
+ "maximum": 3
31
+ }
32
+ },
33
+ "conflicts": [],
34
+ "source": "https://threejs.org/examples/#webgl_instancing_dynamic",
35
+ "licence": "MIT"
36
+ }
@@ -0,0 +1,63 @@
1
+ import type { FxContext, FxFactory, FxHandle, FxParams } from "./types.js";
2
+
3
+ /** Agents on nested tilted orbits around a shared core (topic: agents). */
4
+ export const create: FxFactory = (ctx: FxContext, params: FxParams): FxHandle => {
5
+ const { THREE, palette, quality, rng } = ctx;
6
+ const density = typeof params.density === "number" ? params.density : 1;
7
+ const speed = typeof params.speed === "number" ? params.speed : 1;
8
+ const count = Math.max(12, Math.round((quality.particles / 25) * density));
9
+
10
+ const group = new THREE.Group();
11
+ const disposables: Array<{ dispose: () => void }> = [];
12
+
13
+ const coreGeo = new THREE.IcosahedronGeometry(1.5, 1);
14
+ disposables.push(coreGeo);
15
+ const coreMat = new THREE.MeshBasicMaterial({ color: palette.accent, wireframe: true, transparent: true, opacity: 0.4 });
16
+ disposables.push(coreMat);
17
+ const core = new THREE.Mesh(coreGeo, coreMat);
18
+ group.add(core);
19
+
20
+ const agentGeo = new THREE.TetrahedronGeometry(0.28, 0);
21
+ disposables.push(agentGeo);
22
+ const agentMat = new THREE.MeshStandardMaterial({ color: palette.second, metalness: 0.6, roughness: 0.4 });
23
+ disposables.push(agentMat);
24
+ const agents = new THREE.InstancedMesh(agentGeo, agentMat, count);
25
+ group.add(agents);
26
+
27
+ const seeds = Array.from({ length: count }, () => ({
28
+ r: 3.5 + rng() * 6,
29
+ ph: rng() * Math.PI * 2,
30
+ sp: 0.12 + rng() * 0.3,
31
+ tilt: rng() * Math.PI,
32
+ }));
33
+
34
+ const holder = new THREE.Group();
35
+ holder.add(group);
36
+ holder.userData.count = count;
37
+
38
+ const m = new THREE.Matrix4();
39
+ const q = new THREE.Quaternion();
40
+ const v = new THREE.Vector3();
41
+ const one = new THREE.Vector3(1, 1, 1);
42
+ const place = (t: number) => {
43
+ seeds.forEach((s, i) => {
44
+ const a = s.ph + t * s.sp * speed;
45
+ v.set(Math.cos(a) * s.r, Math.sin(a) * s.r * Math.cos(s.tilt), Math.sin(a) * s.r * Math.sin(s.tilt));
46
+ q.setFromAxisAngle(new THREE.Vector3(0, 1, 0), a);
47
+ agents.setMatrixAt(i, m.compose(v, q, one));
48
+ });
49
+ agents.instanceMatrix.needsUpdate = true;
50
+ };
51
+ place(0);
52
+
53
+ return {
54
+ object: holder,
55
+ tick: (t) => {
56
+ place(t);
57
+ core.rotation.set(t * 0.1 * speed, t * 0.14 * speed, 0);
58
+ },
59
+ dispose: () => {
60
+ for (const d of disposables) d.dispose();
61
+ },
62
+ };
63
+ };
@@ -0,0 +1,27 @@
1
+ {
2
+ "id": "orbit",
3
+ "kind": "motion",
4
+ "tags": {
5
+ "mood": [
6
+ "active",
7
+ "calm"
8
+ ],
9
+ "content": [
10
+ "motion",
11
+ "network"
12
+ ]
13
+ },
14
+ "cost": 1,
15
+ "modes": "both",
16
+ "params": {
17
+ "speed": {
18
+ "type": "number",
19
+ "default": 0.5,
20
+ "minimum": 0,
21
+ "maximum": 2
22
+ }
23
+ },
24
+ "conflicts": [],
25
+ "source": "https://threejs.org/examples/",
26
+ "licence": "MIT"
27
+ }
@@ -0,0 +1,8 @@
1
+ import type { FxContext, FxFactory, FxHandle, FxParams } from "./types.js";
2
+
3
+ /** Motion preset applied to a slide's diagram group. */
4
+ export const create: FxFactory = (ctx: FxContext, params: FxParams): FxHandle => {
5
+ const group = new ctx.THREE.Group();
6
+ const amplitude = typeof params.amplitude === "number" ? params.amplitude : 0.2;
7
+ return { object: group, tick: (t) => { group.rotation.y = Math.sin(t * 0.3) * amplitude; }, dispose: () => {} };
8
+ };
@@ -0,0 +1,43 @@
1
+ {
2
+ "id": "outline",
3
+ "kind": "post",
4
+ "tags": {
5
+ "mood": [
6
+ "technical",
7
+ "bold"
8
+ ],
9
+ "content": [
10
+ "diagram",
11
+ "emphasis"
12
+ ]
13
+ },
14
+ "cost": 2,
15
+ "modes": "both",
16
+ "params": {
17
+ "strength": {
18
+ "type": "number",
19
+ "default": 1,
20
+ "minimum": 0,
21
+ "maximum": 3
22
+ },
23
+ "thickness": {
24
+ "type": "number",
25
+ "default": 1.5,
26
+ "minimum": 0.5,
27
+ "maximum": 4
28
+ },
29
+ "parts": {
30
+ "type": "string",
31
+ "default": "diagram",
32
+ "enum": [
33
+ "diagram",
34
+ "title",
35
+ "props",
36
+ "all"
37
+ ]
38
+ }
39
+ },
40
+ "conflicts": [],
41
+ "source": "https://github.com/mrdoob/three.js",
42
+ "licence": "MIT"
43
+ }
@@ -0,0 +1,4 @@
1
+ import type { FxFactory, FxHandle } from "./types.js";
2
+
3
+ /** Post pass marker; the runtime post stack (`runtime/post.ts`) owns the actual pass. */
4
+ export const create: FxFactory = (): FxHandle => ({ pass: "outline", dispose: () => {} });
@@ -0,0 +1,36 @@
1
+ {
2
+ "id": "paper-stack",
3
+ "kind": "background",
4
+ "tags": {
5
+ "mood": [
6
+ "calm",
7
+ "procedural"
8
+ ],
9
+ "content": [
10
+ "process",
11
+ "documents"
12
+ ],
13
+ "topic": [
14
+ "process"
15
+ ]
16
+ },
17
+ "cost": 2,
18
+ "modes": "both",
19
+ "params": {
20
+ "density": {
21
+ "type": "number",
22
+ "default": 1,
23
+ "minimum": 0.2,
24
+ "maximum": 3
25
+ },
26
+ "speed": {
27
+ "type": "number",
28
+ "default": 1,
29
+ "minimum": 0,
30
+ "maximum": 3
31
+ }
32
+ },
33
+ "conflicts": [],
34
+ "source": "https://threejs.org/examples/#webgl_geometry_shapes",
35
+ "licence": "MIT"
36
+ }
@@ -0,0 +1,61 @@
1
+ import type { FxContext, FxFactory, FxHandle, FxParams } from "./types.js";
2
+
3
+ /** Drifting sheets settling into a stack — a process/handoff motif (topic: process). */
4
+ export const create: FxFactory = (ctx: FxContext, params: FxParams): FxHandle => {
5
+ const { THREE, palette, quality, rng } = ctx;
6
+ const density = typeof params.density === "number" ? params.density : 1;
7
+ const speed = typeof params.speed === "number" ? params.speed : 1;
8
+ const count = Math.max(14, Math.round((quality.particles / 22) * density));
9
+
10
+ const geo = new THREE.PlaneGeometry(3.1, 4.2);
11
+ const mat = new THREE.MeshStandardMaterial({
12
+ color: palette.second,
13
+ metalness: 0.2,
14
+ roughness: 0.7,
15
+ transparent: true,
16
+ opacity: 0.55,
17
+ side: THREE.DoubleSide,
18
+ });
19
+ const sheets = new THREE.InstancedMesh(geo, mat, count);
20
+
21
+ const seeds = Array.from({ length: count }, (_, i) => ({
22
+ x: (rng() - 0.5) * 18,
23
+ y0: -5 + i * 0.5,
24
+ z: (rng() - 0.5) * 5,
25
+ rot: (rng() - 0.5) * 0.7,
26
+ ph: rng() * Math.PI * 2,
27
+ }));
28
+
29
+ const group = new THREE.Group();
30
+ group.add(sheets);
31
+ group.rotation.x = -0.1;
32
+ // The runtime pins the RETURNED object's z, so the scene's own depth
33
+ // offset lives one level below it.
34
+ const holder = new THREE.Group();
35
+ group.position.set(0, 0, -11);
36
+ holder.add(group);
37
+ holder.userData.count = count;
38
+
39
+ const m = new THREE.Matrix4();
40
+ const q = new THREE.Quaternion();
41
+ const v = new THREE.Vector3();
42
+ const one = new THREE.Vector3(1, 1, 1);
43
+ const place = (t: number) => {
44
+ seeds.forEach((s, i) => {
45
+ v.set(s.x, s.y0 + Math.sin(t * 0.3 * speed + s.ph) * 0.8, s.z);
46
+ q.setFromEuler(new THREE.Euler(-Math.PI / 7, 0, s.rot + Math.sin(t * 0.2 * speed + s.ph) * 0.1));
47
+ sheets.setMatrixAt(i, m.compose(v, q, one));
48
+ });
49
+ sheets.instanceMatrix.needsUpdate = true;
50
+ };
51
+ place(0);
52
+
53
+ return {
54
+ object: holder,
55
+ tick: place,
56
+ dispose: () => {
57
+ geo.dispose();
58
+ mat.dispose();
59
+ },
60
+ };
61
+ };
@@ -0,0 +1,27 @@
1
+ {
2
+ "id": "particle-stream",
3
+ "kind": "edge",
4
+ "tags": {
5
+ "mood": [
6
+ "active",
7
+ "technical"
8
+ ],
9
+ "content": [
10
+ "flow",
11
+ "data"
12
+ ]
13
+ },
14
+ "cost": 2,
15
+ "modes": "both",
16
+ "params": {
17
+ "count": {
18
+ "type": "number",
19
+ "default": 12,
20
+ "minimum": 2,
21
+ "maximum": 64
22
+ }
23
+ },
24
+ "conflicts": [],
25
+ "source": "https://threejs.org/examples/",
26
+ "licence": "MIT"
27
+ }
@@ -0,0 +1,8 @@
1
+ import type { FxContext, FxFactory, FxHandle, FxParams } from "./types.js";
2
+
3
+ /** Edge style decorator; the flowchart builder applies it to edge tubes. */
4
+ export const create: FxFactory = (ctx: FxContext, params: FxParams): FxHandle => {
5
+ const group = new ctx.THREE.Group();
6
+ void params;
7
+ return { object: group, tick: () => {}, dispose: () => {} };
8
+ };
@@ -0,0 +1,26 @@
1
+ {
2
+ "id": "particles",
3
+ "kind": "background",
4
+ "tags": {
5
+ "mood": [
6
+ "ambient",
7
+ "calm"
8
+ ],
9
+ "content": [
10
+ "particles"
11
+ ]
12
+ },
13
+ "cost": 1,
14
+ "modes": "both",
15
+ "params": {
16
+ "intensity": {
17
+ "type": "number",
18
+ "default": 1,
19
+ "minimum": 0,
20
+ "maximum": 2
21
+ }
22
+ },
23
+ "conflicts": [],
24
+ "source": "https://threejs.org/examples/",
25
+ "licence": "MIT"
26
+ }
@@ -0,0 +1,8 @@
1
+ import { BACKGROUNDS } from "../runtime/backgrounds.js";
2
+ import type { FxContext, FxFactory, FxHandle, FxParams } from "./types.js";
3
+
4
+ /** Ported from the strategy lab. */
5
+ export const create: FxFactory = (ctx: FxContext, _params: FxParams): FxHandle => {
6
+ const animator = BACKGROUNDS["particles"](ctx.palette, ctx.quality);
7
+ return { object: animator.g, tick: animator.tick, dispose: () => {} };
8
+ };
@@ -0,0 +1,28 @@
1
+ {
2
+ "id": "pixelate",
3
+ "kind": "post",
4
+ "tags": {
5
+ "mood": [
6
+ "playful",
7
+ "retro"
8
+ ],
9
+ "content": [
10
+ "stylised"
11
+ ]
12
+ },
13
+ "cost": 1,
14
+ "modes": "both",
15
+ "params": {
16
+ "size": {
17
+ "type": "number",
18
+ "default": 6,
19
+ "minimum": 1,
20
+ "maximum": 32
21
+ }
22
+ },
23
+ "conflicts": [
24
+ "smaa"
25
+ ],
26
+ "source": "https://github.com/mrdoob/three.js",
27
+ "licence": "MIT"
28
+ }
@@ -0,0 +1,4 @@
1
+ import type { FxFactory, FxHandle } from "./types.js";
2
+
3
+ /** Post pass marker; the runtime post stack (`runtime/post.ts`) owns the actual pass. */
4
+ export const create: FxFactory = (): FxHandle => ({ pass: "pixelate", dispose: () => {} });
@@ -0,0 +1,61 @@
1
+ {
2
+ "id": "points-on-geometry",
3
+ "kind": "background",
4
+ "tags": {
5
+ "mood": [
6
+ "technical",
7
+ "glow"
8
+ ],
9
+ "content": [
10
+ "wireframe",
11
+ "points",
12
+ "hologram"
13
+ ]
14
+ },
15
+ "cost": 2,
16
+ "modes": "both",
17
+ "params": {
18
+ "density": {
19
+ "type": "number",
20
+ "default": 1,
21
+ "minimum": 0.2,
22
+ "maximum": 3
23
+ },
24
+ "geometry": {
25
+ "type": "string",
26
+ "default": "sphere",
27
+ "enum": [
28
+ "sphere",
29
+ "box",
30
+ "knot"
31
+ ]
32
+ },
33
+ "size": {
34
+ "type": "number",
35
+ "default": 1,
36
+ "minimum": 0.3,
37
+ "maximum": 3
38
+ },
39
+ "pulse": {
40
+ "type": "number",
41
+ "default": 1,
42
+ "minimum": 0,
43
+ "maximum": 3
44
+ },
45
+ "x": {
46
+ "type": "number",
47
+ "default": 4,
48
+ "minimum": -12,
49
+ "maximum": 12
50
+ },
51
+ "spin": {
52
+ "type": "number",
53
+ "default": 1,
54
+ "minimum": 0,
55
+ "maximum": 3
56
+ }
57
+ },
58
+ "conflicts": [],
59
+ "source": "https://threejs.org/examples/#webgl_custom_attributes_points2",
60
+ "licence": "MIT"
61
+ }
@@ -0,0 +1,71 @@
1
+ import type { FxContext, FxFactory, FxHandle, FxParams } from "./types.js";
2
+ import { countFor, num, softSprite, str } from "./util.js";
3
+
4
+ /**
5
+ * The vertices of a solid as pulsing points (three `webgl_custom_attributes_points2`).
6
+ * `geometry` = sphere | box | knot picks the host; per-vertex size and colour
7
+ * are attributes, animated in the shader from `time` alone.
8
+ */
9
+ export const create: FxFactory = (ctx: FxContext, params: FxParams): FxHandle => {
10
+ const { THREE, palette, rng } = ctx;
11
+ const target = countFor(ctx, 1, num(params, "density", 1), 200);
12
+ const shape = str(params, "geometry", "sphere");
13
+ const seg = Math.max(8, Math.round(Math.sqrt(target)));
14
+ const host =
15
+ shape === "box" ? new THREE.BoxGeometry(6, 6, 6, seg / 2, seg / 2, seg / 2) : shape === "knot" ? new THREE.TorusKnotGeometry(3, 1, seg * 4, seg) : new THREE.SphereGeometry(4, seg, seg);
16
+ const pos = host.getAttribute("position");
17
+ const count = pos.count;
18
+ const sizes = new Float32Array(count);
19
+ const colors = new Float32Array(count * 3);
20
+ const a = new THREE.Color(palette.accent);
21
+ const b = new THREE.Color(palette.second);
22
+ const c = new THREE.Color();
23
+ for (let i = 0; i < count; i++) {
24
+ sizes[i] = 0.2 + rng() * 0.18;
25
+ c.copy(a).lerp(b, (i % 7) / 7);
26
+ colors[i * 3] = c.r;
27
+ colors[i * 3 + 1] = c.g;
28
+ colors[i * 3 + 2] = c.b;
29
+ }
30
+ const geo = new THREE.BufferGeometry();
31
+ geo.setAttribute("position", pos.clone());
32
+ geo.setAttribute("baseSize", new THREE.BufferAttribute(sizes, 1));
33
+ geo.setAttribute("customColor", new THREE.BufferAttribute(colors, 3));
34
+ const tex = softSprite(THREE, 32, 1.4);
35
+ const mat = new THREE.ShaderMaterial({
36
+ uniforms: { map: { value: tex }, time: { value: 0 }, pulse: { value: num(params, "pulse", 1) }, size: { value: num(params, "size", 1) } },
37
+ vertexShader: [
38
+ "attribute float baseSize; attribute vec3 customColor; uniform float time, pulse, size; varying vec3 vColor;",
39
+ "void main(){ vColor = customColor; vec4 mv = modelViewMatrix * vec4(position, 1.0);",
40
+ " float s = baseSize * (1.0 + 0.6 * pulse * sin(time * 2.0 + position.x * 0.8 + position.y * 0.6));",
41
+ " gl_PointSize = s * size * (300.0 / -mv.z); gl_Position = projectionMatrix * mv; }",
42
+ ].join("\n"),
43
+ fragmentShader: [
44
+ "uniform sampler2D map; varying vec3 vColor;",
45
+ "void main(){ vec4 t = texture2D(map, gl_PointCoord); gl_FragColor = vec4(vColor, t.a); }",
46
+ ].join("\n"),
47
+ transparent: true,
48
+ depthWrite: false,
49
+ blending: THREE.AdditiveBlending,
50
+ });
51
+ const points = new THREE.Points(geo, mat);
52
+ points.position.set(num(params, "x", 4), 0, -6);
53
+ const spin = num(params, "spin", 1);
54
+ const holder = new THREE.Group();
55
+ holder.add(points);
56
+ holder.userData.count = count;
57
+ host.dispose();
58
+ return {
59
+ object: holder,
60
+ tick: (t) => {
61
+ mat.uniforms.time.value = t;
62
+ points.rotation.y = t * 0.1 * spin;
63
+ points.rotation.z = Math.sin(t * 0.07) * 0.2;
64
+ },
65
+ dispose: () => {
66
+ geo.dispose();
67
+ mat.dispose();
68
+ tex.dispose();
69
+ },
70
+ };
71
+ };
@@ -0,0 +1,30 @@
1
+ {
2
+ "id": "proof-gate",
3
+ "kind": "background",
4
+ "tags": {
5
+ "mood": [
6
+ "decisive",
7
+ "commercial"
8
+ ],
9
+ "content": [
10
+ "pipeline",
11
+ "proof"
12
+ ],
13
+ "topic": [
14
+ "sales"
15
+ ]
16
+ },
17
+ "cost": 3,
18
+ "modes": "both",
19
+ "params": {
20
+ "density": {
21
+ "type": "number",
22
+ "default": 1,
23
+ "minimum": 0.2,
24
+ "maximum": 3
25
+ }
26
+ },
27
+ "conflicts": [],
28
+ "source": "https://github.com/BlackBeltTechnology/pi-agent-dashboard",
29
+ "licence": "MIT"
30
+ }