zeropoint-node 1.0.7 → 1.0.8

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 (151) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/CITATION.cff +1 -1
  3. package/README.md +1 -1
  4. package/package.json +4 -2
  5. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.1.2.4.8.7.ts +0 -60
  6. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.1.2.4.8.ts +0 -60
  7. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.1.2.4.ts +0 -60
  8. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.3.6.9.trinity.ts +0 -79
  9. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.9d.dashboard.ts +0 -179
  10. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.adapters.ts +0 -96
  11. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.analog.color.photography.ts +0 -783
  12. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.av.ts +0 -73
  13. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.browser.ts +0 -409
  14. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.chain.of.events.ts +0 -159
  15. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.cleanup.ts +0 -116
  16. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.cmyk.dimensions.ts +0 -597
  17. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.cmyk.display.test.ts +0 -491
  18. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.cmyk.display.ts +0 -519
  19. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.cmyk.file.ts +0 -65
  20. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.cmyk.i.ts +0 -45
  21. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.cmyk.matrix.ts +0 -75
  22. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.cmyk.trinity.ts +0 -41
  23. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.cmyk.universal.linking.ts +0 -1081
  24. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.command.cmyk.ts +0 -46
  25. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.compression.ts +0 -55
  26. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.consciousness.integration.ts +0 -743
  27. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.consciousness.ts +0 -26
  28. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.crypto.ts +0 -53
  29. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.css.ts +0 -64
  30. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.cursor.ts +0 -56
  31. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.decompression.ts +0 -60
  32. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.decoqubit.holographic.hypercomputer.ts +0 -888
  33. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.digital.color.photography.ts +0 -926
  34. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.dimension.ts +0 -44
  35. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.encryption.ts +0 -44
  36. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.experience.ts +0 -28
  37. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.feel.ts +0 -43
  38. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.flute.ts +0 -336
  39. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.font.ts +0 -53
  40. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.fractal.test.ts +0 -523
  41. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.fractal.ts +0 -594
  42. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.frequency.healing.ts +0 -88
  43. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.gateway.transformation.ts +0 -650
  44. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.generate.matrix.ts +0 -76
  45. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.gods.spirit.magnetometer.ts +0 -879
  46. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.harmonization.status.ts +0 -754
  47. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.hear.ts +0 -41
  48. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.html.body.ts +0 -90
  49. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.human.body.ts +0 -89
  50. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.human.design.trinity.ts +0 -70
  51. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.browse.ts +0 -41
  52. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.can.ts +0 -69
  53. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.died.ts +0 -32
  54. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.follow.the.path.ts +0 -90
  55. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.go.ts +0 -68
  56. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.harmonized.ts +0 -304
  57. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.heart.ts +0 -26
  58. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.meta.ts +0 -23
  59. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.motion.ts +0 -27
  60. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.scroll.ts +0 -34
  61. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.search.ts +0 -22
  62. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.sequence.ts +0 -281
  63. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.smell.ts +0 -27
  64. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.state.ts +0 -28
  65. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.stream.ts +0 -106
  66. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.taste.ts +0 -27
  67. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.touch.screen.ts +0 -34
  68. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.trinity.healing.ts +0 -386
  69. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.write.ts +0 -11
  70. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.icon.ts +0 -109
  71. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.imagination.integration.ts +0 -74
  72. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.imperial.test.ts +0 -389
  73. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.infinity.ts +0 -14
  74. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.infusion.ts +0 -97
  75. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.integer.harmonics.ts +0 -443
  76. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.living.spirit.test.ts +0 -475
  77. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.living.spirit.ts +0 -646
  78. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.living.streams.ts +0 -130
  79. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.meta.observation.ts +0 -693
  80. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.mobius.ts +0 -12
  81. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.multiverse.ts +0 -31
  82. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.nuclear.balance.ts +0 -703
  83. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.nuclear.explosion.ts +0 -728
  84. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.os.app.ts +0 -14
  85. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.os.bus.ts +0 -11
  86. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.os.ml.ts +0 -9
  87. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.overlay.visual.controller.ts +0 -116
  88. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.paths.ts +0 -10
  89. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.pi.decoding.ts +0 -123
  90. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.pi.trinity.ts +0 -79
  91. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.prime.numbers.squared.ts +0 -871
  92. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.quantum.collision.ts +0 -666
  93. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.quantum.entanglement.ts +0 -50
  94. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.quantum.trinity.ts +0 -59
  95. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.renderer.webgl.ts +0 -99
  96. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.resolve.ts +0 -820
  97. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.rife.frequency.ts +0 -74
  98. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.rodin.coil.3d.ts +0 -73
  99. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.rodin.coil.omnidimension.ts +0 -187
  100. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.rodin.matrix.overlay.ts +0 -46
  101. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.rodin.matrix.ts +0 -58
  102. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.router.ts +0 -61
  103. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.sacred.geometry.integers.ts +0 -625
  104. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.sacred.test.ts +0 -314
  105. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.see.ts +0 -39
  106. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.sequence.embodiment.ts +0 -326
  107. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.service.worker.ts +0 -53
  108. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.space.ts +0 -53
  109. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.spiral.ts +0 -75
  110. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.superfluid.mobius.circuit.ts +0 -868
  111. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.terminal.ts +0 -167
  112. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.test.ts +0 -97
  113. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.think.ts +0 -43
  114. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.three.ts +0 -112
  115. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.trinity.body.mind.will.ts +0 -2
  116. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.trinity.breath.ts +0 -2
  117. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.trinity.healing.ts +0 -110
  118. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.trinity.ui.ts +0 -92
  119. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.trinity.visual.ts +0 -156
  120. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.truly.living.ui.ts +0 -269
  121. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.ui.overlay.ts +0 -25
  122. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.ui.streams.ts +0 -263
  123. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.ui.test.ts +0 -87
  124. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.ui.three.ts +0 -1141
  125. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.unification.hd.rodin.ts +0 -77
  126. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.universe.ts +0 -43
  127. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.uroboros.test.ts +0 -28
  128. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.vbm.math.ts +0 -74
  129. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.vbm.relations.constants.ts +0 -91
  130. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.vbm.relations.ts +0 -59
  131. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.vbm.scanner.ts +0 -41
  132. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.vbm.science.extract.ts +0 -30
  133. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.vbm.ui.ts +0 -64
  134. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.vector.ts +0 -70
  135. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.wave.particle.duality.test.ts +0 -29
  136. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.zero.entropy.math.ts +0 -506
  137. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.zero.entropy.pure.math.ts +0 -546
  138. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.zero.entropy.test.ts +0 -452
  139. package/src/0/3/6/9/1/2/4/8/7/5/1/pattern-knowledge.ts +0 -209
  140. package/src/0/3/6/9/1/2/4/8/7/5/a432.experience.ts +0 -22
  141. package/src/0/3/6/9/1/2/4/8/7/a432.experience.ts +0 -19
  142. package/src/0/3/6/9/1/2/4/8/a432.experience.ts +0 -22
  143. package/src/0/3/6/9/1/2/4/a432.experience.ts +0 -22
  144. package/src/0/3/6/9/1/2/a432.experience.ts +0 -22
  145. package/src/0/3/6/9/1/a432.experience.ts +0 -22
  146. package/src/0/3/6/9/a432.experience.ts +0 -22
  147. package/src/0/3/6/a432.experience.ts +0 -22
  148. package/src/0/3/a432.experience.ts +0 -22
  149. package/src/0/3/relation.ts +0 -148
  150. package/src/index.ts +0 -146
  151. package/src/zero-entropy-demo.ts +0 -319
