@dopaminefx/effect-heartburst 0.1.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/dist/heartburst-renderer.d.ts +84 -0
- package/dist/heartburst-renderer.d.ts.map +1 -0
- package/dist/heartburst-renderer.js +247 -0
- package/dist/heartburst-renderer.js.map +1 -0
- package/dist/heartburst-shader.d.ts +31 -0
- package/dist/heartburst-shader.d.ts.map +1 -0
- package/dist/heartburst-shader.js +214 -0
- package/dist/heartburst-shader.js.map +1 -0
- package/dist/heartburst.dope.json +1827 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/package.json +46 -0
- package/src/heartburst-renderer.ts +289 -0
- package/src/heartburst-shader.ts +223 -0
- package/src/heartburst.dope.json +1827 -0
- package/src/index.ts +40 -0
package/src/index.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Heartburst (the love / like / favorite success effect) — the DATA-DRIVEN
|
|
3
|
+
* panel factory shim.
|
|
4
|
+
*
|
|
5
|
+
* Everything that isn't the shader or the Canvas2D draw is DATA in
|
|
6
|
+
* heartburst.dope.json, interpreted by the shared backbone:
|
|
7
|
+
* - the mood→params mapping + the warm OKLCH golden-angle palette (the loader),
|
|
8
|
+
* - the per-frame lub-dub/burst logic (`tempo.frame` — amp + the
|
|
9
|
+
* presence/beat/burst/flash extras, delta-0 with the old hand hooks),
|
|
10
|
+
* - the shadow height (`render.shadowHeightFrac`), the dpr-scaled halftone
|
|
11
|
+
* cell (`render.pass`), the panel wiring (`render.panel`), the no-snap
|
|
12
|
+
* clock (`render.config.stepping: "none"`), and `tempo.reducedMotion`,
|
|
13
|
+
* - the uniform `binding` contract (the `u<Name>` list + exceptions).
|
|
14
|
+
*
|
|
15
|
+
* The genuinely code-shaped parts that stay JS are the GLSL
|
|
16
|
+
* (heartburst-shader.ts — the single source the MSL + Kotlin shaders are
|
|
17
|
+
* generated from) and the Canvas2D panel draw (heartburst-renderer.ts).
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import {
|
|
21
|
+
HEARTBURST_FRAGMENT_SRC,
|
|
22
|
+
HEARTBURST_VERTEX_SRC,
|
|
23
|
+
} from "./heartburst-shader.js";
|
|
24
|
+
import { drawHeartburstFrame } from "./heartburst-renderer.js";
|
|
25
|
+
import { parseDope, registerDopePanelEffect } from "@dopaminefx/core";
|
|
26
|
+
import doc from "./heartburst.dope.json";
|
|
27
|
+
|
|
28
|
+
export type { HeartburstRenderParams } from "./heartburst-renderer.js";
|
|
29
|
+
|
|
30
|
+
const DOPE = parseDope(doc as object);
|
|
31
|
+
|
|
32
|
+
// Registers the EffectFactory AND the bundled "heartburst" program (so
|
|
33
|
+
// loadEffect() can bind a host-authored heartburst variant with no code).
|
|
34
|
+
export const heartburst = registerDopePanelEffect(
|
|
35
|
+
DOPE,
|
|
36
|
+
{ vertex: HEARTBURST_VERTEX_SRC, fragment: HEARTBURST_FRAGMENT_SRC },
|
|
37
|
+
drawHeartburstFrame,
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
export default heartburst;
|