vireuikit 0.1.0 → 0.3.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/README.md +27 -0
- package/dist/{chunk-ZFX2MLKK.js → chunk-2AFVQ65S.js} +240 -18
- package/dist/chunk-2AFVQ65S.js.map +1 -0
- package/dist/dynamics-7Bq3LLds.d.cts +271 -0
- package/dist/dynamics-7Bq3LLds.d.ts +271 -0
- package/dist/index.cjs +224 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/web/index.cjs +340 -126
- package/dist/web/index.cjs.map +1 -1
- package/dist/web/index.d.cts +1 -1
- package/dist/web/index.d.ts +1 -1
- package/dist/web/index.js +21 -7
- package/dist/web/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-ZFX2MLKK.js.map +0 -1
- package/dist/dynamics-BqBoj03x.d.cts +0 -160
- package/dist/dynamics-BqBoj03x.d.ts +0 -160
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
type VireUIKitMediumChannel = readonly [number, number, number];
|
|
2
|
-
type VireUIKitMediumParams = {
|
|
3
|
-
/** 1/s — how fast the TRACK density decays per second. Water (vapor+condensate) does not decay:
|
|
4
|
-
* it is a conserved volume, only moving between phases and being transported. */
|
|
5
|
-
decay: number;
|
|
6
|
-
/** Spatial frequency of the curl-noise potential, 1/px of the simulation grid. */
|
|
7
|
-
curlFreq: number;
|
|
8
|
-
/** Drift speed of the noise domain over time, 1/s. */
|
|
9
|
-
curlSpeed: number;
|
|
10
|
-
/** Velocity field scale, grid-px/s — how far the smoke can be carried in a second. */
|
|
11
|
-
advectSpeed: number;
|
|
12
|
-
/** Turbulence gate, 0…1 (playback drives it: playing is alive, paused cools down). The
|
|
13
|
-
* per-frame value is computed by `createMediumDynamics` (`dynamics.ts`) — it arrives here
|
|
14
|
-
* already resolved. */
|
|
15
|
-
turbulence: number;
|
|
16
|
-
/** 1/s — the fraction of vapor EXCESS above `condensationFloor` that turns into condensate every
|
|
17
|
-
* second from background seeding: weak, everywhere, all the time — the chamber is never
|
|
18
|
-
* perfectly clean. */
|
|
19
|
-
condensationRate: number;
|
|
20
|
-
/** Vapor density (in seed-density units, a spot's peak ≈1) below which condensation does not
|
|
21
|
-
* happen at all — only the excess above it condenses. Without a floor, the condensate would
|
|
22
|
-
* exactly retrace the vapor spot's shape (the same outline, or softer from growth blur), and
|
|
23
|
-
* the two phases would have nowhere to visually diverge: vapor is already soft, so the floor
|
|
24
|
-
* concentrates condensate in dense turbulence cores, leaving the sparse vapor around it
|
|
25
|
-
* uncondensed. Keep it NOTICEABLY below the settled mean vapor level (turbulence stirs spots
|
|
26
|
-
* into a nearly flat background of ~0.3 over a few minutes — a known limit of the numerical
|
|
27
|
-
* advection): a floor above that mean eventually stops finding any excess at all, and
|
|
28
|
-
* condensation dies out for good. */
|
|
29
|
-
condensationFloor: number;
|
|
30
|
-
/** 1/s — the fraction of condensate evaporating back into vapor. Larger than the condensation
|
|
31
|
-
* rate: at equilibrium most of the water stays vapor, which is the "supersaturated" one. */
|
|
32
|
-
evaporationRate: number;
|
|
33
|
-
/** grid-px/s — condensate drift downward, on top of the shared velocity field: gravity touches
|
|
34
|
-
* droplets and leaves vapor alone. */
|
|
35
|
-
condensateSettleSpeed: number;
|
|
36
|
-
/** 1/s — the rate at which a droplet blends with its grid neighbors. There is no separate age
|
|
37
|
-
* counter: the blend repeats every frame, and whatever has survived more frames ends up more
|
|
38
|
-
* blended with its neighbors on its own — that IS "growth". Keep it NOTICEABLY below
|
|
39
|
-
* `evaporationRate`: over a droplet's average lifetime (1/evaporationRate) only a small
|
|
40
|
-
* fraction should get to blend — otherwise the blur outruns evaporation and the whole grid
|
|
41
|
-
* levels into flat fog before a droplet gets a chance to return to vapor (visible by eye: the
|
|
42
|
-
* contrast between "a patch of droplets" and the vapor background disappears within seconds). */
|
|
43
|
-
condensateSpreadRate: number;
|
|
44
|
-
/** 0…1 — how much of the local vapor hue shows through in the condensate. Droplets carry no
|
|
45
|
-
* color of their own (droplets scatter light rather than tint it) — this is only a faint hint
|
|
46
|
-
* of the surroundings. */
|
|
47
|
-
condensateTint: number;
|
|
48
|
-
/** Condensate's visibility multiplier in the Oklab mix relative to vapor at equal density —
|
|
49
|
-
* droplets hold a small share of the water's mass, but they are mostly what's visible (as in a
|
|
50
|
-
* real cloud: vapor is transparent, droplets create the visibility). */
|
|
51
|
-
condensateGain: number;
|
|
52
|
-
/** Near-white sRGB tone of droplets with no hue seeding (`condensateTint=0`) — droplets scatter
|
|
53
|
-
* light rather than color it. */
|
|
54
|
-
condensateColor: VireUIKitMediumChannel;
|
|
55
|
-
/** Each vapor species' hue, sRGB 0…1. Derived as a family around one tone (`speciesFamily`),
|
|
56
|
-
* not picked as three separate colors — see `species.ts`. */
|
|
57
|
-
channelColors: readonly [VireUIKitMediumChannel, VireUIKitMediumChannel, VireUIKitMediumChannel];
|
|
58
|
-
/** The platform's neutral tone — what the medium is, alone, with no source playing. */
|
|
59
|
-
baseColor: VireUIKitMediumChannel;
|
|
60
|
-
/** Background weight in the Oklab mix: keeps the platform tone visible even where the smoke is dense. */
|
|
61
|
-
baseWeight: number;
|
|
62
|
-
};
|
|
63
|
-
declare const MEDIUM_DEFAULTS: VireUIKitMediumParams;
|
|
64
|
-
/** The material probe can't see texture finer than this: there is no gain in a denser simulation
|
|
65
|
-
* grid than the probe's own floor. */
|
|
66
|
-
declare const MEDIUM_PROBE_FLOOR_PX = 22;
|
|
67
|
-
/** Device-px per simulation grid cell by default — noticeably coarser than the probe floor;
|
|
68
|
-
* sharpening the detail visible right next to the glass is a later increment (emission and
|
|
69
|
-
* palette). */
|
|
70
|
-
declare const MEDIUM_DEFAULT_CELL_PX = 26;
|
|
71
|
-
/**
|
|
72
|
-
* The geometry of one track stamp (`emit-shader.ts`), in FRACTIONS of `min(gridW, gridH)` rather
|
|
73
|
-
* than pixels — so a preset doesn't depend on the simulation grid's resolution. Two presets:
|
|
74
|
-
* alpha is a thick, short, straight track; beta is a thin, long, ragged one. The third, natural,
|
|
75
|
-
* is dim and short, for the occasional background track at rest (not tied to cover art).
|
|
76
|
-
*/
|
|
77
|
-
type VireUIKitMediumTrackPreset = {
|
|
78
|
-
lengthFrac: number;
|
|
79
|
-
headWidthFrac: number;
|
|
80
|
-
tailWidthFrac: number;
|
|
81
|
-
/** Amplitude of the path's sideways noise, as a fraction of `min(gridW, gridH)`; 0 = a straight thread. */
|
|
82
|
-
raggedFrac: number;
|
|
83
|
-
raggedFreq: number;
|
|
84
|
-
/** How far the tail has settled downward, as a fraction of `min(gridW, gridH)`. */
|
|
85
|
-
settleFrac: number;
|
|
86
|
-
/** How much dimmer the tail is than the head, 0…1. */
|
|
87
|
-
tailDim: number;
|
|
88
|
-
intensity: number;
|
|
89
|
-
};
|
|
90
|
-
declare const MEDIUM_TRACK_PRESETS: Readonly<Record<'alpha' | 'beta' | 'natural', VireUIKitMediumTrackPreset>>;
|
|
91
|
-
/** Turbulence at rest/paused/with no active track — the "slow drift" baseline shared by all three
|
|
92
|
-
* neutral states (they differ from each other in other ways, not in this number). */
|
|
93
|
-
declare const MEDIUM_DRIFT_TURBULENCE = 0.045;
|
|
94
|
-
/** Turbulence range during playback: the low end is a quiet stretch of the track, the high end is
|
|
95
|
-
* peak amplitude. */
|
|
96
|
-
declare const MEDIUM_PLAYING_TURBULENCE_RANGE: readonly [number, number];
|
|
97
|
-
/** Turbulence smoothing time constant, seconds: both ramping up on play and cooling down on pause
|
|
98
|
-
* go through this filter — smooth, never a jump. */
|
|
99
|
-
declare const MEDIUM_TURBULENCE_TAU = 2.5;
|
|
100
|
-
/** Emission cadence — once every this many beats, not on every beat: at 120–180 BPM that is
|
|
101
|
-
* 0.5–0.75 Hz, an order of magnitude below the WCAG 2.3.1 photosensitivity ceiling (3 Hz). */
|
|
102
|
-
declare const MEDIUM_EMISSION_BEATS = 4;
|
|
103
|
-
/** Fraction of the beats that actually get an emission — breaks up the exact periodicity (a
|
|
104
|
-
* metronome-perfect pulse reads as mechanical) without moving the average rate. */
|
|
105
|
-
declare const MEDIUM_EMISSION_PROBABILITY = 0.55;
|
|
106
|
-
/** Emergency floor between two emissions, seconds — a safeguard for the same WCAG 2.3.1
|
|
107
|
-
* requirement, independent of `MEDIUM_EMISSION_BEATS`/BPM: even a mistake in the other constants
|
|
108
|
-
* can't flash faster than this. */
|
|
109
|
-
declare const MEDIUM_MIN_EMISSION_INTERVAL = 1.2;
|
|
110
|
-
/** Average interval between solitary "background emission" tracks at rest, seconds, plus a random
|
|
111
|
-
* `MEDIUM_NATURAL_JITTER` on top — rare, with no discernible rhythm. */
|
|
112
|
-
declare const MEDIUM_NATURAL_INTERVAL = 25;
|
|
113
|
-
declare const MEDIUM_NATURAL_JITTER = 35;
|
|
114
|
-
/** The sensitive layer — fractions of height, top to bottom. Above it there isn't enough
|
|
115
|
-
* supersaturation for a track to appear at all, so background emission is only ever visible here. */
|
|
116
|
-
declare const MEDIUM_SENSITIVE_TOP = 0.55;
|
|
117
|
-
declare const MEDIUM_SENSITIVE_BOTTOM = 0.95;
|
|
118
|
-
|
|
119
|
-
type VireUIKitMediumPlaybackState = 'idle' | 'playing' | 'paused' | 'stopped';
|
|
120
|
-
type VireUIKitMediumTrackPresetName = keyof typeof MEDIUM_TRACK_PRESETS;
|
|
121
|
-
/** The fully resolved geometry of one track stamp — the platform layer (`web/medium.ts`)
|
|
122
|
-
* translates fractions into simulation-grid pixels and binds the uniforms, deciding nothing else:
|
|
123
|
-
* which preset, where, and how bright is entirely this model's call. */
|
|
124
|
-
type VireUIKitMediumEmission = VireUIKitMediumTrackPreset & {
|
|
125
|
-
/** 0…1, a fraction of the grid on both axes — the source point (cover art while playing;
|
|
126
|
-
* wherever it happens to land at rest). */
|
|
127
|
-
source: readonly [number, number];
|
|
128
|
-
/** Radians, direction from the source to the head. */
|
|
129
|
-
angle: number;
|
|
130
|
-
seed: number;
|
|
131
|
-
channel: readonly [number, number, number];
|
|
132
|
-
};
|
|
133
|
-
type VireUIKitMediumDynamicsInput = {
|
|
134
|
-
state: VireUIKitMediumPlaybackState;
|
|
135
|
-
/** Beats per minute of the active track; unread in states with no track. */
|
|
136
|
-
bpm: number;
|
|
137
|
-
/** 0…1 — a continuous volume envelope (e.g. from precomputed waveform peaks), NOT the beat itself. */
|
|
138
|
-
amplitude: number;
|
|
139
|
-
/** Seconds, a deterministic playback position (not wall-clock time) — the emission cadence has
|
|
140
|
-
* to be derived from it rather than accumulating its own phase. */
|
|
141
|
-
positionSeconds: number;
|
|
142
|
-
/** 0…1 — the area of the active track's cover art that emission comes from while playing. */
|
|
143
|
-
sourcePoint: readonly [number, number];
|
|
144
|
-
dt: number;
|
|
145
|
-
};
|
|
146
|
-
type VireUIKitMediumDynamicsFrame = {
|
|
147
|
-
turbulence: number;
|
|
148
|
-
emissions: readonly VireUIKitMediumEmission[];
|
|
149
|
-
};
|
|
150
|
-
type VireUIKitMediumDynamics = {
|
|
151
|
-
step(input: VireUIKitMediumDynamicsInput): VireUIKitMediumDynamicsFrame;
|
|
152
|
-
};
|
|
153
|
-
/**
|
|
154
|
-
* Stateful "playback dynamics" model: turbulence and emission scheduling per frame. Platform
|
|
155
|
-
* neutral — the caller supplies the clock and the playback position (in a bench, that would be
|
|
156
|
-
* its own render loop); it never reads `performance.now()` or the DOM itself.
|
|
157
|
-
*/
|
|
158
|
-
declare function createMediumDynamics(): VireUIKitMediumDynamics;
|
|
159
|
-
|
|
160
|
-
export { MEDIUM_DEFAULTS as M, type VireUIKitMediumChannel as V, MEDIUM_DEFAULT_CELL_PX as a, MEDIUM_DRIFT_TURBULENCE as b, MEDIUM_EMISSION_BEATS as c, MEDIUM_EMISSION_PROBABILITY as d, MEDIUM_MIN_EMISSION_INTERVAL as e, MEDIUM_NATURAL_INTERVAL as f, MEDIUM_NATURAL_JITTER as g, MEDIUM_PLAYING_TURBULENCE_RANGE as h, MEDIUM_PROBE_FLOOR_PX as i, MEDIUM_SENSITIVE_BOTTOM as j, MEDIUM_SENSITIVE_TOP as k, MEDIUM_TRACK_PRESETS as l, MEDIUM_TURBULENCE_TAU as m, type VireUIKitMediumDynamics as n, type VireUIKitMediumDynamicsFrame as o, type VireUIKitMediumDynamicsInput as p, type VireUIKitMediumEmission as q, type VireUIKitMediumParams as r, type VireUIKitMediumPlaybackState as s, type VireUIKitMediumTrackPreset as t, type VireUIKitMediumTrackPresetName as u, createMediumDynamics as v };
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
type VireUIKitMediumChannel = readonly [number, number, number];
|
|
2
|
-
type VireUIKitMediumParams = {
|
|
3
|
-
/** 1/s — how fast the TRACK density decays per second. Water (vapor+condensate) does not decay:
|
|
4
|
-
* it is a conserved volume, only moving between phases and being transported. */
|
|
5
|
-
decay: number;
|
|
6
|
-
/** Spatial frequency of the curl-noise potential, 1/px of the simulation grid. */
|
|
7
|
-
curlFreq: number;
|
|
8
|
-
/** Drift speed of the noise domain over time, 1/s. */
|
|
9
|
-
curlSpeed: number;
|
|
10
|
-
/** Velocity field scale, grid-px/s — how far the smoke can be carried in a second. */
|
|
11
|
-
advectSpeed: number;
|
|
12
|
-
/** Turbulence gate, 0…1 (playback drives it: playing is alive, paused cools down). The
|
|
13
|
-
* per-frame value is computed by `createMediumDynamics` (`dynamics.ts`) — it arrives here
|
|
14
|
-
* already resolved. */
|
|
15
|
-
turbulence: number;
|
|
16
|
-
/** 1/s — the fraction of vapor EXCESS above `condensationFloor` that turns into condensate every
|
|
17
|
-
* second from background seeding: weak, everywhere, all the time — the chamber is never
|
|
18
|
-
* perfectly clean. */
|
|
19
|
-
condensationRate: number;
|
|
20
|
-
/** Vapor density (in seed-density units, a spot's peak ≈1) below which condensation does not
|
|
21
|
-
* happen at all — only the excess above it condenses. Without a floor, the condensate would
|
|
22
|
-
* exactly retrace the vapor spot's shape (the same outline, or softer from growth blur), and
|
|
23
|
-
* the two phases would have nowhere to visually diverge: vapor is already soft, so the floor
|
|
24
|
-
* concentrates condensate in dense turbulence cores, leaving the sparse vapor around it
|
|
25
|
-
* uncondensed. Keep it NOTICEABLY below the settled mean vapor level (turbulence stirs spots
|
|
26
|
-
* into a nearly flat background of ~0.3 over a few minutes — a known limit of the numerical
|
|
27
|
-
* advection): a floor above that mean eventually stops finding any excess at all, and
|
|
28
|
-
* condensation dies out for good. */
|
|
29
|
-
condensationFloor: number;
|
|
30
|
-
/** 1/s — the fraction of condensate evaporating back into vapor. Larger than the condensation
|
|
31
|
-
* rate: at equilibrium most of the water stays vapor, which is the "supersaturated" one. */
|
|
32
|
-
evaporationRate: number;
|
|
33
|
-
/** grid-px/s — condensate drift downward, on top of the shared velocity field: gravity touches
|
|
34
|
-
* droplets and leaves vapor alone. */
|
|
35
|
-
condensateSettleSpeed: number;
|
|
36
|
-
/** 1/s — the rate at which a droplet blends with its grid neighbors. There is no separate age
|
|
37
|
-
* counter: the blend repeats every frame, and whatever has survived more frames ends up more
|
|
38
|
-
* blended with its neighbors on its own — that IS "growth". Keep it NOTICEABLY below
|
|
39
|
-
* `evaporationRate`: over a droplet's average lifetime (1/evaporationRate) only a small
|
|
40
|
-
* fraction should get to blend — otherwise the blur outruns evaporation and the whole grid
|
|
41
|
-
* levels into flat fog before a droplet gets a chance to return to vapor (visible by eye: the
|
|
42
|
-
* contrast between "a patch of droplets" and the vapor background disappears within seconds). */
|
|
43
|
-
condensateSpreadRate: number;
|
|
44
|
-
/** 0…1 — how much of the local vapor hue shows through in the condensate. Droplets carry no
|
|
45
|
-
* color of their own (droplets scatter light rather than tint it) — this is only a faint hint
|
|
46
|
-
* of the surroundings. */
|
|
47
|
-
condensateTint: number;
|
|
48
|
-
/** Condensate's visibility multiplier in the Oklab mix relative to vapor at equal density —
|
|
49
|
-
* droplets hold a small share of the water's mass, but they are mostly what's visible (as in a
|
|
50
|
-
* real cloud: vapor is transparent, droplets create the visibility). */
|
|
51
|
-
condensateGain: number;
|
|
52
|
-
/** Near-white sRGB tone of droplets with no hue seeding (`condensateTint=0`) — droplets scatter
|
|
53
|
-
* light rather than color it. */
|
|
54
|
-
condensateColor: VireUIKitMediumChannel;
|
|
55
|
-
/** Each vapor species' hue, sRGB 0…1. Derived as a family around one tone (`speciesFamily`),
|
|
56
|
-
* not picked as three separate colors — see `species.ts`. */
|
|
57
|
-
channelColors: readonly [VireUIKitMediumChannel, VireUIKitMediumChannel, VireUIKitMediumChannel];
|
|
58
|
-
/** The platform's neutral tone — what the medium is, alone, with no source playing. */
|
|
59
|
-
baseColor: VireUIKitMediumChannel;
|
|
60
|
-
/** Background weight in the Oklab mix: keeps the platform tone visible even where the smoke is dense. */
|
|
61
|
-
baseWeight: number;
|
|
62
|
-
};
|
|
63
|
-
declare const MEDIUM_DEFAULTS: VireUIKitMediumParams;
|
|
64
|
-
/** The material probe can't see texture finer than this: there is no gain in a denser simulation
|
|
65
|
-
* grid than the probe's own floor. */
|
|
66
|
-
declare const MEDIUM_PROBE_FLOOR_PX = 22;
|
|
67
|
-
/** Device-px per simulation grid cell by default — noticeably coarser than the probe floor;
|
|
68
|
-
* sharpening the detail visible right next to the glass is a later increment (emission and
|
|
69
|
-
* palette). */
|
|
70
|
-
declare const MEDIUM_DEFAULT_CELL_PX = 26;
|
|
71
|
-
/**
|
|
72
|
-
* The geometry of one track stamp (`emit-shader.ts`), in FRACTIONS of `min(gridW, gridH)` rather
|
|
73
|
-
* than pixels — so a preset doesn't depend on the simulation grid's resolution. Two presets:
|
|
74
|
-
* alpha is a thick, short, straight track; beta is a thin, long, ragged one. The third, natural,
|
|
75
|
-
* is dim and short, for the occasional background track at rest (not tied to cover art).
|
|
76
|
-
*/
|
|
77
|
-
type VireUIKitMediumTrackPreset = {
|
|
78
|
-
lengthFrac: number;
|
|
79
|
-
headWidthFrac: number;
|
|
80
|
-
tailWidthFrac: number;
|
|
81
|
-
/** Amplitude of the path's sideways noise, as a fraction of `min(gridW, gridH)`; 0 = a straight thread. */
|
|
82
|
-
raggedFrac: number;
|
|
83
|
-
raggedFreq: number;
|
|
84
|
-
/** How far the tail has settled downward, as a fraction of `min(gridW, gridH)`. */
|
|
85
|
-
settleFrac: number;
|
|
86
|
-
/** How much dimmer the tail is than the head, 0…1. */
|
|
87
|
-
tailDim: number;
|
|
88
|
-
intensity: number;
|
|
89
|
-
};
|
|
90
|
-
declare const MEDIUM_TRACK_PRESETS: Readonly<Record<'alpha' | 'beta' | 'natural', VireUIKitMediumTrackPreset>>;
|
|
91
|
-
/** Turbulence at rest/paused/with no active track — the "slow drift" baseline shared by all three
|
|
92
|
-
* neutral states (they differ from each other in other ways, not in this number). */
|
|
93
|
-
declare const MEDIUM_DRIFT_TURBULENCE = 0.045;
|
|
94
|
-
/** Turbulence range during playback: the low end is a quiet stretch of the track, the high end is
|
|
95
|
-
* peak amplitude. */
|
|
96
|
-
declare const MEDIUM_PLAYING_TURBULENCE_RANGE: readonly [number, number];
|
|
97
|
-
/** Turbulence smoothing time constant, seconds: both ramping up on play and cooling down on pause
|
|
98
|
-
* go through this filter — smooth, never a jump. */
|
|
99
|
-
declare const MEDIUM_TURBULENCE_TAU = 2.5;
|
|
100
|
-
/** Emission cadence — once every this many beats, not on every beat: at 120–180 BPM that is
|
|
101
|
-
* 0.5–0.75 Hz, an order of magnitude below the WCAG 2.3.1 photosensitivity ceiling (3 Hz). */
|
|
102
|
-
declare const MEDIUM_EMISSION_BEATS = 4;
|
|
103
|
-
/** Fraction of the beats that actually get an emission — breaks up the exact periodicity (a
|
|
104
|
-
* metronome-perfect pulse reads as mechanical) without moving the average rate. */
|
|
105
|
-
declare const MEDIUM_EMISSION_PROBABILITY = 0.55;
|
|
106
|
-
/** Emergency floor between two emissions, seconds — a safeguard for the same WCAG 2.3.1
|
|
107
|
-
* requirement, independent of `MEDIUM_EMISSION_BEATS`/BPM: even a mistake in the other constants
|
|
108
|
-
* can't flash faster than this. */
|
|
109
|
-
declare const MEDIUM_MIN_EMISSION_INTERVAL = 1.2;
|
|
110
|
-
/** Average interval between solitary "background emission" tracks at rest, seconds, plus a random
|
|
111
|
-
* `MEDIUM_NATURAL_JITTER` on top — rare, with no discernible rhythm. */
|
|
112
|
-
declare const MEDIUM_NATURAL_INTERVAL = 25;
|
|
113
|
-
declare const MEDIUM_NATURAL_JITTER = 35;
|
|
114
|
-
/** The sensitive layer — fractions of height, top to bottom. Above it there isn't enough
|
|
115
|
-
* supersaturation for a track to appear at all, so background emission is only ever visible here. */
|
|
116
|
-
declare const MEDIUM_SENSITIVE_TOP = 0.55;
|
|
117
|
-
declare const MEDIUM_SENSITIVE_BOTTOM = 0.95;
|
|
118
|
-
|
|
119
|
-
type VireUIKitMediumPlaybackState = 'idle' | 'playing' | 'paused' | 'stopped';
|
|
120
|
-
type VireUIKitMediumTrackPresetName = keyof typeof MEDIUM_TRACK_PRESETS;
|
|
121
|
-
/** The fully resolved geometry of one track stamp — the platform layer (`web/medium.ts`)
|
|
122
|
-
* translates fractions into simulation-grid pixels and binds the uniforms, deciding nothing else:
|
|
123
|
-
* which preset, where, and how bright is entirely this model's call. */
|
|
124
|
-
type VireUIKitMediumEmission = VireUIKitMediumTrackPreset & {
|
|
125
|
-
/** 0…1, a fraction of the grid on both axes — the source point (cover art while playing;
|
|
126
|
-
* wherever it happens to land at rest). */
|
|
127
|
-
source: readonly [number, number];
|
|
128
|
-
/** Radians, direction from the source to the head. */
|
|
129
|
-
angle: number;
|
|
130
|
-
seed: number;
|
|
131
|
-
channel: readonly [number, number, number];
|
|
132
|
-
};
|
|
133
|
-
type VireUIKitMediumDynamicsInput = {
|
|
134
|
-
state: VireUIKitMediumPlaybackState;
|
|
135
|
-
/** Beats per minute of the active track; unread in states with no track. */
|
|
136
|
-
bpm: number;
|
|
137
|
-
/** 0…1 — a continuous volume envelope (e.g. from precomputed waveform peaks), NOT the beat itself. */
|
|
138
|
-
amplitude: number;
|
|
139
|
-
/** Seconds, a deterministic playback position (not wall-clock time) — the emission cadence has
|
|
140
|
-
* to be derived from it rather than accumulating its own phase. */
|
|
141
|
-
positionSeconds: number;
|
|
142
|
-
/** 0…1 — the area of the active track's cover art that emission comes from while playing. */
|
|
143
|
-
sourcePoint: readonly [number, number];
|
|
144
|
-
dt: number;
|
|
145
|
-
};
|
|
146
|
-
type VireUIKitMediumDynamicsFrame = {
|
|
147
|
-
turbulence: number;
|
|
148
|
-
emissions: readonly VireUIKitMediumEmission[];
|
|
149
|
-
};
|
|
150
|
-
type VireUIKitMediumDynamics = {
|
|
151
|
-
step(input: VireUIKitMediumDynamicsInput): VireUIKitMediumDynamicsFrame;
|
|
152
|
-
};
|
|
153
|
-
/**
|
|
154
|
-
* Stateful "playback dynamics" model: turbulence and emission scheduling per frame. Platform
|
|
155
|
-
* neutral — the caller supplies the clock and the playback position (in a bench, that would be
|
|
156
|
-
* its own render loop); it never reads `performance.now()` or the DOM itself.
|
|
157
|
-
*/
|
|
158
|
-
declare function createMediumDynamics(): VireUIKitMediumDynamics;
|
|
159
|
-
|
|
160
|
-
export { MEDIUM_DEFAULTS as M, type VireUIKitMediumChannel as V, MEDIUM_DEFAULT_CELL_PX as a, MEDIUM_DRIFT_TURBULENCE as b, MEDIUM_EMISSION_BEATS as c, MEDIUM_EMISSION_PROBABILITY as d, MEDIUM_MIN_EMISSION_INTERVAL as e, MEDIUM_NATURAL_INTERVAL as f, MEDIUM_NATURAL_JITTER as g, MEDIUM_PLAYING_TURBULENCE_RANGE as h, MEDIUM_PROBE_FLOOR_PX as i, MEDIUM_SENSITIVE_BOTTOM as j, MEDIUM_SENSITIVE_TOP as k, MEDIUM_TRACK_PRESETS as l, MEDIUM_TURBULENCE_TAU as m, type VireUIKitMediumDynamics as n, type VireUIKitMediumDynamicsFrame as o, type VireUIKitMediumDynamicsInput as p, type VireUIKitMediumEmission as q, type VireUIKitMediumParams as r, type VireUIKitMediumPlaybackState as s, type VireUIKitMediumTrackPreset as t, type VireUIKitMediumTrackPresetName as u, createMediumDynamics as v };
|