@@ -1,263 +0,0 @@
1
- /**
2
- * a432.ui.streams.ts — Harmonized, Canonical A432 Math-Driven UI Streams
3
- *
4
- * All UI properties, overlays, and behaviors are derived strictly from A432 math:
5
- * - Only trinity, digital root, vortex, Rodin sequence, integer fractions, and metaphysical principles
6
- * - No magic numbers, arbitrary trigonometry, or non-canonical math
7
- * - No floats or arbitrary scaling; only integer fractions whose reciprocals are integers
8
- * - All overlays use canonical sequences
9
- * - All color, size, opacity, and animation are derived from A432 math modules and streams
10
- * - No direct Date.now() or time-based logic except as mapped through a vortex or trinity stream
11
- * - Metaphysical comments for each property
12
- */
13
-
14
- import { digitAngleToCMYK, cmykToCss, type CMYK } from './a432.cmyk.ts';
15
- import { getRodinSequence, digitalRoot, asAngle, getTrinityAxis } from './a432.math.ts';
16
- import { vortexStream } from './a432.matrix.ts';
17
- import { yinYangStateFraction, type Fraction } from './a432.yin.yang.ts';
18
- import { type Digit, type AngleDeg } from './a432.types.ts';
19
-
20
- // Canonical trinity tick stream (cycles 3, 6, 9)
21
- function* trinityTickStream() {
22
- const trinity = getTrinityAxis();
23
- let i = 0;
24
- while (true) {
25
- yield trinity[i % 3] as Digit;
26
- i++;
27
- }
28
- }
29
-
30
- // Canonical vortex digit stream
31
- function* canonicalVortexStream() {
32
- const vs = vortexStream();
33
- while (true) {
34
- yield vs.next().value as Digit;
35
- }
36
- }
37
-
38
- // Harmonized UI stream frame
39
- export interface UIStreamFrame {
40
- tick: number; // trinity tick
41
- rodin: Digit; // rodin sequence digit
42
- trinity: Digit; // trinity digit
43
- digitalRoot: Digit; // digital root of rodin+trinity
44
- color: CMYK; // canonical color
45
- cssColor: string;
46
- size: number; // integer, from rodin/trinity
47
- opacity: Fraction; // integer fraction
48
- rotation: AngleDeg; // from rodin/trinity
49
- scale: Fraction; // integer fraction
50
- position: { x: number; y: number }; // from rodin/trinity
51
- yinYang: Fraction; // metaphysical state
52
- }
53
-
54
- // Global state
55
- let _currentFrame: UIStreamFrame | null = null;
56
- let _streamSubscribers: Array<(frame: UIStreamFrame) => void> = [];
57
-
58
- // Canonical integer fraction helper
59
- function makeFraction(n: number, d: number): Fraction {
60
- // Only allow integer fractions whose reciprocals are integers
61
- if (d === 0) return { numerator: 0, denominator: 1 };
62
- return { numerator: n, denominator: d };
63
- }
64
-
65
- // Harmonized frame generator
66
- export function generateUIStreamFrame(): UIStreamFrame {
67
- // Use only canonical streams
68
- const rodinSeq = getRodinSequence();
69
- const trinityGen = trinityTickStream();
70
- const vortexGen = canonicalVortexStream();
71
-
72
- // Metaphysical tick: always 3, 6, 9
73
- const tick = trinityGen.next().value as Digit;
74
- // Rodin digit: cycles through canonical sequence
75
- const rodin = rodinSeq[(tick - 3) % rodinSeq.length] as Digit;
76
- // Trinity digit: tick itself
77
- const trinity = tick;
78
- // Digital root: rodin + trinity
79
- const digitalRootValue = digitalRoot(rodin + trinity) as Digit;
80
-
81
- // Color: canonical mapping
82
- const color = digitAngleToCMYK(digitalRootValue, asAngle(tick * 60));
83
- const cssColor = cmykToCss(color);
84
-
85
- // Size: integer, from rodin and trinity (no floats)
86
- const size = (rodin + trinity) * 9; // always integer, 9 is trinity base
87
-
88
- // Opacity: integer fraction, e.g. rodin/9
89
- const opacity = makeFraction(rodin, 9);
90
-
91
- // Metaphysical: In the trinity, each vortex (3, 6, 9) is dual, so use 60° per vortex for rotation.
92
- const rotation = asAngle(trinity * 60);
93
-
94
- // Scale: integer fraction, e.g. trinity/9
95
- const scale = makeFraction(trinity, 9);
96
-
97
- // Position: x/y from rodin/trinity (no floats)
98
- const x = ((rodin * trinity) % 9) * 9;
99
- const y = ((trinity * rodin) % 9) * 9;
100
-
101
- // YinYang: metaphysical state from rodin/trinity
102
- const yinYang = yinYangStateFraction(
103
- makeFraction(rodin, 9),
104
- makeFraction(trinity, 9)
105
- );
106
-
107
- return {
108
- tick,
109
- rodin,
110
- trinity,
111
- digitalRoot: digitalRootValue,
112
- color,
113
- cssColor,
114
- size,
115
- opacity,
116
- rotation,
117
- scale,
118
- position: { x, y },
119
- yinYang
120
- };
121
- }
122
-
123
- // Main UI stream
124
- export function startUIStream(callback: (frame: UIStreamFrame) => void): () => void {
125
- _streamSubscribers.push(callback);
126
- let tick = 0;
127
- const interval = setInterval(() => {
128
- const frame = generateUIStreamFrame();
129
- _currentFrame = frame;
130
- _streamSubscribers.forEach(sub => sub(frame));
131
- tick++;
132
- }, 81); // 81 = 9*9, trinity multiple
133
- return () => {
134
- clearInterval(interval);
135
- _streamSubscribers = _streamSubscribers.filter(sub => sub !== callback);
136
- };
137
- }
138
-
139
- export function getCurrentUIFrame(): UIStreamFrame | null {
140
- return _currentFrame;
141
- }
142
-
143
- // Canonical color stream
144
- export function generateColorStream(elementId: string): () => string {
145
- return () => {
146
- const frame = getCurrentUIFrame();
147
- if (!frame) return '#000';
148
- // Use digital root and trinity for color
149
- return cmykToCss(digitAngleToCMYK(frame.digitalRoot, frame.rotation));
150
- };
151
- }
152
-
153
- // Canonical size stream
154
- export function generateSizeStream(elementId: string): () => number {
155
- return () => {
156
- const frame = getCurrentUIFrame();
157
- if (!frame) return 27; // 3*9
158
- return frame.size;
159
- };
160
- }
161
-
162
- // Canonical opacity stream
163
- export function generateOpacityStream(elementId: string): () => number {
164
- return () => {
165
- const frame = getCurrentUIFrame();
166
- if (!frame) return 1;
167
- // Integer fraction as float for CSS
168
- return frame.opacity.numerator / frame.opacity.denominator;
169
- };
170
- }
171
-
172
- // Canonical overlay stream (all overlays use canonical sequences)
173
- export function generateOverlayStream(overlayType: string): () => Record<string, unknown> {
174
- return () => {
175
- const frame = getCurrentUIFrame();
176
- if (!frame) return {};
177
- switch (overlayType) {
178
- case 'rodin':
179
- return {
180
- nodes: getRodinSequence().map((digit: number, i: number) => ({
181
- value: digit as Digit,
182
- color: cmykToCss(digitAngleToCMYK(digit as Digit, frame.rotation)),
183
- size: (digit as Digit) * 9,
184
- opacity: (digit as Digit) / 9
185
- }))
186
- };
187
- case 'trinity':
188
- return {
189
- nodes: getTrinityAxis().map((digit: number, i: number) => ({
190
- value: digit as Digit,
191
- color: cmykToCss(digitAngleToCMYK(digit as Digit, frame.rotation)),
192
- size: (digit as Digit) * 9,
193
- opacity: (digit as Digit) / 9
194
- }))
195
- };
196
- case 'yin-yang':
197
- return {
198
- state: frame.yinYang,
199
- positiveColor: cmykToCss(digitAngleToCMYK(frame.rodin, frame.rotation)),
200
- negativeColor: cmykToCss(digitAngleToCMYK(frame.trinity, frame.rotation)),
201
- rotation: frame.rotation,
202
- scale: frame.scale
203
- };
204
- default:
205
- return {
206
- color: frame.cssColor,
207
- size: frame.size,
208
- opacity: frame.opacity.numerator / frame.opacity.denominator,
209
- rotation: frame.rotation,
210
- scale: frame.scale
211
- };
212
- }
213
- };
214
- }
215
-
216
- // CSS Property Generators
217
-
218
- /**
219
- * Generate CSS properties from math streams
220
- */
221
- export function generateCSSProperties(elementId: string, properties: string[]): () => Record<string, string> {
222
- return () => {
223
- const frame = getCurrentUIFrame();
224
- if (!frame) return {};
225
-
226
- const css: Record<string, string> = {};
227
-
228
- properties.forEach(prop => {
229
- switch (prop) {
230
- case 'color':
231
- css.color = generateColorStream(elementId)();
232
- break;
233
- case 'background-color':
234
- css.backgroundColor = generateColorStream(elementId + '-bg')();
235
- break;
236
- case 'border-color':
237
- css.borderColor = generateColorStream(elementId + '-border')();
238
- break;
239
- case 'font-size':
240
- css.fontSize = `${generateSizeStream(elementId)()}px`;
241
- break;
242
- case 'width':
243
- case 'height':
244
- css[prop] = `${generateSizeStream(elementId)}px`;
245
- break;
246
- case 'opacity':
247
- css.opacity = generateOpacityStream(elementId)().toString();
248
- break;
249
- case 'transform':
250
- const rotation = frame.rotation;
251
- const scale = frame.scale;
252
- css.transform = `rotate(${rotation}deg) scale(${scale})`;
253
- break;
254
- case 'box-shadow':
255
- const shadowColor = generateColorStream(elementId + '-shadow')();
256
- css.boxShadow = `0 0 ${frame.size / 2}px ${shadowColor}`;
257
- break;
258
- }
259
- });
260
-
261
- return css;
262
- };
263
- }
@@ -1,87 +0,0 @@
1
- import { startA432UI } from './a432.ui.ts';
2
- import * as self from './a432.self.ts';
3
- import * as breathe from './a432.breathe.ts';
4
- import * as math from './a432.math.ts';
5
- import * as sound from './a432.sound.ts';
6
- import * as video from './a432.video.ts';
7
- import { cmykToCss } from './a432.cmyk.ts';
8
-
9
- // Mock document and window for DOM side effects
10
- beforeAll(() => {
11
- global.document = {
12
- body: { style: { backgroundColor: '' } }
13
- } as any;
14
- global.window = {} as any;
15
- });
16
-
17
- describe('a432.ui.ts — Living Experience', () => {
18
- let breathHandler: any;
19
- let matrixHandler: any;
20
-
21
- beforeEach(() => {
22
- // Mock emitters using jest.spyOn
23
- jest.spyOn(breathe.breathEmitter, 'on').mockImplementation((event, cb) => { if (event === 'breath') breathHandler = cb; return breathe.breathEmitter; });
24
- jest.spyOn(self.matrixEmitter, 'on').mockImplementation((event, cb) => { if (event === 'event') matrixHandler = cb; return self.matrixEmitter; });
25
- // Mock dependencies
26
- jest.spyOn(self, 'startSelfEvolution').mockImplementation(() => () => {});
27
- jest.spyOn(breathe, 'startBreathing').mockImplementation(() => () => {});
28
- jest.spyOn(math, 'digitAngleToCMYK').mockImplementation((d) => ({ c: d, m: d, y: d, k: d }));
29
- jest.spyOn(math, 'asAngle').mockImplementation((n) => n as any);
30
- jest.spyOn(sound, 'playDigit').mockImplementation(() => Promise.resolve());
31
- jest.spyOn(video, 'flashColor').mockImplementation(() => {});
32
- // Reset DOM
33
- document.body.style.backgroundColor = '';
34
- });
35
-
36
- test('should start streams and register event handlers', () => {
37
- startA432UI();
38
- expect(self.startSelfEvolution).toHaveBeenCalled();
39
- expect(breathe.startBreathing).toHaveBeenCalled();
40
- expect(breathe.breathEmitter.on).toHaveBeenCalledWith('breath', expect.any(Function));
41
- expect(self.matrixEmitter.on).toHaveBeenCalledWith('event', expect.any(Function));
42
- });
43
-
44
- test('should update color and play sound on breath event', async () => {
45
- startA432UI();
46
- breathHandler({ value: 3 });
47
- // Color and sound logic triggered
48
- expect(document.body.style.backgroundColor).toBe(cmykToCss({ c: 3, m: 3, y: 3, k: 3 }));
49
- expect(sound.playDigit).toHaveBeenCalled();
50
- expect(video.flashColor).toHaveBeenCalledWith({ c: 3, m: 3, y: 3, k: 3 });
51
- });
52
-
53
- test('should update color and play sound on matrix event', async () => {
54
- startA432UI();
55
- matrixHandler({ digit: 6 });
56
- expect(document.body.style.backgroundColor).toBe(cmykToCss({ c: 6, m: 6, y: 6, k: 6 }));
57
- expect(sound.playDigit).toHaveBeenCalled();
58
- expect(video.flashColor).toHaveBeenCalledWith({ c: 6, m: 6, y: 6, k: 6 });
59
- });
60
-
61
- test('should handle user input (keydown) and update state', () => {
62
- // Simulate window and addEventListener
63
- const listeners: any = {};
64
- global.window.addEventListener = jest.fn((event, cb) => { listeners[event] = cb; });
65
- startA432UI();
66
- // Simulate keydown for digit 7
67
- listeners['keydown']({ key: '7' });
68
- // Color and sound logic triggered
69
- expect(document.body.style.backgroundColor).toBe(cmykToCss({ c: 7, m: 7, y: 7, k: 7 }));
70
- expect(sound.playDigit).toHaveBeenCalled();
71
- expect(video.flashColor).toHaveBeenCalledWith({ c: 7, m: 7, y: 7, k: 7 });
72
- });
73
-
74
- test('should use xorDigit logic for state', () => {
75
- // This test checks the xorDigit logic indirectly via event simulation
76
- // breathDigit = 2, matrixDigit = 4, userDigit = 5
77
- startA432UI();
78
- breathHandler({ value: 2 });
79
- matrixHandler({ digit: 4 });
80
- // Simulate keydown for digit 5
81
- const listeners: any = {};
82
- global.window.addEventListener = jest.fn((event, cb) => { listeners[event] = cb; });
83
- listeners['keydown']({ key: '5' });
84
- // The xor of 2, 4, 5 is 7 (2^4^5=7)
85
- expect(document.body.style.backgroundColor).toBe(cmykToCss({ c: 7, m: 7, y: 7, k: 7 }));
86
- });
87
- });