@blackbelt-technology/pi-dashboard-deck3d 0.0.0-stage → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.pi/skills/deck3d/SKILL.md +227 -0
- package/.pi/skills/deck3d/examples/deck.json +388 -0
- package/.pi/skills/deck3d/examples/fixture.md +18 -0
- package/.pi/skills/deck3d/examples/snapshot-after.png +0 -0
- package/.pi/skills/deck3d/examples/snapshot-before.png +0 -0
- package/.pi/skills/deck3d/reference/effects.agent.md +78 -0
- package/.pi/skills/deck3d/reference/effects.md +1217 -0
- package/.pi/skills/deck3d/reference/ir-fields.agent.md +30 -0
- package/.pi/skills/deck3d/reference/ir-fields.md +246 -0
- package/README.md +177 -2
- package/assets/LICENSE-Poppins.txt +99 -0
- package/assets/Poppins-Bold.ttf +0 -0
- package/assets/props/LICENSES.txt +4 -0
- package/assets/props/brain.glb +0 -0
- package/assets/props/cloud.glb +0 -0
- package/assets/props/cube.glb +0 -0
- package/assets/props/database.glb +0 -0
- package/assets/props/laptop.glb +0 -0
- package/assets/props/manifest.json +119 -0
- package/assets/props/robot.glb +0 -0
- package/assets/props/server.glb +0 -0
- package/assets/props/shield.glb +0 -0
- package/bin/deck3d +49 -0
- package/dist/cli.js +10228 -0
- package/dist/harvest/harness.js +185718 -0
- package/dist/runtime.js +64597 -0
- package/fixtures/business-2031/build-deck.mjs +60 -0
- package/fixtures/business-2031/build-overrides.mjs +154 -0
- package/fixtures/business-2031/deck.json +4220 -0
- package/fixtures/business-2031/deck.md +470 -0
- package/fixtures/business-2031/fx/closing-mark.js +43 -0
- package/fixtures/business-2031/fx/closing-mark.meta.json +26 -0
- package/fixtures/business-2031/overrides.json +903 -0
- package/fixtures/harvest.md +23 -0
- package/fixtures/strategy-lab.json +891 -0
- package/fixtures/strategy-lab.md +85 -0
- package/package.json +80 -4
- package/scripts/build-cli.mjs +29 -0
- package/scripts/build-harvest.ts +8 -0
- package/scripts/build-runtime.mjs +22 -0
- package/scripts/gen-effects.ts +14 -0
- package/scripts/gen-ir-fields.ts +34 -0
- package/src/check/index.ts +315 -0
- package/src/check/rules.ts +393 -0
- package/src/cli-io.ts +23 -0
- package/src/cli.ts +823 -0
- package/src/fx/accent-cycle.meta.json +26 -0
- package/src/fx/accent-cycle.ts +8 -0
- package/src/fx/agent-depth.meta.json +42 -0
- package/src/fx/agent-depth.ts +62 -0
- package/src/fx/ascii.meta.json +35 -0
- package/src/fx/ascii.ts +4 -0
- package/src/fx/aurora.meta.json +26 -0
- package/src/fx/aurora.ts +18 -0
- package/src/fx/billboards.meta.json +34 -0
- package/src/fx/billboards.ts +67 -0
- package/src/fx/bloom.meta.json +26 -0
- package/src/fx/bloom.ts +4 -0
- package/src/fx/camera-drift.meta.json +26 -0
- package/src/fx/camera-drift.ts +8 -0
- package/src/fx/capital-flows.meta.json +30 -0
- package/src/fx/capital-flows.ts +64 -0
- package/src/fx/catalogue.ts +89 -0
- package/src/fx/chromatic-aberration.meta.json +32 -0
- package/src/fx/chromatic-aberration.ts +4 -0
- package/src/fx/city-grid.meta.json +37 -0
- package/src/fx/city-grid.ts +51 -0
- package/src/fx/clipped-solids.meta.json +49 -0
- package/src/fx/clipped-solids.ts +171 -0
- package/src/fx/cohort-grid.meta.json +48 -0
- package/src/fx/cohort-grid.ts +63 -0
- package/src/fx/compose.ts +114 -0
- package/src/fx/constellation.meta.json +51 -0
- package/src/fx/constellation.ts +103 -0
- package/src/fx/curve-flow.meta.json +40 -0
- package/src/fx/curve-flow.ts +63 -0
- package/src/fx/dashed-flow.meta.json +27 -0
- package/src/fx/dashed-flow.ts +8 -0
- package/src/fx/data-columns.meta.json +30 -0
- package/src/fx/data-columns.ts +18 -0
- package/src/fx/defaults.ts +92 -0
- package/src/fx/depth-of-field.meta.json +40 -0
- package/src/fx/depth-of-field.ts +4 -0
- package/src/fx/dolly.meta.json +26 -0
- package/src/fx/dolly.ts +4 -0
- package/src/fx/dot-screen.meta.json +35 -0
- package/src/fx/dot-screen.ts +4 -0
- package/src/fx/dynamic-instances.meta.json +40 -0
- package/src/fx/dynamic-instances.ts +57 -0
- package/src/fx/emissive.meta.json +26 -0
- package/src/fx/emissive.ts +8 -0
- package/src/fx/extruded-shapes.meta.json +62 -0
- package/src/fx/extruded-shapes.ts +133 -0
- package/src/fx/fab-wafer.meta.json +42 -0
- package/src/fx/fab-wafer.ts +72 -0
- package/src/fx/fade.meta.json +26 -0
- package/src/fx/fade.ts +4 -0
- package/src/fx/film.meta.json +26 -0
- package/src/fx/film.ts +4 -0
- package/src/fx/float.meta.json +26 -0
- package/src/fx/float.ts +8 -0
- package/src/fx/flythrough.meta.json +26 -0
- package/src/fx/flythrough.ts +4 -0
- package/src/fx/fog.meta.json +26 -0
- package/src/fx/fog.ts +8 -0
- package/src/fx/geo-fragments.meta.json +48 -0
- package/src/fx/geo-fragments.ts +59 -0
- package/src/fx/glass.meta.json +26 -0
- package/src/fx/glass.ts +8 -0
- package/src/fx/globe-arcs.meta.json +36 -0
- package/src/fx/globe-arcs.ts +67 -0
- package/src/fx/glow-tube.meta.json +26 -0
- package/src/fx/glow-tube.ts +8 -0
- package/src/fx/glyph-rain.meta.json +30 -0
- package/src/fx/glyph-rain.ts +18 -0
- package/src/fx/god-rays.meta.json +40 -0
- package/src/fx/god-rays.ts +4 -0
- package/src/fx/grid-horizon.meta.json +30 -0
- package/src/fx/grid-horizon.ts +18 -0
- package/src/fx/hex-grid.meta.json +29 -0
- package/src/fx/hex-grid.ts +18 -0
- package/src/fx/holo-fresnel.meta.json +26 -0
- package/src/fx/holo-fresnel.ts +8 -0
- package/src/fx/horizon-gates.meta.json +36 -0
- package/src/fx/horizon-gates.ts +60 -0
- package/src/fx/index.ts +258 -0
- package/src/fx/iridescent.meta.json +26 -0
- package/src/fx/iridescent.ts +8 -0
- package/src/fx/iris.meta.json +26 -0
- package/src/fx/iris.ts +4 -0
- package/src/fx/lightformers.meta.json +26 -0
- package/src/fx/lightformers.ts +8 -0
- package/src/fx/local.ts +200 -0
- package/src/fx/market-tape.meta.json +53 -0
- package/src/fx/market-tape.ts +97 -0
- package/src/fx/matcap.meta.json +26 -0
- package/src/fx/matcap.ts +8 -0
- package/src/fx/meta.schema.json +49 -0
- package/src/fx/metal.meta.json +26 -0
- package/src/fx/metal.ts +8 -0
- package/src/fx/mirror-floor.meta.json +26 -0
- package/src/fx/mirror-floor.ts +8 -0
- package/src/fx/neural-mesh.meta.json +54 -0
- package/src/fx/neural-mesh.ts +110 -0
- package/src/fx/orbit-agents.meta.json +36 -0
- package/src/fx/orbit-agents.ts +63 -0
- package/src/fx/orbit.meta.json +27 -0
- package/src/fx/orbit.ts +8 -0
- package/src/fx/outline.meta.json +43 -0
- package/src/fx/outline.ts +4 -0
- package/src/fx/paper-stack.meta.json +36 -0
- package/src/fx/paper-stack.ts +61 -0
- package/src/fx/particle-stream.meta.json +27 -0
- package/src/fx/particle-stream.ts +8 -0
- package/src/fx/particles.meta.json +26 -0
- package/src/fx/particles.ts +8 -0
- package/src/fx/pixelate.meta.json +28 -0
- package/src/fx/pixelate.ts +4 -0
- package/src/fx/points-on-geometry.meta.json +61 -0
- package/src/fx/points-on-geometry.ts +71 -0
- package/src/fx/proof-gate.meta.json +30 -0
- package/src/fx/proof-gate.ts +67 -0
- package/src/fx/rings.meta.json +27 -0
- package/src/fx/rings.ts +8 -0
- package/src/fx/room-ibl.meta.json +26 -0
- package/src/fx/room-ibl.ts +8 -0
- package/src/fx/sao.meta.json +32 -0
- package/src/fx/sao.ts +4 -0
- package/src/fx/scaffold.ts +172 -0
- package/src/fx/scatter.meta.json +49 -0
- package/src/fx/scatter.ts +74 -0
- package/src/fx/selective-bloom.meta.json +36 -0
- package/src/fx/selective-bloom.ts +4 -0
- package/src/fx/server-racks.meta.json +36 -0
- package/src/fx/server-racks.ts +54 -0
- package/src/fx/shader-particles.meta.json +46 -0
- package/src/fx/shader-particles.ts +75 -0
- package/src/fx/signal-pulse.meta.json +27 -0
- package/src/fx/signal-pulse.ts +8 -0
- package/src/fx/smaa.meta.json +19 -0
- package/src/fx/smaa.ts +4 -0
- package/src/fx/sobel.meta.json +24 -0
- package/src/fx/sobel.ts +4 -0
- package/src/fx/soft-shadows.meta.json +26 -0
- package/src/fx/soft-shadows.ts +8 -0
- package/src/fx/sprites.meta.json +40 -0
- package/src/fx/sprites.ts +57 -0
- package/src/fx/stagger-reveal.meta.json +26 -0
- package/src/fx/stagger-reveal.ts +8 -0
- package/src/fx/starfield.meta.json +32 -0
- package/src/fx/starfield.ts +18 -0
- package/src/fx/swarm.meta.json +27 -0
- package/src/fx/swarm.ts +8 -0
- package/src/fx/tessellate.meta.json +39 -0
- package/src/fx/tessellate.ts +79 -0
- package/src/fx/tokens.meta.json +27 -0
- package/src/fx/tokens.ts +8 -0
- package/src/fx/trail.meta.json +27 -0
- package/src/fx/trail.ts +8 -0
- package/src/fx/trust-ledger.meta.json +30 -0
- package/src/fx/trust-ledger.ts +47 -0
- package/src/fx/types.ts +83 -0
- package/src/fx/util.ts +108 -0
- package/src/fx/vault-glyphs.meta.json +37 -0
- package/src/fx/vault-glyphs.ts +55 -0
- package/src/fx/video-screen.meta.json +57 -0
- package/src/fx/video-screen.ts +99 -0
- package/src/fx/vignette.meta.json +32 -0
- package/src/fx/vignette.ts +4 -0
- package/src/fx/volume-cloud.meta.json +58 -0
- package/src/fx/volume-cloud.ts +87 -0
- package/src/fx/volume-perlin.meta.json +46 -0
- package/src/fx/volume-perlin.ts +82 -0
- package/src/fx/volumetric-spot.meta.json +26 -0
- package/src/fx/volumetric-spot.ts +8 -0
- package/src/fx/wireframe-overlay.meta.json +27 -0
- package/src/fx/wireframe-overlay.ts +8 -0
- package/src/ir/defaults.ts +62 -0
- package/src/ir/field-reference.ts +96 -0
- package/src/ir/hash.ts +34 -0
- package/src/ir/ids.ts +65 -0
- package/src/ir/merge.ts +155 -0
- package/src/ir/schema.json +1211 -0
- package/src/ir/types.ts +333 -0
- package/src/ir/validate.ts +196 -0
- package/src/parse/derive.ts +205 -0
- package/src/parse/harvest/bundle.ts +56 -0
- package/src/parse/harvest/harness.html +22 -0
- package/src/parse/harvest/harness.ts +191 -0
- package/src/parse/harvest/index.ts +169 -0
- package/src/parse/harvest/shapes.ts +75 -0
- package/src/parse/markdown.ts +215 -0
- package/src/props/embed.ts +92 -0
- package/src/props/fetch.ts +97 -0
- package/src/props/generate.ts +152 -0
- package/src/props/key.ts +13 -0
- package/src/props/search.ts +180 -0
- package/src/render/embed-video.ts +80 -0
- package/src/render/font.ts +86 -0
- package/src/render/index.ts +149 -0
- package/src/render/template.html +87 -0
- package/src/runtime/backgrounds.ts +146 -0
- package/src/runtime/builders.ts +808 -0
- package/src/runtime/camera.ts +73 -0
- package/src/runtime/hud.ts +887 -0
- package/src/runtime/index.ts +1168 -0
- package/src/runtime/local-fx.ts +151 -0
- package/src/runtime/materials.ts +136 -0
- package/src/runtime/measure.ts +73 -0
- package/src/runtime/node-geometry.ts +26 -0
- package/src/runtime/palette.ts +111 -0
- package/src/runtime/post.ts +649 -0
- package/src/runtime/props.ts +292 -0
- package/src/runtime/quality.ts +20 -0
- package/src/runtime/rng.ts +8 -0
- package/src/runtime/scene.ts +644 -0
- package/src/runtime/text.ts +174 -0
- package/src/runtime/types.ts +118 -0
- package/src/serve/index.ts +376 -0
- package/src/util/paths.ts +35 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "accent-cycle",
|
|
3
|
+
"kind": "light",
|
|
4
|
+
"tags": {
|
|
5
|
+
"mood": [
|
|
6
|
+
"active",
|
|
7
|
+
"neon"
|
|
8
|
+
],
|
|
9
|
+
"content": [
|
|
10
|
+
"highlight"
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
"cost": 2,
|
|
14
|
+
"modes": "both",
|
|
15
|
+
"params": {
|
|
16
|
+
"speed": {
|
|
17
|
+
"type": "number",
|
|
18
|
+
"default": 0.5,
|
|
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 type { FxContext, FxFactory, FxHandle, FxParams } from "./types.js";
|
|
2
|
+
|
|
3
|
+
/** Permissive port of a three.js example. */
|
|
4
|
+
export const create: FxFactory = (ctx: FxContext, params: FxParams): FxHandle => {
|
|
5
|
+
const light = new ctx.THREE.PointLight(ctx.palette.accent, 1, 30);
|
|
6
|
+
void params;
|
|
7
|
+
return { object: light, dispose: () => light.dispose?.() };
|
|
8
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "agent-depth",
|
|
3
|
+
"kind": "background",
|
|
4
|
+
"tags": {
|
|
5
|
+
"mood": [
|
|
6
|
+
"technical",
|
|
7
|
+
"uneven"
|
|
8
|
+
],
|
|
9
|
+
"content": [
|
|
10
|
+
"agents",
|
|
11
|
+
"depth"
|
|
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
|
+
"wave": {
|
|
27
|
+
"type": "number",
|
|
28
|
+
"default": 0.55,
|
|
29
|
+
"minimum": 0,
|
|
30
|
+
"maximum": 1.5
|
|
31
|
+
},
|
|
32
|
+
"waveSpeed": {
|
|
33
|
+
"type": "number",
|
|
34
|
+
"default": 0.9,
|
|
35
|
+
"minimum": 0,
|
|
36
|
+
"maximum": 3
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"conflicts": [],
|
|
40
|
+
"source": "https://github.com/BlackBeltTechnology/pi-agent-dashboard",
|
|
41
|
+
"licence": "MIT"
|
|
42
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// agent-depth — a wide shallow field pierced by a few narrow deep shafts (topic: agents). Licence: MIT.
|
|
2
|
+
import type * as ThreeNS from "three";
|
|
3
|
+
import type { FxContext, FxFactory, FxHandle, FxParams } from "./types.js";
|
|
4
|
+
|
|
5
|
+
export const create: FxFactory = function (ctx: FxContext, params: FxParams): FxHandle {
|
|
6
|
+
const { THREE, palette, quality, rng } = ctx;
|
|
7
|
+
const density = typeof params.density === "number" ? params.density : 1;
|
|
8
|
+
const wave = typeof params.wave === "number" ? params.wave : 0.55;
|
|
9
|
+
const waveSpeed = typeof params.waveSpeed === "number" ? params.waveSpeed : 0.9;
|
|
10
|
+
const count = Math.max(24, Math.round((quality.particles / 14) * density));
|
|
11
|
+
|
|
12
|
+
const geo = new THREE.CylinderGeometry(0.22, 0.22, 1, 10);
|
|
13
|
+
const mat = new THREE.MeshStandardMaterial({ color: palette.second, metalness: 0.5, roughness: 0.5, transparent: true, opacity: 0.65 });
|
|
14
|
+
const shafts = new THREE.InstancedMesh(geo, mat, count);
|
|
15
|
+
|
|
16
|
+
const deepMat = new THREE.MeshStandardMaterial({ color: palette.accent, metalness: 0.7, roughness: 0.3 });
|
|
17
|
+
const deepCount = Math.max(2, Math.round(count * 0.08));
|
|
18
|
+
const deep = new THREE.InstancedMesh(geo, deepMat, deepCount);
|
|
19
|
+
|
|
20
|
+
const side = Math.ceil(Math.sqrt(count));
|
|
21
|
+
const seeds: Array<Record<string, number>> = [];
|
|
22
|
+
for (let i = 0; i < count; i++) {
|
|
23
|
+
seeds.push({ x: ((i % side) - side / 2) * 2.3, z: (Math.floor(i / side) - side / 2) * 2.3, d: 0.4 + rng() * 0.5, ph: rng() * 6.283 });
|
|
24
|
+
}
|
|
25
|
+
const deepSeeds = seeds.slice(0, deepCount).map(function (s, i) {
|
|
26
|
+
return { x: s.x, z: s.z, d: 5 + i * 0.8, ph: s.ph };
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const m = new THREE.Matrix4();
|
|
30
|
+
const v = new THREE.Vector3();
|
|
31
|
+
const q = new THREE.Quaternion();
|
|
32
|
+
const sc = new THREE.Vector3();
|
|
33
|
+
const put = function (mesh: ThreeNS.InstancedMesh, list: Array<Record<string, number>>, t: number, wobble: number) {
|
|
34
|
+
for (let i = 0; i < list.length; i++) {
|
|
35
|
+
const s = list[i];
|
|
36
|
+
// Height is a travelling sine across the grid: the phase carries the
|
|
37
|
+
// shaft's own seed AND its x/z, so the field ripples instead of
|
|
38
|
+
// pumping in unison.
|
|
39
|
+
const k = Math.sin(t * waveSpeed + s.ph + s.x * 0.18 + s.z * 0.12);
|
|
40
|
+
const d = s.d * (1 + Math.sin(t * 0.5 + s.ph) * wobble + k * wave);
|
|
41
|
+
// Base-anchored: the foot stays on the floor plane and the TOP rises
|
|
42
|
+
// and falls. Pinning the top instead made the wave read upside down.
|
|
43
|
+
v.set(s.x, -3 + d / 2, s.z);
|
|
44
|
+
sc.set(1, d, 1);
|
|
45
|
+
mesh.setMatrixAt(i, m.compose(v, q, sc));
|
|
46
|
+
}
|
|
47
|
+
mesh.instanceMatrix.needsUpdate = true;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const group = new THREE.Group();
|
|
51
|
+
group.add(shafts, deep);
|
|
52
|
+
group.rotation.x = 0.16;
|
|
53
|
+
group.position.set(0, 1, -10);
|
|
54
|
+
const holder = new THREE.Group();
|
|
55
|
+
holder.add(group);
|
|
56
|
+
holder.userData.count = count;
|
|
57
|
+
|
|
58
|
+
const place = function (t: number) { put(shafts, seeds, t, 0.08); put(deep, deepSeeds, t, 0.03); };
|
|
59
|
+
place(0);
|
|
60
|
+
|
|
61
|
+
return { object: holder, tick: place, dispose: function () { geo.dispose(); mat.dispose(); deepMat.dispose(); } };
|
|
62
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "ascii",
|
|
3
|
+
"kind": "post",
|
|
4
|
+
"tags": {
|
|
5
|
+
"mood": [
|
|
6
|
+
"retro",
|
|
7
|
+
"playful"
|
|
8
|
+
],
|
|
9
|
+
"content": [
|
|
10
|
+
"stylised",
|
|
11
|
+
"terminal"
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
"cost": 2,
|
|
15
|
+
"modes": "both",
|
|
16
|
+
"params": {
|
|
17
|
+
"size": {
|
|
18
|
+
"type": "number",
|
|
19
|
+
"default": 9,
|
|
20
|
+
"minimum": 4,
|
|
21
|
+
"maximum": 24
|
|
22
|
+
},
|
|
23
|
+
"invert": {
|
|
24
|
+
"type": "boolean",
|
|
25
|
+
"default": false
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"conflicts": [
|
|
29
|
+
"sobel",
|
|
30
|
+
"pixelate",
|
|
31
|
+
"dot-screen"
|
|
32
|
+
],
|
|
33
|
+
"source": "https://github.com/mrdoob/three.js",
|
|
34
|
+
"licence": "MIT"
|
|
35
|
+
}
|
package/src/fx/ascii.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "aurora",
|
|
3
|
+
"kind": "background",
|
|
4
|
+
"tags": {
|
|
5
|
+
"mood": [
|
|
6
|
+
"calm",
|
|
7
|
+
"premium"
|
|
8
|
+
],
|
|
9
|
+
"content": [
|
|
10
|
+
"ambient"
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
"cost": 3,
|
|
14
|
+
"modes": "both",
|
|
15
|
+
"params": {
|
|
16
|
+
"speed": {
|
|
17
|
+
"type": "number",
|
|
18
|
+
"default": 0.5,
|
|
19
|
+
"minimum": 0,
|
|
20
|
+
"maximum": 2
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"conflicts": [],
|
|
24
|
+
"source": "https://threejs.org/examples/",
|
|
25
|
+
"licence": "MIT"
|
|
26
|
+
}
|
package/src/fx/aurora.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { makeRng } from "../runtime/rng.js";
|
|
2
|
+
import type { FxContext, FxFactory, FxHandle, FxParams } from "./types.js";
|
|
3
|
+
|
|
4
|
+
/** Permissive port of a three.js example (see the card's source). */
|
|
5
|
+
export const create: FxFactory = (ctx: FxContext, params: FxParams): FxHandle => {
|
|
6
|
+
const { THREE, palette } = ctx;
|
|
7
|
+
const n = Math.max(32, Math.round(ctx.quality.particles / 3));
|
|
8
|
+
const rnd = makeRng(42);
|
|
9
|
+
const positions = new Float32Array(n * 3);
|
|
10
|
+
for (let i = 0; i < n * 3; i++) positions[i] = (rnd() - 0.5) * 30;
|
|
11
|
+
const geo = new THREE.BufferGeometry();
|
|
12
|
+
geo.setAttribute("position", new THREE.BufferAttribute(positions, 3));
|
|
13
|
+
const points = new THREE.Points(geo, new THREE.PointsMaterial({ color: palette.second, size: 0.08, transparent: true, opacity: 0.8 }));
|
|
14
|
+
const group = new THREE.Group();
|
|
15
|
+
group.add(points);
|
|
16
|
+
const speed = typeof params.speed === "number" ? params.speed : 0.2;
|
|
17
|
+
return { object: group, tick: (t) => { group.rotation.y = t * speed * 0.1; }, dispose: () => geo.dispose() };
|
|
18
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "billboards",
|
|
3
|
+
"kind": "background",
|
|
4
|
+
"tags": {
|
|
5
|
+
"mood": [
|
|
6
|
+
"soft",
|
|
7
|
+
"dense"
|
|
8
|
+
],
|
|
9
|
+
"content": [
|
|
10
|
+
"bokeh",
|
|
11
|
+
"lights",
|
|
12
|
+
"particles"
|
|
13
|
+
]
|
|
14
|
+
},
|
|
15
|
+
"cost": 1,
|
|
16
|
+
"modes": "both",
|
|
17
|
+
"params": {
|
|
18
|
+
"density": {
|
|
19
|
+
"type": "number",
|
|
20
|
+
"default": 1,
|
|
21
|
+
"minimum": 0.2,
|
|
22
|
+
"maximum": 3
|
|
23
|
+
},
|
|
24
|
+
"size": {
|
|
25
|
+
"type": "number",
|
|
26
|
+
"default": 1,
|
|
27
|
+
"minimum": 0.3,
|
|
28
|
+
"maximum": 3
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"conflicts": [],
|
|
32
|
+
"source": "https://threejs.org/examples/#webgl_buffergeometry_instancing_billboards",
|
|
33
|
+
"licence": "MIT"
|
|
34
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { FxContext, FxFactory, FxHandle, FxParams } from "./types.js";
|
|
2
|
+
import { countFor, num, softSprite } from "./util.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Camera-facing instanced quads (three `webgl_buffergeometry_instancing_billboards`):
|
|
6
|
+
* one draw call, per-instance offset + scale, the shader strips rotation so
|
|
7
|
+
* every quad faces the view. Drift is `sin(t)`, no accumulated motion.
|
|
8
|
+
*/
|
|
9
|
+
export const create: FxFactory = (ctx: FxContext, params: FxParams): FxHandle => {
|
|
10
|
+
const { THREE, palette, rng } = ctx;
|
|
11
|
+
const count = countFor(ctx, 1, num(params, "density", 1), 100);
|
|
12
|
+
const size = num(params, "size", 1);
|
|
13
|
+
const tex = softSprite(THREE, 32, 2.2);
|
|
14
|
+
|
|
15
|
+
const geo = new THREE.InstancedBufferGeometry();
|
|
16
|
+
geo.setAttribute("position", new THREE.Float32BufferAttribute([-0.5, 0.5, 0, -0.5, -0.5, 0, 0.5, 0.5, 0, 0.5, -0.5, 0], 3));
|
|
17
|
+
geo.setAttribute("uv", new THREE.Float32BufferAttribute([0, 1, 0, 0, 1, 1, 1, 0], 2));
|
|
18
|
+
geo.setIndex([0, 1, 2, 2, 1, 3]);
|
|
19
|
+
const offsets = new Float32Array(count * 3);
|
|
20
|
+
const scales = new Float32Array(count);
|
|
21
|
+
const phases = new Float32Array(count);
|
|
22
|
+
for (let i = 0; i < count; i++) {
|
|
23
|
+
offsets[i * 3] = (rng() - 0.5) * 30;
|
|
24
|
+
offsets[i * 3 + 1] = (rng() - 0.5) * 12;
|
|
25
|
+
offsets[i * 3 + 2] = -(1 + rng() * 14);
|
|
26
|
+
scales[i] = (0.15 + rng() * 0.5) * size;
|
|
27
|
+
phases[i] = rng() * 6.28;
|
|
28
|
+
}
|
|
29
|
+
geo.setAttribute("offset", new THREE.InstancedBufferAttribute(offsets, 3));
|
|
30
|
+
geo.setAttribute("scale", new THREE.InstancedBufferAttribute(scales, 1));
|
|
31
|
+
geo.setAttribute("phase", new THREE.InstancedBufferAttribute(phases, 1));
|
|
32
|
+
|
|
33
|
+
const mat = new THREE.RawShaderMaterial({
|
|
34
|
+
uniforms: { map: { value: tex }, time: { value: 0 }, tint: { value: new THREE.Color(palette.accent) }, tint2: { value: new THREE.Color(palette.second) } },
|
|
35
|
+
vertexShader: [
|
|
36
|
+
"precision highp float; uniform mat4 modelViewMatrix, projectionMatrix; uniform float time;",
|
|
37
|
+
"attribute vec3 position; attribute vec2 uv; attribute vec3 offset; attribute float scale; attribute float phase;",
|
|
38
|
+
"varying vec2 vUv; varying float vMix;",
|
|
39
|
+
"void main(){ vUv = uv; vMix = 0.5 + 0.5 * sin(phase);",
|
|
40
|
+
" vec3 o = offset + vec3(sin(time * 0.3 + phase), cos(time * 0.2 + phase * 1.3), 0.0) * 0.6;",
|
|
41
|
+
" vec4 mv = modelViewMatrix * vec4(o, 1.0); mv.xy += position.xy * scale * (1.0 + 0.2 * sin(time + phase));",
|
|
42
|
+
" gl_Position = projectionMatrix * mv; }",
|
|
43
|
+
].join("\n"),
|
|
44
|
+
fragmentShader: [
|
|
45
|
+
"precision highp float; uniform sampler2D map; uniform vec3 tint, tint2; varying vec2 vUv; varying float vMix;",
|
|
46
|
+
"void main(){ vec4 t = texture2D(map, vUv); gl_FragColor = vec4(mix(tint, tint2, vMix), t.a * 0.8); }",
|
|
47
|
+
].join("\n"),
|
|
48
|
+
transparent: true,
|
|
49
|
+
depthWrite: false,
|
|
50
|
+
});
|
|
51
|
+
const mesh = new THREE.Mesh(geo, mat);
|
|
52
|
+
mesh.frustumCulled = false;
|
|
53
|
+
const holder = new THREE.Group();
|
|
54
|
+
holder.add(mesh);
|
|
55
|
+
holder.userData.count = count;
|
|
56
|
+
return {
|
|
57
|
+
object: holder,
|
|
58
|
+
tick: (t) => {
|
|
59
|
+
mat.uniforms.time.value = t;
|
|
60
|
+
},
|
|
61
|
+
dispose: () => {
|
|
62
|
+
geo.dispose();
|
|
63
|
+
mat.dispose();
|
|
64
|
+
tex.dispose();
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "bloom",
|
|
3
|
+
"kind": "post",
|
|
4
|
+
"tags": {
|
|
5
|
+
"mood": [
|
|
6
|
+
"dramatic",
|
|
7
|
+
"premium"
|
|
8
|
+
],
|
|
9
|
+
"content": [
|
|
10
|
+
"highlight"
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
"cost": 2,
|
|
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://github.com/pmndrs/postprocessing",
|
|
25
|
+
"licence": "Zlib"
|
|
26
|
+
}
|
package/src/fx/bloom.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "camera-drift",
|
|
3
|
+
"kind": "motion",
|
|
4
|
+
"tags": {
|
|
5
|
+
"mood": [
|
|
6
|
+
"cinematic",
|
|
7
|
+
"calm"
|
|
8
|
+
],
|
|
9
|
+
"content": [
|
|
10
|
+
"motion"
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
"cost": 2,
|
|
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 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,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "capital-flows",
|
|
3
|
+
"kind": "background",
|
|
4
|
+
"tags": {
|
|
5
|
+
"mood": [
|
|
6
|
+
"kinetic",
|
|
7
|
+
"commercial"
|
|
8
|
+
],
|
|
9
|
+
"content": [
|
|
10
|
+
"investment",
|
|
11
|
+
"scrutiny"
|
|
12
|
+
],
|
|
13
|
+
"topic": [
|
|
14
|
+
"money"
|
|
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
|
+
},
|
|
27
|
+
"conflicts": [],
|
|
28
|
+
"source": "https://github.com/BlackBeltTechnology/pi-agent-dashboard",
|
|
29
|
+
"licence": "MIT"
|
|
30
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// capital-flows — capital streams converging on a narrowing gate (topic: money). Licence: MIT.
|
|
2
|
+
import type { FxContext, FxFactory, FxHandle, FxParams } from "./types.js";
|
|
3
|
+
|
|
4
|
+
export const create: FxFactory = function (ctx: FxContext, params: FxParams): FxHandle {
|
|
5
|
+
const { THREE, palette, quality, rng } = ctx;
|
|
6
|
+
const density = typeof params.density === "number" ? params.density : 1;
|
|
7
|
+
const count = Math.max(30, Math.round((quality.particles / 6) * density));
|
|
8
|
+
|
|
9
|
+
const geo = new THREE.BufferGeometry();
|
|
10
|
+
const positions = new Float32Array(count * 3);
|
|
11
|
+
geo.setAttribute("position", new THREE.BufferAttribute(positions, 3));
|
|
12
|
+
const colors = new Float32Array(count * 3);
|
|
13
|
+
geo.setAttribute("color", new THREE.BufferAttribute(colors, 3));
|
|
14
|
+
const mat = new THREE.PointsMaterial({ color: palette.accent, size: 0.16, transparent: true, opacity: 0.85, vertexColors: true });
|
|
15
|
+
const points = new THREE.Points(geo, mat);
|
|
16
|
+
|
|
17
|
+
const seeds: Array<Record<string, number>> = [];
|
|
18
|
+
// Each mote gets its own angle AND radius, so the stream fills the cone
|
|
19
|
+
// instead of tracing one curve: `sin(lane)` alone put every mote on a line.
|
|
20
|
+
for (let i = 0; i < count; i++) {
|
|
21
|
+
seeds.push({
|
|
22
|
+
ang: rng() * Math.PI * 2,
|
|
23
|
+
rad: Math.sqrt(rng()),
|
|
24
|
+
off: rng(),
|
|
25
|
+
speed: 0.1 + rng() * 0.25,
|
|
26
|
+
jitter: (rng() - 0.5) * 0.02,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const group = new THREE.Group();
|
|
31
|
+
group.add(points);
|
|
32
|
+
group.position.set(0, 0, -12);
|
|
33
|
+
const holder = new THREE.Group();
|
|
34
|
+
holder.add(group);
|
|
35
|
+
holder.userData.count = count;
|
|
36
|
+
|
|
37
|
+
// Ramp over the first and last 18% of a mote's travel.
|
|
38
|
+
const fade = function (k: number) {
|
|
39
|
+
return Math.min(1, k / 0.18, (1 - k) / 0.18);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const place = function (t: number) {
|
|
43
|
+
for (let i = 0; i < count; i++) {
|
|
44
|
+
const s = seeds[i];
|
|
45
|
+
const k = (s.off + t * s.speed) % 1;
|
|
46
|
+
// Wide at the source, pinched at the gate.
|
|
47
|
+
const spread = (1 - k) * 9 + 0.3;
|
|
48
|
+
positions[i * 3] = Math.cos(s.ang) * s.rad * spread;
|
|
49
|
+
positions[i * 3 + 1] = s.jitter + Math.sin(s.ang) * s.rad * spread * 0.55;
|
|
50
|
+
positions[i * 3 + 2] = -k * 16;
|
|
51
|
+
// A mote reaching the gate used to vanish between two frames. Fading it
|
|
52
|
+
// in at birth and out at death hides the wrap.
|
|
53
|
+
const f = fade(k);
|
|
54
|
+
colors[i * 3] = f;
|
|
55
|
+
colors[i * 3 + 1] = f;
|
|
56
|
+
colors[i * 3 + 2] = f;
|
|
57
|
+
}
|
|
58
|
+
geo.attributes.position.needsUpdate = true;
|
|
59
|
+
geo.attributes.color.needsUpdate = true;
|
|
60
|
+
};
|
|
61
|
+
place(0);
|
|
62
|
+
|
|
63
|
+
return { object: holder, tick: place, dispose: function () { geo.dispose(); mat.dispose(); } };
|
|
64
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Effect catalogue — the single Markdown source of truth (`reference/effects.md`)
|
|
3
|
+
* generated from the cards, plus a hash the corpus test compares.
|
|
4
|
+
*/
|
|
5
|
+
import { createHash } from "node:crypto";
|
|
6
|
+
import { REGISTRY } from "./index.js";
|
|
7
|
+
import type { FxCard, FxTopic } from "./types.js";
|
|
8
|
+
|
|
9
|
+
export interface CatalogueEntry {
|
|
10
|
+
id: string;
|
|
11
|
+
kind: FxCard["kind"];
|
|
12
|
+
cost: number;
|
|
13
|
+
modes: FxCard["modes"];
|
|
14
|
+
mood: string[];
|
|
15
|
+
content: string[];
|
|
16
|
+
topic?: FxTopic[];
|
|
17
|
+
source: string;
|
|
18
|
+
licence: string;
|
|
19
|
+
params: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Sorted catalogue rows (id order) for `fx list` and the generated doc. */
|
|
23
|
+
export function catalogue(): CatalogueEntry[] {
|
|
24
|
+
return Object.values(REGISTRY)
|
|
25
|
+
.map(({ card }) => ({
|
|
26
|
+
id: card.id,
|
|
27
|
+
kind: card.kind,
|
|
28
|
+
cost: card.cost,
|
|
29
|
+
modes: card.modes,
|
|
30
|
+
mood: card.tags.mood,
|
|
31
|
+
content: card.tags.content,
|
|
32
|
+
...(card.tags.topic ? { topic: card.tags.topic } : {}),
|
|
33
|
+
source: card.source,
|
|
34
|
+
licence: card.licence,
|
|
35
|
+
params: Object.keys(card.params).sort().join(", "),
|
|
36
|
+
}))
|
|
37
|
+
.sort((a, b) => a.id.localeCompare(b.id));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Stable hash of every card (catalogue drift detector). */
|
|
41
|
+
export function catalogueHash(): string {
|
|
42
|
+
const canonical = Object.values(REGISTRY)
|
|
43
|
+
.map(({ card }) => JSON.stringify(card))
|
|
44
|
+
.sort()
|
|
45
|
+
.join("\n");
|
|
46
|
+
return createHash("sha256").update(canonical).digest("hex");
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function paramTable(card: FxCard): string {
|
|
50
|
+
const rows = Object.entries(card.params).map(([name, schema]) => {
|
|
51
|
+
const s = schema as { type?: string; default?: unknown; minimum?: number; maximum?: number };
|
|
52
|
+
const range = s.minimum !== undefined || s.maximum !== undefined ? `${s.minimum ?? ""}..${s.maximum ?? ""}` : "—";
|
|
53
|
+
return `| ${name} | ${s.type ?? ""} | ${range} | ${s.default ?? ""} |`;
|
|
54
|
+
});
|
|
55
|
+
if (!rows.length) return "No parameters.";
|
|
56
|
+
return ["| Param | Type | Range | Default |", "|---|---|---|---|", ...rows].join("\n");
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** `reference/effects.md` body. */
|
|
60
|
+
export function renderCatalogue(): string {
|
|
61
|
+
const hash = catalogueHash();
|
|
62
|
+
const out: string[] = [
|
|
63
|
+
"# deck3d effect catalogue",
|
|
64
|
+
"",
|
|
65
|
+
`GENERATED from the effect cards (\`fx/<id>.meta.json\`). Never hand-edit. Cards hash: \`${hash}\`.`,
|
|
66
|
+
"",
|
|
67
|
+
`${Object.keys(REGISTRY).length} effects.`,
|
|
68
|
+
"",
|
|
69
|
+
];
|
|
70
|
+
for (const card of Object.values(REGISTRY)
|
|
71
|
+
.map((e) => e.card)
|
|
72
|
+
.sort((a, b) => a.id.localeCompare(b.id))) {
|
|
73
|
+
out.push(
|
|
74
|
+
`## ${card.id}`,
|
|
75
|
+
"",
|
|
76
|
+
`- kind: \`${card.kind}\``,
|
|
77
|
+
`- cost: ${card.cost}`,
|
|
78
|
+
`- modes: \`${card.modes}\``,
|
|
79
|
+
`- tags: mood=[${card.tags.mood.join(", ")}] content=[${card.tags.content.join(", ")}]`,
|
|
80
|
+
`- source: ${card.source}`,
|
|
81
|
+
`- licence: ${card.licence}`,
|
|
82
|
+
`- preview: \`fx/previews/${card.id}.png\``,
|
|
83
|
+
"",
|
|
84
|
+
paramTable(card),
|
|
85
|
+
"",
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
return `${out.join("\n")}`;
|
|
89
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "chromatic-aberration",
|
|
3
|
+
"kind": "post",
|
|
4
|
+
"tags": {
|
|
5
|
+
"mood": [
|
|
6
|
+
"dramatic",
|
|
7
|
+
"neon"
|
|
8
|
+
],
|
|
9
|
+
"content": [
|
|
10
|
+
"highlight"
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
"cost": 2,
|
|
14
|
+
"modes": "dark",
|
|
15
|
+
"params": {
|
|
16
|
+
"offset": {
|
|
17
|
+
"type": "number",
|
|
18
|
+
"default": 0.003,
|
|
19
|
+
"minimum": 0,
|
|
20
|
+
"maximum": 0.02
|
|
21
|
+
},
|
|
22
|
+
"angle": {
|
|
23
|
+
"type": "number",
|
|
24
|
+
"default": 0,
|
|
25
|
+
"minimum": 0,
|
|
26
|
+
"maximum": 6.2832
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"conflicts": [],
|
|
30
|
+
"source": "https://github.com/pmndrs/postprocessing",
|
|
31
|
+
"licence": "Zlib"
|
|
32
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "city-grid",
|
|
3
|
+
"kind": "background",
|
|
4
|
+
"tags": {
|
|
5
|
+
"mood": [
|
|
6
|
+
"urban",
|
|
7
|
+
"structured"
|
|
8
|
+
],
|
|
9
|
+
"content": [
|
|
10
|
+
"infrastructure",
|
|
11
|
+
"growth"
|
|
12
|
+
],
|
|
13
|
+
"topic": [
|
|
14
|
+
"work",
|
|
15
|
+
"sales"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"cost": 3,
|
|
19
|
+
"modes": "both",
|
|
20
|
+
"params": {
|
|
21
|
+
"density": {
|
|
22
|
+
"type": "number",
|
|
23
|
+
"default": 1,
|
|
24
|
+
"minimum": 0.2,
|
|
25
|
+
"maximum": 3
|
|
26
|
+
},
|
|
27
|
+
"speed": {
|
|
28
|
+
"type": "number",
|
|
29
|
+
"default": 1,
|
|
30
|
+
"minimum": 0,
|
|
31
|
+
"maximum": 3
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"conflicts": [],
|
|
35
|
+
"source": "https://threejs.org/examples/#webgl_instancing_performance",
|
|
36
|
+
"licence": "MIT"
|
|
37
|
+
}
|