@idle-screens/schema 2.0.0 → 2.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/index.d.ts +112 -4
- package/dist/index.js +447 -32
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/saver-spec.schema.json +66 -3
package/saver-spec.schema.json
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"label": { "type": "string", "minLength": 1, "pattern": "\\S", "description": "Human-readable name." },
|
|
13
13
|
"seed": { "type": "number", "description": "Deterministic RNG seed. Same spec + same seed = identical frames. Falls back to the host's seed." },
|
|
14
14
|
"motionIntensity": { "enum": ["calm", "moderate", "energetic"], "description": "Advisory intensity for capability/reduced-motion gating." },
|
|
15
|
+
"units": { "enum": ["px", "viewport"], "description": "Dimensional unit system. 'viewport' = all sizes/speeds/distances are fractions of min(w,h)." },
|
|
15
16
|
"background": { "$ref": "#/definitions/background" },
|
|
16
17
|
"layers": {
|
|
17
18
|
"type": "array",
|
|
@@ -124,6 +125,17 @@
|
|
|
124
125
|
},
|
|
125
126
|
"description": "Sinusoidal opacity breathing. Per-entity seeded phase — a layer can never strobe in unison."
|
|
126
127
|
},
|
|
128
|
+
"spin": { "type": "number", "minimum": -360, "maximum": 360, "description": "Per-entity rotation speed in degrees/sec (positive = clockwise). Each entity gets a seeded starting angle." },
|
|
129
|
+
"grow": {
|
|
130
|
+
"type": "object",
|
|
131
|
+
"required": ["amp", "period"],
|
|
132
|
+
"additionalProperties": false,
|
|
133
|
+
"properties": {
|
|
134
|
+
"amp": { "type": "number", "exclusiveMinimum": 0, "maximum": 0.8, "description": "Size breathing amplitude as fraction of base size (0.3 = ±30%)." },
|
|
135
|
+
"period": { "type": "number", "minimum": 500, "description": "Breathing period in ms; same flash-safety floor as pulse." }
|
|
136
|
+
},
|
|
137
|
+
"description": "Sinusoidal size breathing. Per-entity seeded phase. Composes with any sprite kind."
|
|
138
|
+
},
|
|
127
139
|
"key": { "type": "string", "minLength": 1, "pattern": "\\S", "description": "Addressable name so setParam can use key.field paths." },
|
|
128
140
|
"position": {
|
|
129
141
|
"type": "object",
|
|
@@ -134,6 +146,19 @@
|
|
|
134
146
|
"y": { "type": "number", "minimum": 0, "maximum": 1 }
|
|
135
147
|
},
|
|
136
148
|
"description": "Exact fractional position for a single entity. Requires count: 1. Overrides region scatter."
|
|
149
|
+
},
|
|
150
|
+
"links": {
|
|
151
|
+
"type": "object",
|
|
152
|
+
"required": ["k", "maxDist"],
|
|
153
|
+
"additionalProperties": false,
|
|
154
|
+
"properties": {
|
|
155
|
+
"k": { "type": "integer", "minimum": 1, "maximum": 8, "description": "Connect to the k nearest neighbors." },
|
|
156
|
+
"maxDist": { "type": "number", "exclusiveMinimum": 0, "description": "Maximum link distance (px or viewport-units)." },
|
|
157
|
+
"color": { "$ref": "#/definitions/hexColor", "description": "Link color. Defaults to per-entity color." },
|
|
158
|
+
"alpha": { "type": "number", "minimum": 0, "maximum": 1, "description": "Link opacity. Defaults to entity alpha." },
|
|
159
|
+
"width": { "type": "number", "exclusiveMinimum": 0, "description": "Stroke width (px or viewport-units). Default 1." }
|
|
160
|
+
},
|
|
161
|
+
"description": "Draw lines to each entity's k nearest neighbors within maxDist. The layer's entity count (count field) must be <= 200 for performance."
|
|
137
162
|
}
|
|
138
163
|
},
|
|
139
164
|
"if": { "required": ["position"] },
|
|
@@ -147,7 +172,8 @@
|
|
|
147
172
|
"additionalProperties": false,
|
|
148
173
|
"properties": {
|
|
149
174
|
"kind": { "const": "emoji" },
|
|
150
|
-
"glyphs": { "type": "array", "minItems": 1, "items": { "type": "string" }, "description": "Emoji picked per entity (seeded)." }
|
|
175
|
+
"glyphs": { "type": "array", "minItems": 1, "items": { "type": "string" }, "description": "Emoji picked per entity (seeded)." },
|
|
176
|
+
"cycle": { "$ref": "#/definitions/cycle" }
|
|
151
177
|
}
|
|
152
178
|
},
|
|
153
179
|
{
|
|
@@ -161,7 +187,8 @@
|
|
|
161
187
|
"font": { "type": "string", "description": "CSS font shorthand, e.g. 'bold 24px monospace'." },
|
|
162
188
|
"align": { "enum": ["left", "center", "right"] },
|
|
163
189
|
"baseline": { "enum": ["top", "middle", "bottom"] },
|
|
164
|
-
"maxWidth": { "type": "number", "exclusiveMinimum": 0 }
|
|
190
|
+
"maxWidth": { "type": "number", "exclusiveMinimum": 0 },
|
|
191
|
+
"cycle": { "$ref": "#/definitions/cycle" }
|
|
165
192
|
}
|
|
166
193
|
},
|
|
167
194
|
{
|
|
@@ -172,11 +199,21 @@
|
|
|
172
199
|
"kind": { "const": "circle" },
|
|
173
200
|
"radius": { "$ref": "#/definitions/positiveRange" },
|
|
174
201
|
"color": { "$ref": "#/definitions/hexColor" },
|
|
175
|
-
"soft": { "type": "boolean", "description": "Radial falloff (glow orb) instead of a hard disc." }
|
|
202
|
+
"soft": { "type": "boolean", "description": "Radial falloff (glow orb) instead of a hard disc." },
|
|
203
|
+
"colors": { "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/hexColor" }, "description": "Per-entity color palette (seeded pick). Falls back to color." }
|
|
176
204
|
}
|
|
177
205
|
}
|
|
178
206
|
]
|
|
179
207
|
},
|
|
208
|
+
"cycle": {
|
|
209
|
+
"type": "object",
|
|
210
|
+
"required": ["period"],
|
|
211
|
+
"additionalProperties": false,
|
|
212
|
+
"properties": {
|
|
213
|
+
"period": { "type": "number", "minimum": 500, "description": "Cycling period in ms; floor of 500 (flash-safety)." }
|
|
214
|
+
},
|
|
215
|
+
"description": "Rotate through sprite variants over time. Each entity offsets by its seeded phase."
|
|
216
|
+
},
|
|
180
217
|
"motion": {
|
|
181
218
|
"oneOf": [
|
|
182
219
|
{
|
|
@@ -217,6 +254,32 @@
|
|
|
217
254
|
"properties": {
|
|
218
255
|
"type": { "const": "static", "description": "Entity stays exactly where placed. Use with position for pinned elements." }
|
|
219
256
|
}
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"type": "object",
|
|
260
|
+
"required": ["type", "speed", "radius"],
|
|
261
|
+
"additionalProperties": false,
|
|
262
|
+
"properties": {
|
|
263
|
+
"type": { "const": "orbit" },
|
|
264
|
+
"speed": {
|
|
265
|
+
"type": "array",
|
|
266
|
+
"items": { "type": "number", "minimum": 0, "maximum": 180 },
|
|
267
|
+
"minItems": 2,
|
|
268
|
+
"maxItems": 2,
|
|
269
|
+
"description": "[min, max] angular velocity in degrees/sec, capped at 180."
|
|
270
|
+
},
|
|
271
|
+
"radius": { "$ref": "#/definitions/positiveRange", "description": "[min, max] orbit radius in px." },
|
|
272
|
+
"center": {
|
|
273
|
+
"type": "object",
|
|
274
|
+
"required": ["x", "y"],
|
|
275
|
+
"additionalProperties": false,
|
|
276
|
+
"properties": {
|
|
277
|
+
"x": { "type": "number", "minimum": 0, "maximum": 1 },
|
|
278
|
+
"y": { "type": "number", "minimum": 0, "maximum": 1 }
|
|
279
|
+
},
|
|
280
|
+
"description": "Orbit center as fractional viewport position. Default {0.5, 0.5}."
|
|
281
|
+
}
|
|
282
|
+
}
|
|
220
283
|
}
|
|
221
284
|
]
|
|
222
285
|
}
|