@ludic-labs/assembly 0.0.0-stage → 0.4.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/CHANGELOG.md +78 -0
- package/LICENSE +2 -0
- package/README.md +50 -2
- package/dist/bake.d.ts +80 -0
- package/dist/bake.js +214 -0
- package/dist/browser.d.ts +89 -0
- package/dist/browser.js +534 -0
- package/dist/compat.d.ts +17 -0
- package/dist/compat.js +153 -0
- package/dist/compiler.d.ts +18 -0
- package/dist/compiler.js +1264 -0
- package/dist/diagnostics.d.ts +5 -0
- package/dist/diagnostics.js +8 -0
- package/dist/export.d.ts +54 -0
- package/dist/export.js +272 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3 -0
- package/dist/legacy.d.ts +36 -0
- package/dist/legacy.js +180 -0
- package/dist/math.d.ts +16 -0
- package/dist/math.js +62 -0
- package/dist/mesh.d.ts +11 -0
- package/dist/mesh.js +153 -0
- package/dist/motion.d.ts +63 -0
- package/dist/motion.js +1476 -0
- package/dist/pixel.d.ts +268 -0
- package/dist/pixel.js +942 -0
- package/dist/required.d.ts +2 -0
- package/dist/required.js +6 -0
- package/dist/shapes.d.ts +71 -0
- package/dist/shapes.js +396 -0
- package/dist/sprite-brief.d.ts +5 -0
- package/dist/sprite-brief.js +47 -0
- package/dist/sprite-compiler.d.ts +62 -0
- package/dist/sprite-compiler.js +1745 -0
- package/dist/sprite-decompile.d.ts +68 -0
- package/dist/sprite-decompile.js +786 -0
- package/dist/sprite-format.d.ts +4 -0
- package/dist/sprite-format.js +155 -0
- package/dist/sprite-guide.d.ts +40 -0
- package/dist/sprite-guide.js +330 -0
- package/dist/sprite-scene.d.ts +277 -0
- package/dist/sprite-scene.js +664 -0
- package/dist/sprite-types.d.ts +110 -0
- package/dist/sprite-types.js +1 -0
- package/dist/sprite.d.ts +8 -0
- package/dist/sprite.js +8 -0
- package/dist/svg/schema.d.ts +71 -0
- package/dist/svg/schema.js +217 -0
- package/dist/svg/types.d.ts +148 -0
- package/dist/svg/types.js +1 -0
- package/dist/svg.d.ts +26 -0
- package/dist/svg.js +539 -0
- package/dist/text.d.ts +12 -0
- package/dist/text.js +75 -0
- package/dist/types.d.ts +478 -0
- package/dist/types.js +1 -0
- package/docs/svg/README.md +150 -0
- package/docs/svg/specification.md +108 -0
- package/examples/svg/arcane-shield.json +261 -0
- package/examples/svg/aurora-ribbon.json +158 -0
- package/examples/svg/bouncing-ember.json +76 -0
- package/examples/svg/ember-fountain.json +224 -0
- package/examples/svg/lantern-keeper.json +1159 -0
- package/examples/svg/night-workshop.json +1120 -0
- package/examples/svg/waygate-platform.json +64 -0
- package/examples/svg/waygate-spark.json +92 -0
- package/examples/svg/waygate-wisp.json +105 -0
- package/examples/svg/waygate.json +485 -0
- package/package.json +132 -4
- package/schemas/asset-assembly-0.1.schema.json +354 -0
- package/schemas/asset-assembly-0.2.schema.json +429 -0
- package/schemas/asset-assembly-0.3.schema.json +572 -0
- package/schemas/motion-set-0.1.schema.json +178 -0
- package/schemas/pixel-sprite-0.1.schema.json +892 -0
- package/schemas/pixel-sprite-scene-0.1.schema.json +149 -0
- package/schemas/svg-asset-0.1.schema.json +1157 -0
- package/tools/svg-asset.mjs +106 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# `svg-asset/0.1` specification
|
|
2
|
+
|
|
3
|
+
This document specifies the implemented initial version. Unknown fields and unsupported variants are errors, not ignored extension points. Version changes require a new `schema` identifier. The notation is JSON data, not an expression string language or a container for arbitrary SVG/XML.
|
|
4
|
+
|
|
5
|
+
## Document and coordinates
|
|
6
|
+
|
|
7
|
+
Required fields: `schema: "svg-asset/0.1"`, `name`, `viewBox: [x, y, width, height]`, and a nonempty `nodes` array. Width/height must be positive. Optional fields are `seed`, `params`, `palette`, `gradients`, `clips`, `masks`, `symbols`, `animations`, `defaultAnimation`. The complete machine grammar is [the JSON Schema](../../schemas/svg-asset-0.1.schema.json).
|
|
8
|
+
|
|
9
|
+
X increases rightward, Y downward; lengths use SVG user units. Rotation is in degrees. Trigonometric expressions use radians. Time is in seconds. Roots and siblings paint in array order, later on top. The root viewBox clips the delivered image. Shapes inherit SVG fill/stroke through parent groups; default SVG fill is black, default stroke is none. IDs are identifiers beginning with an ASCII letter, followed by letters, digits, `_` or `-`, maximum 64 characters.
|
|
10
|
+
|
|
11
|
+
Every node has an `id` unique among its siblings. Instance identity is the ordered expansion path, exposed as `data-part`, such as `root/row/2/book/book/cover`. IDs are semantic labels, never global DOM IDs. Definitions receive generated IDs prefixed by `options.prefix` (default `asset`). When multiple SVGs share an HTML document, callers must use distinct prefixes. Prefixes allow a letter followed by up to 79 letters, digits, underscores or hyphens; animated export appends `-fN`, which must fit that limit too.
|
|
12
|
+
|
|
13
|
+
`name` is escaped into `<title>` and `aria-label`. Strings must contain valid XML text. The grammar has no scripts, external URLs, event handlers, HTML, embedded images or raw attribute escape hatch. This constrains the output surface; it is not a security certification or a generic sanitizer for arbitrary SVG.
|
|
14
|
+
|
|
15
|
+
## Numbers, parameters and expressions
|
|
16
|
+
|
|
17
|
+
`params` maps names to `{ "default": number, "min": number, "max": number }`. Bounds and defaults are required, finite and ordered. Values at both bounds are legal. Parameters named `time`, `phase`, `i`, `n`, `age` or `life` are reserved. Numeric literals and parameter declarations are limited to ±1,000,000. Intermediate evaluated expressions are limited to ±1,000,000,000. Division by zero and invalid bounds are errors.
|
|
18
|
+
|
|
19
|
+
Anywhere the schema permits a numeric expression, use a literal, `$name` reference or operator tuple:
|
|
20
|
+
|
|
21
|
+
| Form | Meaning |
|
|
22
|
+
| ------------------------------------------------------------------ | ---------------------------------------------------------------- |
|
|
23
|
+
| `["add", a, b]`, `["sub", a, b]`, `["mul", a, b]`, `["div", a, b]` | Binary arithmetic; arity is exactly two |
|
|
24
|
+
| `["min", a, b]`, `["max", a, b]` | Minimum/maximum |
|
|
25
|
+
| `["sin", a]`, `["cos", a]`, `["abs", a]` | Trigonometry (radians), absolute value |
|
|
26
|
+
| `["clamp", value, low, high]` | Inclusive clamp; low must not exceed high |
|
|
27
|
+
| `["mix", a, b, u]` | `a + (b-a)*u`; extrapolation is allowed, then bounds are checked |
|
|
28
|
+
| `["rand", salt, low, high]` | Stable seeded sample in `[low, high)`, or low when equal |
|
|
29
|
+
|
|
30
|
+
Randomness hashes the document seed (default zero), the full expanded node/particle path and numeric salt using explicit 32-bit operations. It never reads `Math.random`, wall time or previous samples. The same salt at the same path shares a sample; use different salts for independent attributes. Renaming or reparenting an instance intentionally changes its random identity. Seeds are uint32. Sampling trigonometry uses JavaScript floating point; bit-identical results across every CPU/JS runtime are not promised. SVG numeric serialization rounds to six decimal places.
|
|
31
|
+
|
|
32
|
+
Global `$time` is the selected clip's wrapped/clamped local time; without a clip it is the requested time. `$phase` is `$time / duration`, or zero without a clip. Requested times are finite in `[0, 1000000]`. `animation: null` selects the rest parameter values and leaves time unwrapped; it does not freeze explicit `$time` expressions or emitters. `params` render options replace sampled global parameter values and must be within declared bounds.
|
|
33
|
+
|
|
34
|
+
## Shapes and composition
|
|
35
|
+
|
|
36
|
+
Each node shares optional `transform`, `style`, `opacity`, `clip`, `mask`, `blur`.
|
|
37
|
+
|
|
38
|
+
| `kind` | Required geometry / fields | Optional geometry / fields |
|
|
39
|
+
| --------- | --------------------------------------------------- | -------------------------------------------------------- |
|
|
40
|
+
| `rect` | `x`, `y`, `width`, `height` | `radius` (uniform rounded corner, default zero) |
|
|
41
|
+
| `ellipse` | `cx`, `cy`, `rx`, `ry` | — |
|
|
42
|
+
| `path` | `d`: array of absolute command tuples | — |
|
|
43
|
+
| `group` | `children`: nonempty node array | — |
|
|
44
|
+
| `use` | `symbol`: declared symbol name | `args`: numeric expressions for that symbol's parameters |
|
|
45
|
+
| `repeat` | `count`: integer 1–1024; `children` | — |
|
|
46
|
+
| `emitter` | `count`, `lifetime`, `mode`, `velocity`, `children` | `start` (zero), `acceleration` (`[0,0]`) |
|
|
47
|
+
|
|
48
|
+
Dimensions, radii and stroke widths are nonnegative, capped at 1,000,000. Zero sizes are allowed and collapse geometry. Negative scales allow mirroring. Opacity is in `[0,1]`; blur deviation is in `[0,100]`.
|
|
49
|
+
|
|
50
|
+
Paths start with `M`. Command tuples are `['M',x,y]`, `['L',x,y]`, `['Q',cx,cy,x,y]`, `['C',c1x,c1y,c2x,c2y,x,y]`, `['A',rx,ry,rotation,largeArcFlag,sweepFlag,x,y]`, `['Z']`. Arc flags are literal 0 or 1. Additional `M` commands introduce subpaths. Curves can deform by referencing animated parameters in control-point expressions; command topology stays fixed. Relative commands and raw `d` strings are excluded to keep validation and editing explicit.
|
|
51
|
+
|
|
52
|
+
`transform` contains optional `translate: [x,y]`, `rotate`, `scale: [sx,sy]`, `pivot: [px,py]`. The matrix is `T(translate) T(pivot) R(rotate) S(scale) T(-pivot)`. Thus local points are scaled about the pivot, rotated about it, then translated, before the parent transform. This supports hierarchical articulation without a separate rig API.
|
|
53
|
+
|
|
54
|
+
`symbols` maps a name to `{ params?, children }`. Each call creates a group and expands the body with **lexical scope**: document globals plus the symbol's own arguments/defaults. Caller loop/particle locals are not implicitly captured; pass them explicitly as declared arguments. Arguments are evaluated in the caller's scope, then checked against the symbol's bounds. Local parameters may shadow document parameters. Unknown arguments, undeclared symbols and all symbol cycles (including unused cycles) are errors. Arguments are numeric only; colors can be inherited by leaving symbol paint unspecified or using the document palette.
|
|
55
|
+
|
|
56
|
+
`repeat` expands children in increasing index order. `$i` is zero-based and `$n` is the count in its child scope. Nested repetition shadows those two variables. Repetition does not apply an implicit translation; author the layout in children, for example `translate: [["mul", "$i", 24], 0]`.
|
|
57
|
+
|
|
58
|
+
## Paint and definitions
|
|
59
|
+
|
|
60
|
+
`style` fields: `fill`, `stroke`, `strokeWidth`, `linecap` (`butt|round|square`), `linejoin` (`miter|round|bevel`), `fillRule` (`nonzero|evenodd`). Paint is six-digit `#rrggbb`, `none`, a palette reference `@name`, or `{ "gradient": "name" }`. Alpha uses node opacity or gradient stop opacity. General CSS color strings and external URLs are excluded.
|
|
61
|
+
|
|
62
|
+
Gradients use `userSpaceOnUse`, in the referencing element's coordinate system:
|
|
63
|
+
|
|
64
|
+
- Linear: `{ kind: "linear", from: [x1,y1], to: [x2,y2], stops }`.
|
|
65
|
+
- Radial: `{ kind: "radial", center: [cx,cy], radius, stops }`, radius strictly positive.
|
|
66
|
+
- Stops: ordered 2–32 entries `{ offset: 0..1, color: "#rrggbb", opacity?: 0..1 }`. Equal offsets permit hard transitions. Positions can use global animated expressions; stop colors/offsets are fixed in 0.1.
|
|
67
|
+
|
|
68
|
+
`clips` and `masks` map names to nonempty shape arrays (no groups, symbols or emitters). These definitions use global parameters only. Shapes can have transforms and paint but cannot themselves refer to clips, masks or blur, avoiding recursive definition graphs. Clips use `userSpaceOnUse` and `fillRule` also controls `clip-rule`. Masks use SVG luminance: white reveals, black conceals; default unpainted shapes are black. Mask region is the document viewBox in user units. Both definitions are interpreted in the referencing element's local coordinates.
|
|
69
|
+
|
|
70
|
+
`blur` creates a Gaussian filter with a `-100%..200%` region along each axis and sRGB interpolation. Large blur relative to tiny shape bounds can be clipped by this finite filter region; expand source geometry if necessary. No arbitrary filter graph or compositing/blend-mode DSL is exposed.
|
|
71
|
+
|
|
72
|
+
## Clips and effects
|
|
73
|
+
|
|
74
|
+
`animations` maps names to `{ duration, loop, tracks }`. Duration is strictly positive and at most 60 seconds. A track targets a declared global parameter and has 2–256 keys `{ time, value, ease? }`. It must begin at zero, end at the exact duration, have strictly increasing times, and keep all values within parameter bounds. Empty `tracks` is allowed for effects driven by `$time` or emitter lifetime.
|
|
75
|
+
|
|
76
|
+
The outgoing segment uses the earlier key's ease: `linear` (default), `smooth` (`u²(3−2u)`) or `hold` (keep earlier value until the next key). Overshoot requires explicit keys/bounds; smooth interpolation cannot overshoot its endpoints. Independent tracks can be staggered for anticipation/follow-through. Loops use `t % duration`; one-shots clamp at duration. Keys at the last instant of a loop define interpolation toward the boundary but sampling exactly at duration returns the first pose. Loop continuity is authored: different endpoints, hold transitions or nonperiodic expressions can deliberately pop.
|
|
77
|
+
|
|
78
|
+
For an emitter with `N=count`, `L=lifetime`, `e=$time-start`:
|
|
79
|
+
|
|
80
|
+
- If `e < 0`, emit nothing.
|
|
81
|
+
- `loop` prewarms a fixed population: particle i has `life=(e+i*L/N)%L`.
|
|
82
|
+
- `burst` gives all particles `life=e`; particles disappear at `e >= L`.
|
|
83
|
+
- Children and velocity/acceleration expressions receive `$i`, `$n`, `$life` in seconds, and `$age=life/L`.
|
|
84
|
+
- Position is `velocity*life + acceleration*life²/2` in the emitter's local frame. Each component may be an expression. With age-varying coefficients this is an authored trajectory formula, not a physical integration solver.
|
|
85
|
+
- The particle's subtree is arbitrary supported nodes. Lifetimes/counts are literal and fixed; seed/identity repeats each cycle, providing exact seekability. There is no accumulating particle state, stochastic birth rate or collision system.
|
|
86
|
+
|
|
87
|
+
For seamless emitters, fade children at age boundaries and choose a clip duration compatible with emitter lifetime. Clipping the time to a one-shot also freezes its surviving particles at the endpoint.
|
|
88
|
+
|
|
89
|
+
## Output and budgets
|
|
90
|
+
|
|
91
|
+
`renderSvgFrame` returns a complete standalone SVG with a title, viewBox, definitions and named part paths. No network or font resolution is involved. Core output is a string; a host chooses when/how to insert it, animate it or rasterize it.
|
|
92
|
+
|
|
93
|
+
`exportSvgAnimation` uses `steps=ceil(duration*fps)` and samples at `i*duration/steps`. Requested fps defaults to 24 and is in `[1,60]`; effective sample rate is `steps/duration`. Loops have `steps` frames excluding the duplicate endpoint; one-shots add a frame at the exact endpoint. Each frame has separately namespaced definitions and a discrete SVG `animate` controlling its group display. Exactly one frame is visible during supported playback. One-shots use `fill="freeze"` and hold the endpoint. When animation is disabled, the base document shows the first frame. No JavaScript is embedded.
|
|
94
|
+
|
|
95
|
+
This exporter samples the curve; it does not preserve continuous animation between those frames. It also duplicates geometry. The in-app sampler can instead render at a host-controlled cadence without storing every frame. Static output and exported playback are compared at the same sample times in browser verification.
|
|
96
|
+
|
|
97
|
+
| Budget | Limit |
|
|
98
|
+
| -------------------- | -------------------------------------------------------------- |
|
|
99
|
+
| Source traversal | 100,000 JSON values, depth 64, 2,000,000 string/key characters |
|
|
100
|
+
| Dictionaries | 128 entries each |
|
|
101
|
+
| Child arrays / paths | 512 children per array; 2,048 commands per path |
|
|
102
|
+
| Expanded frame | 10,000 visited source nodes; expansion depth 32 |
|
|
103
|
+
| Animation export | 240 frames; 8,000,000 body/definition characters |
|
|
104
|
+
| Individual frame | 8,000,000 body/definition characters |
|
|
105
|
+
|
|
106
|
+
Budgets raise `SVG_BUDGET`; they do not silently omit shapes. Small document wrappers add a few hundred characters beyond the body/definition budget. JSON Schema encodes structural sizes; the runtime additionally enforces aggregate/expansion budgets. Compilation and export are all-or-error in memory. The CLI validates a complete frame sequence before writing it; file I/O failures can still leave partial files, and existing output-directory contents are not deleted.
|
|
107
|
+
|
|
108
|
+
Other diagnostic codes include `SVG_STRUCTURE`, `SVG_REFERENCE`, `SVG_PARAMETER`, `SVG_DUPLICATE`, `SVG_CYCLE`, `SVG_DEFINITION`, `SVG_PATH`, `SVG_GRADIENT`, `SVG_TIMELINE`, `SVG_RANGE`, `SVG_ARITHMETIC`, `SVG_ID` and CLI-only `SVG_CLI`. Structural diagnostics carry a source path; evaluation diagnostics carry a semantic expansion path or option path. No claim is made that the first diagnostic lists every problem in an invalid document.
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": "svg-asset/0.1",
|
|
3
|
+
"name": "Arcane shield",
|
|
4
|
+
"viewBox": [0, 0, 480, 360],
|
|
5
|
+
"seed": 123,
|
|
6
|
+
"params": {
|
|
7
|
+
"turn": {
|
|
8
|
+
"default": 0,
|
|
9
|
+
"min": 0,
|
|
10
|
+
"max": 360
|
|
11
|
+
},
|
|
12
|
+
"pulse": {
|
|
13
|
+
"default": 1,
|
|
14
|
+
"min": 0.94,
|
|
15
|
+
"max": 1.06
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"gradients": {
|
|
19
|
+
"glass": {
|
|
20
|
+
"kind": "radial",
|
|
21
|
+
"center": [240, 180],
|
|
22
|
+
"radius": 126,
|
|
23
|
+
"stops": [
|
|
24
|
+
{
|
|
25
|
+
"offset": 0,
|
|
26
|
+
"color": "#7096ec",
|
|
27
|
+
"opacity": 0.05
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"offset": 0.8,
|
|
31
|
+
"color": "#72d5ef",
|
|
32
|
+
"opacity": 0.18
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"offset": 1,
|
|
36
|
+
"color": "#a4f3ec",
|
|
37
|
+
"opacity": 0.04
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"animations": {
|
|
43
|
+
"guard": {
|
|
44
|
+
"duration": 4,
|
|
45
|
+
"loop": true,
|
|
46
|
+
"tracks": {
|
|
47
|
+
"turn": [
|
|
48
|
+
{
|
|
49
|
+
"time": 0,
|
|
50
|
+
"value": 0
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"time": 4,
|
|
54
|
+
"value": 360
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"pulse": [
|
|
58
|
+
{
|
|
59
|
+
"time": 0,
|
|
60
|
+
"value": 0.96,
|
|
61
|
+
"ease": "smooth"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"time": 2.0,
|
|
65
|
+
"value": 1.04,
|
|
66
|
+
"ease": "smooth"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"time": 4,
|
|
70
|
+
"value": 0.96
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"defaultAnimation": "guard",
|
|
77
|
+
"nodes": [
|
|
78
|
+
{
|
|
79
|
+
"id": "glass",
|
|
80
|
+
"kind": "ellipse",
|
|
81
|
+
"cx": 240,
|
|
82
|
+
"cy": 180,
|
|
83
|
+
"rx": 124,
|
|
84
|
+
"ry": 124,
|
|
85
|
+
"style": {
|
|
86
|
+
"fill": {
|
|
87
|
+
"gradient": "glass"
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"id": "shield",
|
|
93
|
+
"kind": "group",
|
|
94
|
+
"transform": {
|
|
95
|
+
"pivot": [240, 180],
|
|
96
|
+
"scale": ["$pulse", "$pulse"]
|
|
97
|
+
},
|
|
98
|
+
"children": [
|
|
99
|
+
{
|
|
100
|
+
"id": "glow",
|
|
101
|
+
"kind": "path",
|
|
102
|
+
"d": [
|
|
103
|
+
["M", 240.0, 72.0],
|
|
104
|
+
["L", 333.531, 126.0],
|
|
105
|
+
["L", 333.531, 234.0],
|
|
106
|
+
["L", 240.0, 288.0],
|
|
107
|
+
["L", 146.469, 234.0],
|
|
108
|
+
["L", 146.469, 126.0],
|
|
109
|
+
["Z"]
|
|
110
|
+
],
|
|
111
|
+
"style": {
|
|
112
|
+
"fill": "none",
|
|
113
|
+
"stroke": "#78e5dd",
|
|
114
|
+
"strokeWidth": 10,
|
|
115
|
+
"linecap": "round",
|
|
116
|
+
"linejoin": "round"
|
|
117
|
+
},
|
|
118
|
+
"blur": 7,
|
|
119
|
+
"opacity": 0.45
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"id": "edge",
|
|
123
|
+
"kind": "path",
|
|
124
|
+
"d": [
|
|
125
|
+
["M", 240.0, 72.0],
|
|
126
|
+
["L", 333.531, 126.0],
|
|
127
|
+
["L", 333.531, 234.0],
|
|
128
|
+
["L", 240.0, 288.0],
|
|
129
|
+
["L", 146.469, 234.0],
|
|
130
|
+
["L", 146.469, 126.0],
|
|
131
|
+
["Z"]
|
|
132
|
+
],
|
|
133
|
+
"style": {
|
|
134
|
+
"fill": "none",
|
|
135
|
+
"stroke": "#9ef3e5",
|
|
136
|
+
"strokeWidth": 2.5,
|
|
137
|
+
"linecap": "round",
|
|
138
|
+
"linejoin": "round"
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"id": "inner",
|
|
143
|
+
"kind": "path",
|
|
144
|
+
"d": [
|
|
145
|
+
["M", 240.0, 72.0],
|
|
146
|
+
["L", 333.531, 126.0],
|
|
147
|
+
["L", 333.531, 234.0],
|
|
148
|
+
["L", 240.0, 288.0],
|
|
149
|
+
["L", 146.469, 234.0],
|
|
150
|
+
["L", 146.469, 126.0],
|
|
151
|
+
["Z"]
|
|
152
|
+
],
|
|
153
|
+
"style": {
|
|
154
|
+
"fill": "none",
|
|
155
|
+
"stroke": "#809af2",
|
|
156
|
+
"strokeWidth": 1,
|
|
157
|
+
"linecap": "round",
|
|
158
|
+
"linejoin": "round"
|
|
159
|
+
},
|
|
160
|
+
"transform": {
|
|
161
|
+
"pivot": [240, 180],
|
|
162
|
+
"scale": [0.86, 0.86]
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"id": "seams",
|
|
167
|
+
"kind": "path",
|
|
168
|
+
"d": [
|
|
169
|
+
["M", 240, 72],
|
|
170
|
+
["L", 240, 288],
|
|
171
|
+
["M", 146.47, 126],
|
|
172
|
+
["L", 333.53, 234],
|
|
173
|
+
["M", 146.47, 234],
|
|
174
|
+
["L", 333.53, 126]
|
|
175
|
+
],
|
|
176
|
+
"style": {
|
|
177
|
+
"fill": "none",
|
|
178
|
+
"stroke": "#9abbeb",
|
|
179
|
+
"strokeWidth": 0.8,
|
|
180
|
+
"linecap": "round",
|
|
181
|
+
"linejoin": "round"
|
|
182
|
+
},
|
|
183
|
+
"opacity": 0.22
|
|
184
|
+
}
|
|
185
|
+
]
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"id": "orbit",
|
|
189
|
+
"kind": "repeat",
|
|
190
|
+
"count": 12,
|
|
191
|
+
"transform": {
|
|
192
|
+
"translate": [240, 180],
|
|
193
|
+
"rotate": "$turn"
|
|
194
|
+
},
|
|
195
|
+
"children": [
|
|
196
|
+
{
|
|
197
|
+
"id": "mark",
|
|
198
|
+
"kind": "group",
|
|
199
|
+
"transform": {
|
|
200
|
+
"rotate": ["mul", "$i", 30]
|
|
201
|
+
},
|
|
202
|
+
"children": [
|
|
203
|
+
{
|
|
204
|
+
"id": "rune",
|
|
205
|
+
"kind": "path",
|
|
206
|
+
"d": [["M", 0, -145], ["L", 4, -136], ["L", 0, -127], ["L", -4, -136], ["Z"]],
|
|
207
|
+
"style": {
|
|
208
|
+
"fill": "none",
|
|
209
|
+
"stroke": "#e6c9f8",
|
|
210
|
+
"strokeWidth": 1.5,
|
|
211
|
+
"linecap": "round",
|
|
212
|
+
"linejoin": "round"
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"id": "point",
|
|
217
|
+
"kind": "ellipse",
|
|
218
|
+
"cx": 0,
|
|
219
|
+
"cy": -116,
|
|
220
|
+
"rx": 1.4,
|
|
221
|
+
"ry": 1.4,
|
|
222
|
+
"style": {
|
|
223
|
+
"fill": "#b6f9ed"
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
]
|
|
227
|
+
}
|
|
228
|
+
]
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"id": "upper-arc",
|
|
232
|
+
"kind": "path",
|
|
233
|
+
"d": [
|
|
234
|
+
["M", 120, 125],
|
|
235
|
+
["A", 133, 133, 0, 0, 1, 320, 74]
|
|
236
|
+
],
|
|
237
|
+
"style": {
|
|
238
|
+
"fill": "none",
|
|
239
|
+
"stroke": "#b6a1f1",
|
|
240
|
+
"strokeWidth": 2,
|
|
241
|
+
"linecap": "round",
|
|
242
|
+
"linejoin": "round"
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"id": "lower-arc",
|
|
247
|
+
"kind": "path",
|
|
248
|
+
"d": [
|
|
249
|
+
["M", 360, 235],
|
|
250
|
+
["A", 133, 133, 0, 0, 1, 160, 286]
|
|
251
|
+
],
|
|
252
|
+
"style": {
|
|
253
|
+
"fill": "none",
|
|
254
|
+
"stroke": "#7cedd9",
|
|
255
|
+
"strokeWidth": 2,
|
|
256
|
+
"linecap": "round",
|
|
257
|
+
"linejoin": "round"
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
]
|
|
261
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": "svg-asset/0.1",
|
|
3
|
+
"name": "Aurora ribbon",
|
|
4
|
+
"viewBox": [0, 0, 480, 360],
|
|
5
|
+
"seed": 610,
|
|
6
|
+
"params": {
|
|
7
|
+
"wave": {
|
|
8
|
+
"default": 0,
|
|
9
|
+
"min": -1,
|
|
10
|
+
"max": 1
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"animations": {
|
|
14
|
+
"flow": {
|
|
15
|
+
"duration": 4,
|
|
16
|
+
"loop": true,
|
|
17
|
+
"tracks": {
|
|
18
|
+
"wave": [
|
|
19
|
+
{
|
|
20
|
+
"time": 0,
|
|
21
|
+
"value": -1,
|
|
22
|
+
"ease": "smooth"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"time": 2.0,
|
|
26
|
+
"value": 1,
|
|
27
|
+
"ease": "smooth"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"time": 4,
|
|
31
|
+
"value": -1
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"defaultAnimation": "flow",
|
|
38
|
+
"nodes": [
|
|
39
|
+
{
|
|
40
|
+
"id": "stars",
|
|
41
|
+
"kind": "repeat",
|
|
42
|
+
"count": 27,
|
|
43
|
+
"children": [
|
|
44
|
+
{
|
|
45
|
+
"id": "star",
|
|
46
|
+
"kind": "ellipse",
|
|
47
|
+
"cx": ["rand", 0, 24, 456],
|
|
48
|
+
"cy": ["rand", 1, 35, 300],
|
|
49
|
+
"rx": ["rand", 2, 0.6, 1.5],
|
|
50
|
+
"ry": ["rand", 2, 0.6, 1.5],
|
|
51
|
+
"style": {
|
|
52
|
+
"fill": "#c6e8e9"
|
|
53
|
+
},
|
|
54
|
+
"opacity": 0.55
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"id": "curtains",
|
|
60
|
+
"kind": "repeat",
|
|
61
|
+
"count": 24,
|
|
62
|
+
"children": [
|
|
63
|
+
{
|
|
64
|
+
"id": "ray",
|
|
65
|
+
"kind": "path",
|
|
66
|
+
"d": [
|
|
67
|
+
["M", 0, 0],
|
|
68
|
+
["Q", 10, -25, 0, -65]
|
|
69
|
+
],
|
|
70
|
+
"style": {
|
|
71
|
+
"fill": "none",
|
|
72
|
+
"stroke": "#6cebc2",
|
|
73
|
+
"strokeWidth": 2,
|
|
74
|
+
"linecap": "round",
|
|
75
|
+
"linejoin": "round"
|
|
76
|
+
},
|
|
77
|
+
"opacity": ["add", 0.22, ["mul", 0.16, ["sin", ["add", ["mul", "$i", 0.42], "$wave"]]]],
|
|
78
|
+
"transform": {
|
|
79
|
+
"translate": [
|
|
80
|
+
["add", 48, ["mul", "$i", 16]],
|
|
81
|
+
["add", 180, ["mul", 42, ["sin", ["add", ["mul", "$i", 0.33], "$wave"]]]]
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"id": "ribbon-0",
|
|
89
|
+
"kind": "path",
|
|
90
|
+
"d": [
|
|
91
|
+
["M", 32, 170],
|
|
92
|
+
["C", 125, ["sub", 70, ["mul", "$wave", 35]], 145, ["add", 300, ["mul", "$wave", 22]], 240, 170],
|
|
93
|
+
["C", 325, ["sub", 55, ["mul", "$wave", 25]], 355, ["add", 270, ["mul", "$wave", 40]], 448, 140]
|
|
94
|
+
],
|
|
95
|
+
"style": {
|
|
96
|
+
"fill": "none",
|
|
97
|
+
"stroke": "#765df0",
|
|
98
|
+
"strokeWidth": 28,
|
|
99
|
+
"linecap": "round",
|
|
100
|
+
"linejoin": "round"
|
|
101
|
+
},
|
|
102
|
+
"opacity": 0.22,
|
|
103
|
+
"blur": 7
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"id": "ribbon-1",
|
|
107
|
+
"kind": "path",
|
|
108
|
+
"d": [
|
|
109
|
+
["M", 32, 183],
|
|
110
|
+
["C", 125, ["sub", 70, ["mul", "$wave", 35]], 145, ["add", 300, ["mul", "$wave", 22]], 240, 183],
|
|
111
|
+
["C", 325, ["sub", 55, ["mul", "$wave", 25]], 355, ["add", 270, ["mul", "$wave", 40]], 448, 153]
|
|
112
|
+
],
|
|
113
|
+
"style": {
|
|
114
|
+
"fill": "none",
|
|
115
|
+
"stroke": "#42dec1",
|
|
116
|
+
"strokeWidth": 18,
|
|
117
|
+
"linecap": "round",
|
|
118
|
+
"linejoin": "round"
|
|
119
|
+
},
|
|
120
|
+
"opacity": 0.28,
|
|
121
|
+
"blur": 7
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"id": "ribbon-2",
|
|
125
|
+
"kind": "path",
|
|
126
|
+
"d": [
|
|
127
|
+
["M", 32, 196],
|
|
128
|
+
["C", 125, ["sub", 70, ["mul", "$wave", 35]], 145, ["add", 300, ["mul", "$wave", 22]], 240, 196],
|
|
129
|
+
["C", 325, ["sub", 55, ["mul", "$wave", 25]], 355, ["add", 270, ["mul", "$wave", 40]], 448, 166]
|
|
130
|
+
],
|
|
131
|
+
"style": {
|
|
132
|
+
"fill": "none",
|
|
133
|
+
"stroke": "#8df9cf",
|
|
134
|
+
"strokeWidth": 7,
|
|
135
|
+
"linecap": "round",
|
|
136
|
+
"linejoin": "round"
|
|
137
|
+
},
|
|
138
|
+
"opacity": 0.72
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"id": "ribbon-3",
|
|
142
|
+
"kind": "path",
|
|
143
|
+
"d": [
|
|
144
|
+
["M", 32, 209],
|
|
145
|
+
["C", 125, ["sub", 70, ["mul", "$wave", 35]], 145, ["add", 300, ["mul", "$wave", 22]], 240, 209],
|
|
146
|
+
["C", 325, ["sub", 55, ["mul", "$wave", 25]], 355, ["add", 270, ["mul", "$wave", 40]], 448, 179]
|
|
147
|
+
],
|
|
148
|
+
"style": {
|
|
149
|
+
"fill": "none",
|
|
150
|
+
"stroke": "#d9ffdc",
|
|
151
|
+
"strokeWidth": 1.5,
|
|
152
|
+
"linecap": "round",
|
|
153
|
+
"linejoin": "round"
|
|
154
|
+
},
|
|
155
|
+
"opacity": 0.85
|
|
156
|
+
}
|
|
157
|
+
]
|
|
158
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": "svg-asset/0.1",
|
|
3
|
+
"name": "Bouncing ember",
|
|
4
|
+
"viewBox": [0, 0, 100, 100],
|
|
5
|
+
"params": {
|
|
6
|
+
"lift": {
|
|
7
|
+
"default": 0,
|
|
8
|
+
"min": -25,
|
|
9
|
+
"max": 0
|
|
10
|
+
},
|
|
11
|
+
"squash": {
|
|
12
|
+
"default": 1,
|
|
13
|
+
"min": 0.8,
|
|
14
|
+
"max": 1.2
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"nodes": [
|
|
18
|
+
{
|
|
19
|
+
"id": "ember",
|
|
20
|
+
"kind": "ellipse",
|
|
21
|
+
"cx": 50,
|
|
22
|
+
"cy": 65,
|
|
23
|
+
"rx": 16,
|
|
24
|
+
"ry": 20,
|
|
25
|
+
"style": {
|
|
26
|
+
"fill": "#edb95f"
|
|
27
|
+
},
|
|
28
|
+
"transform": {
|
|
29
|
+
"translate": [0, "$lift"],
|
|
30
|
+
"pivot": [50, 85],
|
|
31
|
+
"scale": [["div", 1, "$squash"], "$squash"]
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"animations": {
|
|
36
|
+
"bounce": {
|
|
37
|
+
"duration": 1,
|
|
38
|
+
"loop": true,
|
|
39
|
+
"tracks": {
|
|
40
|
+
"lift": [
|
|
41
|
+
{
|
|
42
|
+
"time": 0,
|
|
43
|
+
"value": 0,
|
|
44
|
+
"ease": "smooth"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"time": 0.5,
|
|
48
|
+
"value": -25,
|
|
49
|
+
"ease": "smooth"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"time": 1,
|
|
53
|
+
"value": 0
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"squash": [
|
|
57
|
+
{
|
|
58
|
+
"time": 0,
|
|
59
|
+
"value": 0.8,
|
|
60
|
+
"ease": "smooth"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"time": 0.5,
|
|
64
|
+
"value": 1.2,
|
|
65
|
+
"ease": "smooth"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"time": 1,
|
|
69
|
+
"value": 0.8
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"defaultAnimation": "bounce"
|
|
76
|
+
}
|