@idle-screens/schema 3.8.0 → 3.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.
- package/FORMAT.md +3 -0
- package/dist/index.d.ts +187 -1
- package/dist/index.js +708 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2233,7 +2233,7 @@ function fieldAt(u, v, t, cfg, seed) {
|
|
|
2233
2233
|
}
|
|
2234
2234
|
function hexToRgb255(hex) {
|
|
2235
2235
|
const h = hex.length === 4 ? `#${hex[1]}${hex[1]}${hex[2]}${hex[2]}${hex[3]}${hex[3]}` : hex;
|
|
2236
|
-
const n = parseInt(h.slice(1), 16);
|
|
2236
|
+
const n = /^#[0-9a-f]{6}$/i.test(h) ? parseInt(h.slice(1), 16) : NaN;
|
|
2237
2237
|
if (Number.isNaN(n)) return [128, 128, 128];
|
|
2238
2238
|
return [n >> 16 & 255, n >> 8 & 255, n & 255];
|
|
2239
2239
|
}
|
|
@@ -2475,8 +2475,14 @@ function bedRenderSeed(seq) {
|
|
|
2475
2475
|
const raw = seq.bed.seed ?? (seq.seed !== void 0 ? seq.seed + LIMITS.maxSegments : void 0);
|
|
2476
2476
|
return raw === void 0 ? void 0 : normalizeSeed(raw);
|
|
2477
2477
|
}
|
|
2478
|
+
function sequenceWantsFinish(seq) {
|
|
2479
|
+
return seq.finish !== void 0 || seq.segments.some((s) => s.scene.finish !== void 0);
|
|
2480
|
+
}
|
|
2478
2481
|
function sequenceSwapCompatible(prev, next) {
|
|
2479
2482
|
if (prev.segments.length !== next.segments.length) return false;
|
|
2483
|
+
if (prev.seed === void 0 !== (next.seed === void 0)) return false;
|
|
2484
|
+
if (prev.seed !== void 0 && next.seed !== void 0 && normalizeSeed(prev.seed) !== normalizeSeed(next.seed)) return false;
|
|
2485
|
+
if (sequenceWantsFinish(prev) !== sequenceWantsFinish(next)) return false;
|
|
2480
2486
|
if (prev.loop !== next.loop) return false;
|
|
2481
2487
|
if ((prev.sync ?? "mount") !== (next.sync ?? "mount")) return false;
|
|
2482
2488
|
if (!!prev.bed !== !!next.bed) return false;
|
|
@@ -2851,7 +2857,7 @@ var SpecInstance = class {
|
|
|
2851
2857
|
}
|
|
2852
2858
|
if (sprite.kind === "streak") {
|
|
2853
2859
|
const resolvedColor = sprite.colors?.[e.colorIndex] ?? sprite.color;
|
|
2854
|
-
const heading = headingAt(e, t, this.w, this.h) ?? 0;
|
|
2860
|
+
const heading = (headingAt(e, t, this.w, this.h) ?? 0) + rot;
|
|
2855
2861
|
const tailX = p.x - Math.cos(heading) * sz;
|
|
2856
2862
|
const tailY = p.y - Math.sin(heading) * sz;
|
|
2857
2863
|
const g = ctx.createLinearGradient(tailX, tailY, p.x, p.y);
|
|
@@ -3425,8 +3431,7 @@ var SequenceInstance = class {
|
|
|
3425
3431
|
this.canvas = canvas;
|
|
3426
3432
|
this.seed = (seq.seed ?? ctx.seed ?? 0) >>> 0 || 1;
|
|
3427
3433
|
this.animateFinish = capabilityTier !== "basic" && capabilityTier !== "minimal";
|
|
3428
|
-
|
|
3429
|
-
if (wantsFinish && surface) {
|
|
3434
|
+
if (sequenceWantsFinish(seq) && surface) {
|
|
3430
3435
|
const pass = createFinishPass(surface, this.seed);
|
|
3431
3436
|
if (pass) {
|
|
3432
3437
|
this.finishPass = pass;
|
|
@@ -3950,13 +3955,14 @@ function legibilityRatio(a, b) {
|
|
|
3950
3955
|
const lo = Math.min(la, lb);
|
|
3951
3956
|
return (hi + 0.05) / (lo + 0.05);
|
|
3952
3957
|
}
|
|
3953
|
-
function backgroundRgbAt(spec, yPx, h, unit, xPx, w, seed) {
|
|
3958
|
+
function backgroundRgbAt(spec, yPx, h, unit, xPx, w, seed, t = 0) {
|
|
3954
3959
|
const bg = spec.background;
|
|
3955
3960
|
if (!bg || bg.type === "solid") return hexRgb(bg?.color ?? "#05050a");
|
|
3956
3961
|
if (bg.type === "field") {
|
|
3957
3962
|
if (xPx === void 0 || w === void 0) return backgroundRgb(spec);
|
|
3958
3963
|
const short = Math.max(1, Math.min(w, h));
|
|
3959
|
-
const
|
|
3964
|
+
const ft = fieldSampleTime(bg, t);
|
|
3965
|
+
const c = fieldRgbAt(xPx / short, yPx / short, ft, bg, seed ?? spec.seed ?? 42);
|
|
3960
3966
|
return { r: c[0] / 255, g: c[1] / 255, b: c[2] / 255 };
|
|
3961
3967
|
}
|
|
3962
3968
|
if (bg.band) {
|
|
@@ -4512,7 +4518,7 @@ function adviseSpec(spec, viewport = { width: 1920, height: 1080 }, opts = {}) {
|
|
|
4512
4518
|
for (const box of boxes) {
|
|
4513
4519
|
const cy = (box.y0 + box.y1) / 2;
|
|
4514
4520
|
const cx = (box.x0 + box.x1) / 2;
|
|
4515
|
-
const groundRgb = backgroundRgbAt(spec, cy, h, scale, cx, w, opts.backgroundSeed ?? opts.seed);
|
|
4521
|
+
const groundRgb = backgroundRgbAt(spec, cy, h, scale, cx, w, opts.backgroundSeed ?? opts.seed, opts.t ?? COHESION_T);
|
|
4516
4522
|
const ground = legibilityRatio(textPlate(groundRgb, box.alpha), groundRgb);
|
|
4517
4523
|
const lit = brightestAdditivePlate(spec, allEntities, groundRgb, box, w, h);
|
|
4518
4524
|
const plate = lit ? legibilityRatio(textPlate(lit.rgb, box.alpha), lit.rgb) : Infinity;
|
|
@@ -4854,7 +4860,7 @@ function luminanceGrid(spec, opts = {}) {
|
|
|
4854
4860
|
} else if (bg.type === "field") {
|
|
4855
4861
|
bgCells = new Array(cols * rows);
|
|
4856
4862
|
const short = Math.max(1, Math.min(w, h));
|
|
4857
|
-
const seed = opts.seed ?? spec.seed ?? 42;
|
|
4863
|
+
const seed = normalizeSeed(opts.seed ?? spec.seed ?? 42);
|
|
4858
4864
|
const ft = fieldSampleTime(bg, t);
|
|
4859
4865
|
for (let r = 0; r < rows; r++) {
|
|
4860
4866
|
let rowSum = 0;
|
|
@@ -4980,7 +4986,7 @@ function luminanceGrid(spec, opts = {}) {
|
|
|
4980
4986
|
continue;
|
|
4981
4987
|
}
|
|
4982
4988
|
if (s.kind === "streak") {
|
|
4983
|
-
const heading = headingAt(e, tPass, w, h) ?? 0;
|
|
4989
|
+
const heading = (headingAt(e, tPass, w, h) ?? 0) + rotationAt(e, tPass);
|
|
4984
4990
|
const steps = Math.max(2, Math.ceil(sz / Math.min(cellW, cellH)));
|
|
4985
4991
|
const wgt = Math.min(1, (s.width ?? (scale === 1 ? 2 : 2e-3)) * scale / cellH);
|
|
4986
4992
|
for (let i = 0; i <= steps; i++) {
|
|
@@ -6186,6 +6192,613 @@ var DASHBOARD_SPEC = {
|
|
|
6186
6192
|
]
|
|
6187
6193
|
};
|
|
6188
6194
|
|
|
6195
|
+
// src/examples/sparse-night.ts
|
|
6196
|
+
var SPARSE_NIGHT_SPEC = {
|
|
6197
|
+
schemaVersion: 1,
|
|
6198
|
+
id: "sparse-night",
|
|
6199
|
+
label: "Sparse Night",
|
|
6200
|
+
seed: 101,
|
|
6201
|
+
motionIntensity: "calm",
|
|
6202
|
+
density: "sparse",
|
|
6203
|
+
background: { type: "solid", color: "#02030a" },
|
|
6204
|
+
layers: [
|
|
6205
|
+
{
|
|
6206
|
+
key: "grain",
|
|
6207
|
+
count: 110,
|
|
6208
|
+
sprite: {
|
|
6209
|
+
kind: "circle",
|
|
6210
|
+
radius: [3e-4, 9e-4],
|
|
6211
|
+
color: "#c9d4e6"
|
|
6212
|
+
},
|
|
6213
|
+
motion: { type: "static" },
|
|
6214
|
+
alpha: [0.05, 0.3],
|
|
6215
|
+
pulse: { amp: 0.08, period: 7e3 }
|
|
6216
|
+
},
|
|
6217
|
+
{
|
|
6218
|
+
key: "figure",
|
|
6219
|
+
count: 5,
|
|
6220
|
+
sprite: {
|
|
6221
|
+
kind: "circle",
|
|
6222
|
+
radius: [16e-4, 22e-4],
|
|
6223
|
+
color: "#dfe8f2"
|
|
6224
|
+
},
|
|
6225
|
+
motion: { type: "drift", speed: [4e-4, 9e-4] },
|
|
6226
|
+
alpha: [0.4, 0.7],
|
|
6227
|
+
region: { x: [0.36, 0.64], y: [0.32, 0.62] },
|
|
6228
|
+
links: {
|
|
6229
|
+
k: 2,
|
|
6230
|
+
maxDist: 0.09,
|
|
6231
|
+
color: "#7f97b8",
|
|
6232
|
+
alpha: 0.16,
|
|
6233
|
+
width: 4e-4,
|
|
6234
|
+
mode: "chain",
|
|
6235
|
+
closed: true
|
|
6236
|
+
}
|
|
6237
|
+
},
|
|
6238
|
+
{
|
|
6239
|
+
key: "satellite",
|
|
6240
|
+
count: 1,
|
|
6241
|
+
sprite: {
|
|
6242
|
+
kind: "circle",
|
|
6243
|
+
radius: [24e-4, 24e-4],
|
|
6244
|
+
color: "#e8b04a",
|
|
6245
|
+
soft: true
|
|
6246
|
+
},
|
|
6247
|
+
motion: { type: "orbit", speed: [3, 3], radius: [0.34, 0.4] },
|
|
6248
|
+
alpha: [0.85, 0.85],
|
|
6249
|
+
blend: "lighter",
|
|
6250
|
+
emit: { every: 18e3, life: 3e3, jitter: 0, grow: [0.5, 1.6] }
|
|
6251
|
+
}
|
|
6252
|
+
]
|
|
6253
|
+
};
|
|
6254
|
+
|
|
6255
|
+
// src/examples/signal-board.ts
|
|
6256
|
+
var SIGNAL_BOARD_SPEC = {
|
|
6257
|
+
schemaVersion: 1,
|
|
6258
|
+
id: "signal-board",
|
|
6259
|
+
label: "Signal Board",
|
|
6260
|
+
seed: 707,
|
|
6261
|
+
motionIntensity: "calm",
|
|
6262
|
+
background: { type: "solid", color: "#0d0b08" },
|
|
6263
|
+
layers: [
|
|
6264
|
+
{
|
|
6265
|
+
key: "readout",
|
|
6266
|
+
count: 9,
|
|
6267
|
+
sprite: {
|
|
6268
|
+
kind: "bar",
|
|
6269
|
+
values: [62, 38, 84, 21, 55, 91, 44, 70, 29],
|
|
6270
|
+
max: 100,
|
|
6271
|
+
length: 0.24,
|
|
6272
|
+
thickness: 0.013,
|
|
6273
|
+
color: "#ffb000",
|
|
6274
|
+
direction: "right"
|
|
6275
|
+
},
|
|
6276
|
+
motion: { type: "static" },
|
|
6277
|
+
layout: { type: "table", columns: 3, gap: 0.07 },
|
|
6278
|
+
region: { x: [0.1, 0.9], y: [0.34, 0.78] },
|
|
6279
|
+
alpha: [0.5, 0.62]
|
|
6280
|
+
},
|
|
6281
|
+
{
|
|
6282
|
+
key: "labels",
|
|
6283
|
+
count: 9,
|
|
6284
|
+
sprite: {
|
|
6285
|
+
kind: "text",
|
|
6286
|
+
strings: [
|
|
6287
|
+
"A-01",
|
|
6288
|
+
"A-02",
|
|
6289
|
+
"A-03",
|
|
6290
|
+
"B-01",
|
|
6291
|
+
"B-02",
|
|
6292
|
+
"B-03",
|
|
6293
|
+
"C-01",
|
|
6294
|
+
"C-02",
|
|
6295
|
+
"C-03"
|
|
6296
|
+
],
|
|
6297
|
+
color: "#b08a3a",
|
|
6298
|
+
font: "monospace",
|
|
6299
|
+
align: "left"
|
|
6300
|
+
},
|
|
6301
|
+
motion: { type: "static" },
|
|
6302
|
+
size: [0.011, 0.011],
|
|
6303
|
+
layout: { type: "table", columns: 3, gap: 0.07 },
|
|
6304
|
+
region: { x: [0.1, 0.9], y: [0.28, 0.72] },
|
|
6305
|
+
alpha: [0.55, 0.55]
|
|
6306
|
+
},
|
|
6307
|
+
{
|
|
6308
|
+
key: "caption",
|
|
6309
|
+
count: 1,
|
|
6310
|
+
sprite: {
|
|
6311
|
+
kind: "textBlock",
|
|
6312
|
+
text: "STATION 7 \u2014 QUIET HOURS",
|
|
6313
|
+
maxWidth: 0.6,
|
|
6314
|
+
fontSize: 0.022,
|
|
6315
|
+
lineHeight: 1.4,
|
|
6316
|
+
align: "left",
|
|
6317
|
+
anchor: "top-left",
|
|
6318
|
+
font: "bold monospace",
|
|
6319
|
+
color: "#c8862a"
|
|
6320
|
+
},
|
|
6321
|
+
motion: { type: "static" },
|
|
6322
|
+
position: { x: 0.1, y: 0.14 },
|
|
6323
|
+
alpha: [0.8, 0.8]
|
|
6324
|
+
},
|
|
6325
|
+
{
|
|
6326
|
+
key: "sweep",
|
|
6327
|
+
count: 1,
|
|
6328
|
+
sprite: {
|
|
6329
|
+
kind: "stroke",
|
|
6330
|
+
length: [1.4, 1.4],
|
|
6331
|
+
points: [
|
|
6332
|
+
[-1, 0],
|
|
6333
|
+
[1, 0]
|
|
6334
|
+
],
|
|
6335
|
+
width: 16e-4,
|
|
6336
|
+
color: "#33ff66"
|
|
6337
|
+
},
|
|
6338
|
+
motion: { type: "drift", speed: [0.012, 0.012], angle: 90 },
|
|
6339
|
+
alpha: [0.22, 0.22],
|
|
6340
|
+
blend: "screen"
|
|
6341
|
+
}
|
|
6342
|
+
]
|
|
6343
|
+
};
|
|
6344
|
+
|
|
6345
|
+
// src/examples/phase-duet.ts
|
|
6346
|
+
var PHASE_DUET_SPEC = {
|
|
6347
|
+
schemaVersion: 1,
|
|
6348
|
+
id: "phase-duet",
|
|
6349
|
+
label: "Phase Duet",
|
|
6350
|
+
seed: 88,
|
|
6351
|
+
motionIntensity: "calm",
|
|
6352
|
+
background: {
|
|
6353
|
+
type: "gradient",
|
|
6354
|
+
stops: [
|
|
6355
|
+
{ at: 0, color: "#0a0f1c" },
|
|
6356
|
+
{ at: 0.6, color: "#101b2e" },
|
|
6357
|
+
{ at: 1, color: "#07141a" }
|
|
6358
|
+
]
|
|
6359
|
+
},
|
|
6360
|
+
layers: [
|
|
6361
|
+
{
|
|
6362
|
+
key: "ripple",
|
|
6363
|
+
count: 60,
|
|
6364
|
+
sprite: {
|
|
6365
|
+
kind: "circle",
|
|
6366
|
+
radius: [18e-4, 3e-3],
|
|
6367
|
+
color: "#6fd3c7",
|
|
6368
|
+
colors: ["#6fd3c7", "#9fb8d8"],
|
|
6369
|
+
colorWeights: [2, 1]
|
|
6370
|
+
},
|
|
6371
|
+
motion: { type: "static" },
|
|
6372
|
+
layout: { type: "grid", columns: 10, jitter: 0 },
|
|
6373
|
+
alpha: [0.3, 0.55],
|
|
6374
|
+
pulse: { amp: 0.35, period: 6e3, wave: { wavelength: 0.7, angle: 25 } },
|
|
6375
|
+
clock: { phase: 0, rate: 1 }
|
|
6376
|
+
},
|
|
6377
|
+
{
|
|
6378
|
+
key: "rings",
|
|
6379
|
+
count: 3,
|
|
6380
|
+
sprite: {
|
|
6381
|
+
kind: "ring",
|
|
6382
|
+
radius: [0.05, 0.09],
|
|
6383
|
+
width: 12e-4,
|
|
6384
|
+
color: "#6fd3c7"
|
|
6385
|
+
},
|
|
6386
|
+
motion: { type: "static" },
|
|
6387
|
+
alpha: [0.25, 0.35],
|
|
6388
|
+
blend: "lighter",
|
|
6389
|
+
grow: { amp: 0.5, period: 6e3 },
|
|
6390
|
+
clock: { phase: 0, rate: 1 }
|
|
6391
|
+
},
|
|
6392
|
+
{
|
|
6393
|
+
key: "heart",
|
|
6394
|
+
count: 1,
|
|
6395
|
+
sprite: {
|
|
6396
|
+
kind: "circle",
|
|
6397
|
+
radius: [0.11, 0.11],
|
|
6398
|
+
color: "#9fb8d8",
|
|
6399
|
+
soft: true
|
|
6400
|
+
},
|
|
6401
|
+
motion: { type: "static" },
|
|
6402
|
+
position: { x: 0.5, y: 0.5 },
|
|
6403
|
+
alpha: [0.22, 0.22],
|
|
6404
|
+
blend: "lighter",
|
|
6405
|
+
grow: { amp: 0.25, period: 6e3 },
|
|
6406
|
+
clock: { phase: 0, rate: 1 }
|
|
6407
|
+
}
|
|
6408
|
+
]
|
|
6409
|
+
};
|
|
6410
|
+
|
|
6411
|
+
// src/examples/web-work.ts
|
|
6412
|
+
var WEB_WORK_SPEC = {
|
|
6413
|
+
schemaVersion: 1,
|
|
6414
|
+
id: "web-work",
|
|
6415
|
+
label: "Web Work",
|
|
6416
|
+
seed: 31,
|
|
6417
|
+
motionIntensity: "calm",
|
|
6418
|
+
background: { type: "solid", color: "#04070c" },
|
|
6419
|
+
layers: [
|
|
6420
|
+
{
|
|
6421
|
+
key: "nodes",
|
|
6422
|
+
count: 44,
|
|
6423
|
+
sprite: {
|
|
6424
|
+
kind: "circle",
|
|
6425
|
+
radius: [18e-4, 34e-4],
|
|
6426
|
+
color: "#8fb4d8",
|
|
6427
|
+
colors: ["#8fb4d8", "#c9d8e6"],
|
|
6428
|
+
colorWeights: [2, 1]
|
|
6429
|
+
},
|
|
6430
|
+
motion: {
|
|
6431
|
+
type: "drift",
|
|
6432
|
+
speed: [2e-3, 6e-3],
|
|
6433
|
+
angle: 0,
|
|
6434
|
+
bidirectional: true
|
|
6435
|
+
},
|
|
6436
|
+
alpha: [0.45, 0.8],
|
|
6437
|
+
links: {
|
|
6438
|
+
k: 3,
|
|
6439
|
+
maxDist: 0.3,
|
|
6440
|
+
color: "#5f7f9f",
|
|
6441
|
+
alpha: 0.16,
|
|
6442
|
+
width: 5e-4,
|
|
6443
|
+
mode: "random",
|
|
6444
|
+
falloff: true
|
|
6445
|
+
}
|
|
6446
|
+
},
|
|
6447
|
+
{
|
|
6448
|
+
key: "flags",
|
|
6449
|
+
count: 22,
|
|
6450
|
+
sprite: {
|
|
6451
|
+
kind: "stroke",
|
|
6452
|
+
length: [0.02, 0.045],
|
|
6453
|
+
points: [
|
|
6454
|
+
[-1, 0.2],
|
|
6455
|
+
[-0.2, -0.5],
|
|
6456
|
+
[0.6, -0.3],
|
|
6457
|
+
[1, 0.1]
|
|
6458
|
+
],
|
|
6459
|
+
width: 16e-4,
|
|
6460
|
+
taper: true,
|
|
6461
|
+
orient: true,
|
|
6462
|
+
color: "#6f93b8",
|
|
6463
|
+
colors: ["#6f93b8", "#9fb8d8"]
|
|
6464
|
+
},
|
|
6465
|
+
motion: {
|
|
6466
|
+
type: "drift",
|
|
6467
|
+
speed: [0.01, 0.03],
|
|
6468
|
+
angle: 0,
|
|
6469
|
+
bidirectional: true
|
|
6470
|
+
},
|
|
6471
|
+
alpha: [0.3, 0.6]
|
|
6472
|
+
}
|
|
6473
|
+
]
|
|
6474
|
+
};
|
|
6475
|
+
|
|
6476
|
+
// src/examples/shard-fall.ts
|
|
6477
|
+
var SHARD_FALL_SPEC = {
|
|
6478
|
+
schemaVersion: 1,
|
|
6479
|
+
id: "shard-fall",
|
|
6480
|
+
label: "Shard Fall",
|
|
6481
|
+
seed: 214,
|
|
6482
|
+
motionIntensity: "moderate",
|
|
6483
|
+
background: {
|
|
6484
|
+
type: "gradient",
|
|
6485
|
+
stops: [
|
|
6486
|
+
{ at: 0, color: "#efe6d6" },
|
|
6487
|
+
{ at: 0.55, color: "#e6d6bd" },
|
|
6488
|
+
{ at: 1, color: "#d9c39f" }
|
|
6489
|
+
]
|
|
6490
|
+
},
|
|
6491
|
+
layers: [
|
|
6492
|
+
{
|
|
6493
|
+
key: "shards",
|
|
6494
|
+
count: 26,
|
|
6495
|
+
sprite: {
|
|
6496
|
+
kind: "polygon",
|
|
6497
|
+
points: [
|
|
6498
|
+
[-1, 0.35],
|
|
6499
|
+
[-0.25, -1],
|
|
6500
|
+
[0.85, -0.4],
|
|
6501
|
+
[0.4, 0.9]
|
|
6502
|
+
],
|
|
6503
|
+
radius: [0.012, 0.03],
|
|
6504
|
+
color: "#b4593a",
|
|
6505
|
+
colors: ["#b4593a", "#7f8a5e", "#5a6b7d", "#8a5a3c"],
|
|
6506
|
+
colorWeights: [2, 2, 1, 2]
|
|
6507
|
+
},
|
|
6508
|
+
motion: { type: "drift", speed: [0.012, 0.032], angle: 90 },
|
|
6509
|
+
alpha: [0.85, 0.95],
|
|
6510
|
+
rotate: [-180, 180],
|
|
6511
|
+
spin: [-35, 35]
|
|
6512
|
+
},
|
|
6513
|
+
{
|
|
6514
|
+
key: "shadows",
|
|
6515
|
+
count: 2,
|
|
6516
|
+
sprite: {
|
|
6517
|
+
kind: "circle",
|
|
6518
|
+
radius: [0.18, 0.22],
|
|
6519
|
+
color: "#5a4a34",
|
|
6520
|
+
soft: true
|
|
6521
|
+
},
|
|
6522
|
+
motion: {
|
|
6523
|
+
type: "wander",
|
|
6524
|
+
speed: [3e-3, 5e-3],
|
|
6525
|
+
meander: 0.04,
|
|
6526
|
+
coherence: 0.6
|
|
6527
|
+
},
|
|
6528
|
+
alpha: [0.2, 0.28],
|
|
6529
|
+
blend: "multiply"
|
|
6530
|
+
}
|
|
6531
|
+
]
|
|
6532
|
+
};
|
|
6533
|
+
|
|
6534
|
+
// src/examples/murmur.ts
|
|
6535
|
+
var MURMUR_SPEC = {
|
|
6536
|
+
schemaVersion: 1,
|
|
6537
|
+
id: "murmur",
|
|
6538
|
+
label: "Murmur",
|
|
6539
|
+
seed: 512,
|
|
6540
|
+
motionIntensity: "moderate",
|
|
6541
|
+
density: "dense",
|
|
6542
|
+
background: {
|
|
6543
|
+
type: "gradient",
|
|
6544
|
+
stops: [
|
|
6545
|
+
{ at: 0, color: "#151a26" },
|
|
6546
|
+
{ at: 0.5, color: "#232c3d" },
|
|
6547
|
+
{ at: 1, color: "#3a3f52" }
|
|
6548
|
+
]
|
|
6549
|
+
},
|
|
6550
|
+
layers: [
|
|
6551
|
+
{
|
|
6552
|
+
key: "flock-a",
|
|
6553
|
+
count: 260,
|
|
6554
|
+
sprite: {
|
|
6555
|
+
kind: "streak",
|
|
6556
|
+
length: [4e-3, 0.012],
|
|
6557
|
+
width: 12e-4,
|
|
6558
|
+
color: "#c9d4e6",
|
|
6559
|
+
colors: ["#c9d4e6", "#8fa6c4"],
|
|
6560
|
+
colorWeights: [2, 1]
|
|
6561
|
+
},
|
|
6562
|
+
motion: {
|
|
6563
|
+
type: "wander",
|
|
6564
|
+
speed: [0.015, 0.06],
|
|
6565
|
+
meander: 0.05,
|
|
6566
|
+
coherence: 0.95
|
|
6567
|
+
},
|
|
6568
|
+
alpha: [0.25, 0.6],
|
|
6569
|
+
blend: "screen"
|
|
6570
|
+
},
|
|
6571
|
+
{
|
|
6572
|
+
// The cap is 400 per layer, so a flock above it is two registers of the
|
|
6573
|
+
// same body — slightly different speed and length ranges read as depth.
|
|
6574
|
+
key: "flock-b",
|
|
6575
|
+
count: 260,
|
|
6576
|
+
sprite: {
|
|
6577
|
+
kind: "streak",
|
|
6578
|
+
length: [6e-3, 0.014],
|
|
6579
|
+
width: 12e-4,
|
|
6580
|
+
color: "#8fa6c4",
|
|
6581
|
+
colors: ["#8fa6c4", "#c9d4e6"],
|
|
6582
|
+
colorWeights: [2, 1]
|
|
6583
|
+
},
|
|
6584
|
+
motion: {
|
|
6585
|
+
type: "wander",
|
|
6586
|
+
speed: [0.02, 0.05],
|
|
6587
|
+
meander: 0.045,
|
|
6588
|
+
coherence: 0.93
|
|
6589
|
+
},
|
|
6590
|
+
alpha: [0.2, 0.5],
|
|
6591
|
+
blend: "screen"
|
|
6592
|
+
},
|
|
6593
|
+
{
|
|
6594
|
+
key: "grain",
|
|
6595
|
+
count: 100,
|
|
6596
|
+
sprite: { kind: "circle", radius: [5e-4, 12e-4], color: "#c9d4e6" },
|
|
6597
|
+
motion: { type: "static" },
|
|
6598
|
+
alpha: [0.06, 0.2]
|
|
6599
|
+
}
|
|
6600
|
+
]
|
|
6601
|
+
};
|
|
6602
|
+
|
|
6603
|
+
// src/examples/three-movements.ts
|
|
6604
|
+
var THREE_MOVEMENTS_SEQUENCE = {
|
|
6605
|
+
format: "idle-sequence",
|
|
6606
|
+
schemaVersion: 1,
|
|
6607
|
+
id: "three-movements",
|
|
6608
|
+
label: "Three Movements",
|
|
6609
|
+
seed: 404,
|
|
6610
|
+
loop: false,
|
|
6611
|
+
sync: "mount",
|
|
6612
|
+
finish: { grain: 0.3, dither: 0.12 },
|
|
6613
|
+
bed: {
|
|
6614
|
+
schemaVersion: 1,
|
|
6615
|
+
id: "three-movements-bed",
|
|
6616
|
+
label: "Three Movements \u2014 bed",
|
|
6617
|
+
background: {
|
|
6618
|
+
type: "field",
|
|
6619
|
+
scale: 2,
|
|
6620
|
+
octaves: 3,
|
|
6621
|
+
warp: 0.4,
|
|
6622
|
+
quantize: 0,
|
|
6623
|
+
bands: ["#0a0d18", "#141c2e", "#233046"],
|
|
6624
|
+
drift: { period: 6e4, amount: 0.25 }
|
|
6625
|
+
},
|
|
6626
|
+
layers: [
|
|
6627
|
+
{
|
|
6628
|
+
key: "motes",
|
|
6629
|
+
count: 12,
|
|
6630
|
+
sprite: {
|
|
6631
|
+
kind: "circle",
|
|
6632
|
+
radius: [12e-4, 3e-3],
|
|
6633
|
+
color: "#9fb8d8",
|
|
6634
|
+
soft: true
|
|
6635
|
+
},
|
|
6636
|
+
motion: { type: "drift", speed: [2e-3, 6e-3], angle: 90 },
|
|
6637
|
+
alpha: [0.1, 0.25]
|
|
6638
|
+
}
|
|
6639
|
+
]
|
|
6640
|
+
},
|
|
6641
|
+
segments: [
|
|
6642
|
+
{
|
|
6643
|
+
key: "cold-open",
|
|
6644
|
+
duration: 8e3,
|
|
6645
|
+
transition: { type: "morph", dur: 2500, text: "crossfade" },
|
|
6646
|
+
scene: {
|
|
6647
|
+
schemaVersion: 1,
|
|
6648
|
+
id: "three-movements-cold-open",
|
|
6649
|
+
label: "Cold Open",
|
|
6650
|
+
seed: 11,
|
|
6651
|
+
layers: [
|
|
6652
|
+
{
|
|
6653
|
+
key: "caption",
|
|
6654
|
+
count: 1,
|
|
6655
|
+
sprite: {
|
|
6656
|
+
kind: "textBlock",
|
|
6657
|
+
text: "COLD OPEN.\nThe room before anyone arrives.",
|
|
6658
|
+
maxWidth: 0.6,
|
|
6659
|
+
fontSize: 0.028,
|
|
6660
|
+
lineHeight: 1.5,
|
|
6661
|
+
align: "left",
|
|
6662
|
+
anchor: "top-left",
|
|
6663
|
+
font: "monospace",
|
|
6664
|
+
color: "#9fb8d8",
|
|
6665
|
+
opacity: 0.9,
|
|
6666
|
+
reveal: {
|
|
6667
|
+
progress: 1,
|
|
6668
|
+
mode: "typewriter",
|
|
6669
|
+
speed: 12,
|
|
6670
|
+
caret: { blink: 1.1 }
|
|
6671
|
+
}
|
|
6672
|
+
},
|
|
6673
|
+
motion: { type: "static" },
|
|
6674
|
+
position: { x: 0.1, y: 0.4 },
|
|
6675
|
+
alpha: [0.9, 0.9]
|
|
6676
|
+
},
|
|
6677
|
+
{
|
|
6678
|
+
key: "sparks",
|
|
6679
|
+
count: 30,
|
|
6680
|
+
sprite: {
|
|
6681
|
+
kind: "circle",
|
|
6682
|
+
radius: [12e-4, 26e-4],
|
|
6683
|
+
color: "#c9d8e6"
|
|
6684
|
+
},
|
|
6685
|
+
motion: { type: "static" },
|
|
6686
|
+
alpha: [0.15, 0.45],
|
|
6687
|
+
pulse: { amp: 0.12, period: 6e3 }
|
|
6688
|
+
}
|
|
6689
|
+
]
|
|
6690
|
+
}
|
|
6691
|
+
},
|
|
6692
|
+
{
|
|
6693
|
+
key: "kindle",
|
|
6694
|
+
duration: 9e3,
|
|
6695
|
+
transition: { type: "fade", dur: 3e3 },
|
|
6696
|
+
scene: {
|
|
6697
|
+
schemaVersion: 1,
|
|
6698
|
+
id: "three-movements-kindle",
|
|
6699
|
+
label: "Kindle",
|
|
6700
|
+
seed: 12,
|
|
6701
|
+
layers: [
|
|
6702
|
+
{
|
|
6703
|
+
key: "caption",
|
|
6704
|
+
count: 1,
|
|
6705
|
+
sprite: {
|
|
6706
|
+
kind: "textBlock",
|
|
6707
|
+
text: "KINDLE.\nOne lamp, and then another.",
|
|
6708
|
+
maxWidth: 0.6,
|
|
6709
|
+
fontSize: 0.028,
|
|
6710
|
+
lineHeight: 1.5,
|
|
6711
|
+
align: "left",
|
|
6712
|
+
anchor: "top-left",
|
|
6713
|
+
font: "monospace",
|
|
6714
|
+
color: "#e8b878",
|
|
6715
|
+
opacity: 0.9,
|
|
6716
|
+
reveal: {
|
|
6717
|
+
progress: 1,
|
|
6718
|
+
mode: "typewriter",
|
|
6719
|
+
speed: 12,
|
|
6720
|
+
caret: { blink: 1.1 }
|
|
6721
|
+
}
|
|
6722
|
+
},
|
|
6723
|
+
motion: { type: "static" },
|
|
6724
|
+
position: { x: 0.1, y: 0.4 },
|
|
6725
|
+
alpha: [0.9, 0.9]
|
|
6726
|
+
},
|
|
6727
|
+
{
|
|
6728
|
+
key: "sparks",
|
|
6729
|
+
count: 30,
|
|
6730
|
+
sprite: {
|
|
6731
|
+
kind: "circle",
|
|
6732
|
+
radius: [12e-4, 26e-4],
|
|
6733
|
+
color: "#e8b878"
|
|
6734
|
+
},
|
|
6735
|
+
motion: { type: "static" },
|
|
6736
|
+
alpha: [0.15, 0.45],
|
|
6737
|
+
pulse: { amp: 0.12, period: 6e3 }
|
|
6738
|
+
}
|
|
6739
|
+
]
|
|
6740
|
+
}
|
|
6741
|
+
},
|
|
6742
|
+
{
|
|
6743
|
+
key: "dusk",
|
|
6744
|
+
scene: {
|
|
6745
|
+
schemaVersion: 1,
|
|
6746
|
+
id: "three-movements-dusk",
|
|
6747
|
+
label: "Dusk",
|
|
6748
|
+
seed: 13,
|
|
6749
|
+
layers: [
|
|
6750
|
+
{
|
|
6751
|
+
key: "bloom",
|
|
6752
|
+
count: 3,
|
|
6753
|
+
sprite: {
|
|
6754
|
+
kind: "circle",
|
|
6755
|
+
radius: [0.09, 0.14],
|
|
6756
|
+
color: "#7a4a5e",
|
|
6757
|
+
colors: ["#7a4a5e", "#b06a4a"],
|
|
6758
|
+
soft: true
|
|
6759
|
+
},
|
|
6760
|
+
motion: {
|
|
6761
|
+
type: "wander",
|
|
6762
|
+
speed: [1e-3, 2e-3],
|
|
6763
|
+
meander: 0.04,
|
|
6764
|
+
coherence: 0.7
|
|
6765
|
+
},
|
|
6766
|
+
alpha: [0.25, 0.4],
|
|
6767
|
+
blend: "lighter",
|
|
6768
|
+
grow: { amp: 0.3, period: 14e3 }
|
|
6769
|
+
},
|
|
6770
|
+
{
|
|
6771
|
+
key: "strokes",
|
|
6772
|
+
count: 8,
|
|
6773
|
+
sprite: {
|
|
6774
|
+
kind: "stroke",
|
|
6775
|
+
length: [0.1, 0.2],
|
|
6776
|
+
points: [
|
|
6777
|
+
[-1, 0.2],
|
|
6778
|
+
[-0.3, -0.6],
|
|
6779
|
+
[0.5, -0.4],
|
|
6780
|
+
[1, 0.2]
|
|
6781
|
+
],
|
|
6782
|
+
width: 4e-3,
|
|
6783
|
+
taper: true,
|
|
6784
|
+
color: "#c2447a",
|
|
6785
|
+
colors: ["#c2447a", "#8f2c58"]
|
|
6786
|
+
},
|
|
6787
|
+
motion: {
|
|
6788
|
+
type: "drift",
|
|
6789
|
+
speed: [3e-3, 8e-3],
|
|
6790
|
+
angle: 20,
|
|
6791
|
+
bidirectional: true
|
|
6792
|
+
},
|
|
6793
|
+
alpha: [0.3, 0.5],
|
|
6794
|
+
rotate: [-30, 30]
|
|
6795
|
+
}
|
|
6796
|
+
]
|
|
6797
|
+
}
|
|
6798
|
+
}
|
|
6799
|
+
]
|
|
6800
|
+
};
|
|
6801
|
+
|
|
6189
6802
|
// src/examples/facets.ts
|
|
6190
6803
|
var FACETS_SPEC = {
|
|
6191
6804
|
schemaVersion: 1,
|
|
@@ -7177,6 +7790,71 @@ var WARP_TUNNEL_SPEC = {
|
|
|
7177
7790
|
]
|
|
7178
7791
|
};
|
|
7179
7792
|
|
|
7793
|
+
// src/examples/typed-cue.ts
|
|
7794
|
+
var TYPED_CUE_SPEC = {
|
|
7795
|
+
schemaVersion: 1,
|
|
7796
|
+
id: "typed-cue",
|
|
7797
|
+
label: "Typed Cue",
|
|
7798
|
+
seed: 19,
|
|
7799
|
+
motionIntensity: "calm",
|
|
7800
|
+
background: { type: "solid", color: "#050608" },
|
|
7801
|
+
layers: [
|
|
7802
|
+
{
|
|
7803
|
+
key: "scan",
|
|
7804
|
+
count: 1,
|
|
7805
|
+
sprite: { kind: "rect", width: [1, 1], aspect: [0.02, 0.02], color: "#16241f", feather: 0.9 },
|
|
7806
|
+
motion: { type: "drift", speed: [0.014, 0.014], angle: 90 },
|
|
7807
|
+
alpha: [0.5, 0.5],
|
|
7808
|
+
blend: "screen"
|
|
7809
|
+
},
|
|
7810
|
+
{
|
|
7811
|
+
key: "headline",
|
|
7812
|
+
count: 1,
|
|
7813
|
+
sprite: {
|
|
7814
|
+
kind: "textBlock",
|
|
7815
|
+
text: "THE SCREEN IS AWAKE.\nWORDS ARRIVE ON THEIR OWN CLOCK.",
|
|
7816
|
+
maxWidth: 0.84,
|
|
7817
|
+
fontSize: 0.03,
|
|
7818
|
+
lineHeight: 1.5,
|
|
7819
|
+
align: "left",
|
|
7820
|
+
anchor: "top-left",
|
|
7821
|
+
font: "bold monospace",
|
|
7822
|
+
color: "#e6e8ef",
|
|
7823
|
+
opacity: 0.94,
|
|
7824
|
+
reveal: {
|
|
7825
|
+
progress: 1,
|
|
7826
|
+
mode: "typewriter",
|
|
7827
|
+
speed: 10,
|
|
7828
|
+
caret: { blink: 1.1, color: "#e6e8ef" }
|
|
7829
|
+
}
|
|
7830
|
+
},
|
|
7831
|
+
motion: { type: "static" },
|
|
7832
|
+
position: { x: 0.08, y: 0.16 },
|
|
7833
|
+
alpha: [0.95, 0.95]
|
|
7834
|
+
},
|
|
7835
|
+
{
|
|
7836
|
+
key: "aside",
|
|
7837
|
+
count: 1,
|
|
7838
|
+
sprite: {
|
|
7839
|
+
kind: "textBlock",
|
|
7840
|
+
text: "and leaves the same way \u2014\na dissolve, not a delete.",
|
|
7841
|
+
maxWidth: 0.5,
|
|
7842
|
+
fontSize: 0.022,
|
|
7843
|
+
lineHeight: 1.5,
|
|
7844
|
+
align: "left",
|
|
7845
|
+
anchor: "bottom-right",
|
|
7846
|
+
font: "monospace",
|
|
7847
|
+
color: "#8f96a3",
|
|
7848
|
+
opacity: 0.85,
|
|
7849
|
+
reveal: { progress: 1, mode: "glyphFade", speed: 6, fade: 0.4 }
|
|
7850
|
+
},
|
|
7851
|
+
motion: { type: "static" },
|
|
7852
|
+
position: { x: 0.92, y: 0.86 },
|
|
7853
|
+
alpha: [0.9, 0.9]
|
|
7854
|
+
}
|
|
7855
|
+
]
|
|
7856
|
+
};
|
|
7857
|
+
|
|
7180
7858
|
// src/examples/index.ts
|
|
7181
7859
|
var SCHEMA_EXAMPLES = [
|
|
7182
7860
|
{ id: "aquarium", label: "Aquarium", spec: AQUARIUM_SPEC },
|
|
@@ -7199,7 +7877,17 @@ var SCHEMA_EXAMPLES = [
|
|
|
7199
7877
|
{ id: "facets", label: "Facets", spec: FACETS_SPEC },
|
|
7200
7878
|
{ id: "relay-board", label: "Relay Board", spec: RELAY_BOARD_SPEC },
|
|
7201
7879
|
{ id: "lobby-talk", label: "Lobby Talk", spec: LOBBY_TALK_SPEC },
|
|
7202
|
-
{ id: "thermal-field", label: "Thermal Field", spec: THERMAL_FIELD_SPEC }
|
|
7880
|
+
{ id: "thermal-field", label: "Thermal Field", spec: THERMAL_FIELD_SPEC },
|
|
7881
|
+
{ id: "sparse-night", label: "Sparse Night", spec: SPARSE_NIGHT_SPEC },
|
|
7882
|
+
{ id: "typed-cue", label: "Typed Cue", spec: TYPED_CUE_SPEC },
|
|
7883
|
+
{ id: "signal-board", label: "Signal Board", spec: SIGNAL_BOARD_SPEC },
|
|
7884
|
+
{ id: "phase-duet", label: "Phase Duet", spec: PHASE_DUET_SPEC },
|
|
7885
|
+
{ id: "web-work", label: "Web Work", spec: WEB_WORK_SPEC },
|
|
7886
|
+
{ id: "shard-fall", label: "Shard Fall", spec: SHARD_FALL_SPEC },
|
|
7887
|
+
{ id: "murmur", label: "Murmur", spec: MURMUR_SPEC }
|
|
7888
|
+
];
|
|
7889
|
+
var EXAMPLE_SEQUENCES = [
|
|
7890
|
+
{ id: "three-movements", label: "Three Movements", sequence: THREE_MOVEMENTS_SEQUENCE }
|
|
7203
7891
|
];
|
|
7204
7892
|
var EXAMPLE_SPECS = SCHEMA_EXAMPLES.map((e) => e.spec);
|
|
7205
7893
|
var EXAMPLE_BY_ID = Object.fromEntries(
|
|
@@ -7215,6 +7903,7 @@ export {
|
|
|
7215
7903
|
DITHER_ALPHA,
|
|
7216
7904
|
DITHER_TILE,
|
|
7217
7905
|
EXAMPLE_BY_ID,
|
|
7906
|
+
EXAMPLE_SEQUENCES,
|
|
7218
7907
|
EXAMPLE_SPECS,
|
|
7219
7908
|
FACETS_SPEC,
|
|
7220
7909
|
FIELD_BUCKET_MS,
|
|
@@ -7229,8 +7918,10 @@ export {
|
|
|
7229
7918
|
LIMITS,
|
|
7230
7919
|
LOBBY_TALK_SPEC,
|
|
7231
7920
|
MATRIX_RAIN_SPEC,
|
|
7921
|
+
MURMUR_SPEC,
|
|
7232
7922
|
NOSTALGHIA_CANDLE_SPEC,
|
|
7233
7923
|
ORRERY_SPEC,
|
|
7924
|
+
PHASE_DUET_SPEC,
|
|
7234
7925
|
PINGS_SPEC,
|
|
7235
7926
|
POLYGONS_SPEC,
|
|
7236
7927
|
PROCESSION_SPEC,
|
|
@@ -7239,11 +7930,17 @@ export {
|
|
|
7239
7930
|
SAKURA_SPEC,
|
|
7240
7931
|
SCHEMA_EXAMPLES,
|
|
7241
7932
|
SCHEMA_VERSION,
|
|
7933
|
+
SHARD_FALL_SPEC,
|
|
7934
|
+
SIGNAL_BOARD_SPEC,
|
|
7242
7935
|
SNOWFALL_SPEC,
|
|
7936
|
+
SPARSE_NIGHT_SPEC,
|
|
7243
7937
|
THERMAL_FIELD_SPEC,
|
|
7938
|
+
THREE_MOVEMENTS_SEQUENCE,
|
|
7939
|
+
TYPED_CUE_SPEC,
|
|
7244
7940
|
WARP_MAX_SCALE,
|
|
7245
7941
|
WARP_NEAR,
|
|
7246
7942
|
WARP_TUNNEL_SPEC,
|
|
7943
|
+
WEB_WORK_SPEC,
|
|
7247
7944
|
adviseSequence,
|
|
7248
7945
|
adviseSpec,
|
|
7249
7946
|
alphaAt,
|
|
@@ -7309,6 +8006,7 @@ export {
|
|
|
7309
8006
|
segmentStart,
|
|
7310
8007
|
sequenceSteerablePaths,
|
|
7311
8008
|
sequenceSwapCompatible,
|
|
8009
|
+
sequenceWantsFinish,
|
|
7312
8010
|
sizeAt,
|
|
7313
8011
|
spriteIndexAt,
|
|
7314
8012
|
spriteVariants,
|