@fusion.dev/helix 0.181.2 → 0.182.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/custom-elements.json +213 -13
- package/dist/bar-chart/root/bar-chart-root.css.js +2 -2
- package/dist/strands/path.d.ts +51 -2
- package/dist/strands/path.js +255 -42
- package/dist/strands/renderer.d.ts +10 -0
- package/dist/strands/renderer.js +5 -2
- package/dist/strands/root/strands-root.d.ts +29 -6
- package/dist/strands/root/strands-root.js +38 -4
- package/dist/strands/shader.d.ts +5 -3
- package/dist/strands/shader.js +122 -18
- package/dist/strands/stop/strands-stop.d.ts +5 -3
- package/lint.json +1 -1
- package/package.json +6 -6
- package/types/jsx.d.ts +90 -24
- package/types/vue.d.ts +25 -5
package/custom-elements.json
CHANGED
|
@@ -10173,6 +10173,62 @@
|
|
|
10173
10173
|
"module": "src/bar-chart/root/bar-chart-root.ts"
|
|
10174
10174
|
}
|
|
10175
10175
|
},
|
|
10176
|
+
{
|
|
10177
|
+
"description": "The color of a bar whose cell says `data-tone=\"accent\"`.",
|
|
10178
|
+
"name": "--bar-chart-tone-accent",
|
|
10179
|
+
"inheritedFrom": {
|
|
10180
|
+
"name": "HelixHeadlessBarChart",
|
|
10181
|
+
"module": "src/bar-chart/root/bar-chart-root.ts"
|
|
10182
|
+
}
|
|
10183
|
+
},
|
|
10184
|
+
{
|
|
10185
|
+
"description": "The color of a bar whose cell says `data-tone=\"danger\"`.",
|
|
10186
|
+
"name": "--bar-chart-tone-danger",
|
|
10187
|
+
"inheritedFrom": {
|
|
10188
|
+
"name": "HelixHeadlessBarChart",
|
|
10189
|
+
"module": "src/bar-chart/root/bar-chart-root.ts"
|
|
10190
|
+
}
|
|
10191
|
+
},
|
|
10192
|
+
{
|
|
10193
|
+
"description": "The color of a bar whose cell says `data-tone=\"info\"`.",
|
|
10194
|
+
"name": "--bar-chart-tone-info",
|
|
10195
|
+
"inheritedFrom": {
|
|
10196
|
+
"name": "HelixHeadlessBarChart",
|
|
10197
|
+
"module": "src/bar-chart/root/bar-chart-root.ts"
|
|
10198
|
+
}
|
|
10199
|
+
},
|
|
10200
|
+
{
|
|
10201
|
+
"description": "The color of a bar whose cell says `data-tone=\"muted\"`.",
|
|
10202
|
+
"name": "--bar-chart-tone-muted",
|
|
10203
|
+
"inheritedFrom": {
|
|
10204
|
+
"name": "HelixHeadlessBarChart",
|
|
10205
|
+
"module": "src/bar-chart/root/bar-chart-root.ts"
|
|
10206
|
+
}
|
|
10207
|
+
},
|
|
10208
|
+
{
|
|
10209
|
+
"description": "The color of a bar whose cell says `data-tone=\"primary\"`. A tone with no property of its own falls back to the bar's series color, and the same holds for a name you define.",
|
|
10210
|
+
"name": "--bar-chart-tone-primary",
|
|
10211
|
+
"inheritedFrom": {
|
|
10212
|
+
"name": "HelixHeadlessBarChart",
|
|
10213
|
+
"module": "src/bar-chart/root/bar-chart-root.ts"
|
|
10214
|
+
}
|
|
10215
|
+
},
|
|
10216
|
+
{
|
|
10217
|
+
"description": "The color of a bar whose cell says `data-tone=\"success\"`.",
|
|
10218
|
+
"name": "--bar-chart-tone-success",
|
|
10219
|
+
"inheritedFrom": {
|
|
10220
|
+
"name": "HelixHeadlessBarChart",
|
|
10221
|
+
"module": "src/bar-chart/root/bar-chart-root.ts"
|
|
10222
|
+
}
|
|
10223
|
+
},
|
|
10224
|
+
{
|
|
10225
|
+
"description": "The color of a bar whose cell says `data-tone=\"warning\"`.",
|
|
10226
|
+
"name": "--bar-chart-tone-warning",
|
|
10227
|
+
"inheritedFrom": {
|
|
10228
|
+
"name": "HelixHeadlessBarChart",
|
|
10229
|
+
"module": "src/bar-chart/root/bar-chart-root.ts"
|
|
10230
|
+
}
|
|
10231
|
+
},
|
|
10176
10232
|
{
|
|
10177
10233
|
"description": "The gradient for a bar, named per bar so the styled tier can use it as the `fill`. It is always drawn, and used only when `wash=\"gradient\"` is set.",
|
|
10178
10234
|
"name": "--chart-bar-wash",
|
|
@@ -10880,7 +10936,7 @@
|
|
|
10880
10936
|
{
|
|
10881
10937
|
"name": "bar",
|
|
10882
10938
|
"type": {
|
|
10883
|
-
"text": "(\n value: number,\n index: number,\n depth: number,\n tone: number,\n scale: (value: number) => number,\n from?: number,\n end?: StackEnd,\n ) => TemplateResult"
|
|
10939
|
+
"text": "(\n value: number,\n index: number,\n depth: number,\n tone: number,\n scale: (value: number) => number,\n from?: number,\n end?: StackEnd,\n named?: string,\n ) => TemplateResult"
|
|
10884
10940
|
}
|
|
10885
10941
|
}
|
|
10886
10942
|
],
|
|
@@ -197448,6 +197504,24 @@
|
|
|
197448
197504
|
"default": "0.5",
|
|
197449
197505
|
"description": "The tightest any form turns, as a share of the box's height: the radius of\nits sharpest curve.\n\nHalf the height. A bend's apex a few dozen pixels round kinked the strands\nthat ran along its inside, and read as a fold in the light where every form\nis meant to be one sweep. `path.pure.spec.ts` measures it on every form."
|
|
197450
197506
|
},
|
|
197507
|
+
{
|
|
197508
|
+
"kind": "variable",
|
|
197509
|
+
"name": "SPREAD",
|
|
197510
|
+
"type": {
|
|
197511
|
+
"text": "number"
|
|
197512
|
+
},
|
|
197513
|
+
"default": "1.35",
|
|
197514
|
+
"description": "The ribbon's width over each form's own at a `spread` of `1`, which the\nrenderer multiplies in. Here so the path can know how far its strands reach."
|
|
197515
|
+
},
|
|
197516
|
+
{
|
|
197517
|
+
"kind": "variable",
|
|
197518
|
+
"name": "SHAPE",
|
|
197519
|
+
"type": {
|
|
197520
|
+
"text": "PathShape"
|
|
197521
|
+
},
|
|
197522
|
+
"default": "{ lean: 0.1, period: 1.4, sweep: 0.4, swing: 0.6 }",
|
|
197523
|
+
"description": "The shape a page draws unless it asks for another: calm, the ribbon\nswinging six tenths of the most its turns allow over S curves 2.4 screens\nlong, resting a tenth of the width right of the middle. Compared down the\nwhole landing page against wider, quicker, and leaning shapes, this one\nread as one long current rather than a ribbon zigzagging between cards."
|
|
197524
|
+
},
|
|
197451
197525
|
{
|
|
197452
197526
|
"kind": "function",
|
|
197453
197527
|
"name": "boxPath",
|
|
@@ -197531,6 +197605,14 @@
|
|
|
197531
197605
|
"text": "number"
|
|
197532
197606
|
},
|
|
197533
197607
|
"description": "The page's height, in CSS pixels."
|
|
197608
|
+
},
|
|
197609
|
+
{
|
|
197610
|
+
"name": "shape",
|
|
197611
|
+
"default": "SHAPE",
|
|
197612
|
+
"type": {
|
|
197613
|
+
"text": "PathShape"
|
|
197614
|
+
},
|
|
197615
|
+
"description": "The ribbon's shape down the page."
|
|
197534
197616
|
}
|
|
197535
197617
|
],
|
|
197536
197618
|
"description": "The ribbon laid down a whole page, which is what an element with `travel`\nshows.\n\nEach stop places its form at its target, in page order. Between two stops\nthe ribbon fills the gap with soft S-curves in `fill`'s place, except\nbetween two waves less than a screen and a half apart, where it turns off\nscreen so each wave reads alone.\nWithout stops, `fill` runs the length of the page: a bend opens the page and\na ribbon follows it, waves cross every screen and a third, and a ribbon\nmeanders the whole way. After a last wave the ribbon does not come back, so\nthe page ends on the wave."
|
|
@@ -197577,6 +197659,32 @@
|
|
|
197577
197659
|
],
|
|
197578
197660
|
"description": "One coordinate of a uniform Catmull-Rom segment, the same one the shader runs."
|
|
197579
197661
|
},
|
|
197662
|
+
{
|
|
197663
|
+
"kind": "function",
|
|
197664
|
+
"name": "arcLengths",
|
|
197665
|
+
"return": {
|
|
197666
|
+
"type": {
|
|
197667
|
+
"text": "Float32Array"
|
|
197668
|
+
}
|
|
197669
|
+
},
|
|
197670
|
+
"parameters": [
|
|
197671
|
+
{
|
|
197672
|
+
"name": "points",
|
|
197673
|
+
"type": {
|
|
197674
|
+
"text": "readonly PathPoint[]"
|
|
197675
|
+
},
|
|
197676
|
+
"description": "The path."
|
|
197677
|
+
},
|
|
197678
|
+
{
|
|
197679
|
+
"name": "width",
|
|
197680
|
+
"type": {
|
|
197681
|
+
"text": "number"
|
|
197682
|
+
},
|
|
197683
|
+
"description": "The box's width, in CSS pixels, which `x` is a share of."
|
|
197684
|
+
}
|
|
197685
|
+
],
|
|
197686
|
+
"description": "How far along the drawn centerline each point is, in CSS pixels, for the\nshader to set every frequency by.\n\n**Arc length, which only grows.** The shader used the sum of a point's `y`\nand its `x` in pixels, which grows down a page and across a wave heading\nright, and runs backward wherever the path heads left faster than it heads\ndown: on a bend's upper arm, and across a wave sweeping left. There the\nstrands' twist and waves ran in reverse, and every strand turned a corner\nat the same place.\n\nSixteen samples a segment of the same spline the shader draws."
|
|
197687
|
+
},
|
|
197580
197688
|
{
|
|
197581
197689
|
"kind": "function",
|
|
197582
197690
|
"name": "lookup",
|
|
@@ -197643,6 +197751,22 @@
|
|
|
197643
197751
|
"module": "src/strands/path.ts"
|
|
197644
197752
|
}
|
|
197645
197753
|
},
|
|
197754
|
+
{
|
|
197755
|
+
"kind": "js",
|
|
197756
|
+
"name": "SPREAD",
|
|
197757
|
+
"declaration": {
|
|
197758
|
+
"name": "SPREAD",
|
|
197759
|
+
"module": "src/strands/path.ts"
|
|
197760
|
+
}
|
|
197761
|
+
},
|
|
197762
|
+
{
|
|
197763
|
+
"kind": "js",
|
|
197764
|
+
"name": "SHAPE",
|
|
197765
|
+
"declaration": {
|
|
197766
|
+
"name": "SHAPE",
|
|
197767
|
+
"module": "src/strands/path.ts"
|
|
197768
|
+
}
|
|
197769
|
+
},
|
|
197646
197770
|
{
|
|
197647
197771
|
"kind": "js",
|
|
197648
197772
|
"name": "boxPath",
|
|
@@ -197667,6 +197791,14 @@
|
|
|
197667
197791
|
"module": "src/strands/path.ts"
|
|
197668
197792
|
}
|
|
197669
197793
|
},
|
|
197794
|
+
{
|
|
197795
|
+
"kind": "js",
|
|
197796
|
+
"name": "arcLengths",
|
|
197797
|
+
"declaration": {
|
|
197798
|
+
"name": "arcLengths",
|
|
197799
|
+
"module": "src/strands/path.ts"
|
|
197800
|
+
}
|
|
197801
|
+
},
|
|
197670
197802
|
{
|
|
197671
197803
|
"kind": "js",
|
|
197672
197804
|
"name": "lookup",
|
|
@@ -198133,6 +198265,14 @@
|
|
|
198133
198265
|
}
|
|
198134
198266
|
],
|
|
198135
198267
|
"exports": [
|
|
198268
|
+
{
|
|
198269
|
+
"kind": "js",
|
|
198270
|
+
"name": "MAX_QUIET",
|
|
198271
|
+
"declaration": {
|
|
198272
|
+
"name": "MAX_QUIET",
|
|
198273
|
+
"module": "src/strands/renderer.ts"
|
|
198274
|
+
}
|
|
198275
|
+
},
|
|
198136
198276
|
{
|
|
198137
198277
|
"kind": "js",
|
|
198138
198278
|
"name": "MAX_STRANDS",
|
|
@@ -198201,7 +198341,7 @@
|
|
|
198201
198341
|
"declarations": [
|
|
198202
198342
|
{
|
|
198203
198343
|
"kind": "class",
|
|
198204
|
-
"description": "Hundreds of thin strands are drawn as one ribbon, and the light they add\ntogether is bloomed, so where they converge the ribbon burns hot. The ribbon\nmoves on its own all the time: it sways and breathes, its strands wave and\nroll over one another, and light runs along them.\n\nIts palette comes from the tokens. The strands are `--helix-color-primary`,\na few are `--helix-color-accent` for depth, and the page they light is\n`--helix-color-background`. On a light page the light becomes ink, because\nlight added to near-white cannot be seen.\n\n**
|
|
198344
|
+
"description": "Hundreds of thin strands are drawn as one ribbon, and the light they add\ntogether is bloomed, so where they converge the ribbon burns hot. The ribbon\nmoves on its own all the time: it sways and breathes, its strands wave and\nroll over one another, and light runs along them.\n\nIts palette comes from the tokens. The strands are `--helix-color-primary`,\na few are `--helix-color-accent` for depth, and the page they light is\n`--helix-color-background`. On a light page the light becomes ink, because\nlight added to near-white cannot be seen.\n\n**Four forms, set with `variant`.** `bend` turns bright strands through one\ntight point, with its arms opening to the right. `ribbon`, the default, is a\nbroad, soft ribbon in long curves. `sweep` enters at a top corner, the one\n`at` is nearer, and crosses in one diagonal to the far side. `waves` is sharp\nstrands crossing the full width.\n\n**Quiet behind words.** `quiet` names elements, such as a hero's words, that\nthe light dims behind to a faint glow, so a bright ribbon can cross the page\nunder them and they stay crisp.\n\n**In its own box, by default.** The element fills the box it is given, the\nway an image does, and `at` places the bend's apex or the ribbon's axis across\nit. Content placed inside sits over the ribbon, in the `content` part.\n\n**Down the whole page, with `travel`.** The element fixes itself behind the\npage, on `--helix-layer-beneath`, and lays one ribbon from the top of the page to the\nbottom, so scrolling travels along it. Put `helix-strands-stop` elements\ninside to pin a form to a section: each names an element with `for` and says\nwhich form the ribbon takes there. Between stops the ribbon fills the gap in\nits own `variant`, and between two waves less than a screen and a half\napart it turns off screen so each wave reads alone. Set `z-index` on the\nelement to move it.\n\nThe ribbon stops moving in these cases:\n- `prefers-reduced-motion` is set. The element shows one still frame, and in\n `travel` still follows the scroll, without easing.\n- The element is off screen or in a background tab.\n\nIt shows a gradient from the same tokens in these cases, and matches\n`:state(fallback)` and sends `helix-strands-fallback` with the reason:\n- The renderer draws on the CPU, such as a headless browser or a machine with\n no usable GPU.\n- There is no WebGL, or the browser took the drawing context back.\n\nStrands is styled only and has behavior, as `Aura` does: its behavior is\ndrawing to a canvas, so there is no structure for a headless version to hold.",
|
|
198205
198345
|
"name": "HelixStrands",
|
|
198206
198346
|
"cssProperties": [
|
|
198207
198347
|
{
|
|
@@ -198294,7 +198434,7 @@
|
|
|
198294
198434
|
"text": "number"
|
|
198295
198435
|
},
|
|
198296
198436
|
"default": "1",
|
|
198297
|
-
"description": "How differently
|
|
198437
|
+
"description": "How differently the strands move across the ribbon, from `0`, the whole\nribbon rolling and waving as one, to `1`, its edges flowing at their own\npace past its middle. Neighbors always move together, so no strand leaves\nits lane. Clamped to that range.",
|
|
198298
198438
|
"attribute": "drift"
|
|
198299
198439
|
},
|
|
198300
198440
|
{
|
|
@@ -198317,6 +198457,15 @@
|
|
|
198317
198457
|
"description": "Overall brightness, as a multiplier on the light.",
|
|
198318
198458
|
"attribute": "gain"
|
|
198319
198459
|
},
|
|
198460
|
+
{
|
|
198461
|
+
"kind": "field",
|
|
198462
|
+
"name": "quiet",
|
|
198463
|
+
"type": {
|
|
198464
|
+
"text": "string | undefined"
|
|
198465
|
+
},
|
|
198466
|
+
"description": "The ids of elements the light dims behind, separated by spaces, such as\na hero's words. Inside each, the ribbon keeps a faint glow, so words over\nit stay crisp and nothing busy runs under them, and it eases back to full\na short way past each edge. Up to four; ids that name nothing are skipped.",
|
|
198467
|
+
"attribute": "quiet"
|
|
198468
|
+
},
|
|
198320
198469
|
{
|
|
198321
198470
|
"kind": "field",
|
|
198322
198471
|
"name": "softness",
|
|
@@ -198362,7 +198511,7 @@
|
|
|
198362
198511
|
"kind": "field",
|
|
198363
198512
|
"name": "variant",
|
|
198364
198513
|
"type": {
|
|
198365
|
-
"text": "'bend' | 'ribbon' | 'waves' | undefined"
|
|
198514
|
+
"text": "'bend' | 'ribbon' | 'sweep' | 'waves' | undefined"
|
|
198366
198515
|
},
|
|
198367
198516
|
"description": "The form the ribbon takes. When it is not set, the form is `ribbon`. In\n`travel`, the form of every stretch no stop claims.",
|
|
198368
198517
|
"attribute": "variant"
|
|
@@ -198520,6 +198669,21 @@
|
|
|
198520
198669
|
"privacy": "private",
|
|
198521
198670
|
"default": "0"
|
|
198522
198671
|
},
|
|
198672
|
+
{
|
|
198673
|
+
"kind": "field",
|
|
198674
|
+
"name": "lengths",
|
|
198675
|
+
"privacy": "private",
|
|
198676
|
+
"default": "new Float32Array(MAX_POINTS)",
|
|
198677
|
+
"description": "How far along the path each point is, in pixels, four to a slot as the shader reads them."
|
|
198678
|
+
},
|
|
198679
|
+
{
|
|
198680
|
+
"kind": "field",
|
|
198681
|
+
"name": "quietRects",
|
|
198682
|
+
"privacy": "private",
|
|
198683
|
+
"readonly": true,
|
|
198684
|
+
"default": "new Float32Array(MAX_QUIET * 4)",
|
|
198685
|
+
"description": "The rects the light dims behind, in the path's pixels, from `quiet`."
|
|
198686
|
+
},
|
|
198523
198687
|
{
|
|
198524
198688
|
"kind": "field",
|
|
198525
198689
|
"name": "table",
|
|
@@ -198717,6 +198881,17 @@
|
|
|
198717
198881
|
},
|
|
198718
198882
|
"description": "Lays the path out again: inside the box, or down the page from the stops.\n\nCheap, a few dozen points and a table of a few hundred numbers, so it runs\non any change that could move the path rather than working out which did."
|
|
198719
198883
|
},
|
|
198884
|
+
{
|
|
198885
|
+
"kind": "method",
|
|
198886
|
+
"name": "measureQuiet",
|
|
198887
|
+
"privacy": "private",
|
|
198888
|
+
"return": {
|
|
198889
|
+
"type": {
|
|
198890
|
+
"text": "void"
|
|
198891
|
+
}
|
|
198892
|
+
},
|
|
198893
|
+
"description": "The rects of the elements `quiet` names: on the page in `travel`, where\nthe path is laid in page pixels, and inside the box otherwise."
|
|
198894
|
+
},
|
|
198720
198895
|
{
|
|
198721
198896
|
"kind": "method",
|
|
198722
198897
|
"name": "placedStops",
|
|
@@ -199241,7 +199416,7 @@
|
|
|
199241
199416
|
"text": "number"
|
|
199242
199417
|
},
|
|
199243
199418
|
"default": "1",
|
|
199244
|
-
"description": "How differently
|
|
199419
|
+
"description": "How differently the strands move across the ribbon, from `0`, the whole\nribbon rolling and waving as one, to `1`, its edges flowing at their own\npace past its middle. Neighbors always move together, so no strand leaves\nits lane. Clamped to that range.",
|
|
199245
199420
|
"fieldName": "drift"
|
|
199246
199421
|
},
|
|
199247
199422
|
{
|
|
@@ -199262,6 +199437,14 @@
|
|
|
199262
199437
|
"description": "Overall brightness, as a multiplier on the light.",
|
|
199263
199438
|
"fieldName": "gain"
|
|
199264
199439
|
},
|
|
199440
|
+
{
|
|
199441
|
+
"name": "quiet",
|
|
199442
|
+
"type": {
|
|
199443
|
+
"text": "string | undefined"
|
|
199444
|
+
},
|
|
199445
|
+
"description": "The ids of elements the light dims behind, separated by spaces, such as\na hero's words. Inside each, the ribbon keeps a faint glow, so words over\nit stay crisp and nothing busy runs under them, and it eases back to full\na short way past each edge. Up to four; ids that name nothing are skipped.",
|
|
199446
|
+
"fieldName": "quiet"
|
|
199447
|
+
},
|
|
199265
199448
|
{
|
|
199266
199449
|
"name": "softness",
|
|
199267
199450
|
"type": {
|
|
@@ -199301,7 +199484,7 @@
|
|
|
199301
199484
|
{
|
|
199302
199485
|
"name": "variant",
|
|
199303
199486
|
"type": {
|
|
199304
|
-
"text": "'bend' | 'ribbon' | 'waves' | undefined"
|
|
199487
|
+
"text": "'bend' | 'ribbon' | 'sweep' | 'waves' | undefined"
|
|
199305
199488
|
},
|
|
199306
199489
|
"description": "The form the ribbon takes. When it is not set, the form is `ribbon`. In\n`travel`, the form of every stretch no stop claims.",
|
|
199307
199490
|
"fieldName": "variant"
|
|
@@ -199401,22 +199584,31 @@
|
|
|
199401
199584
|
"kind": "javascript-module",
|
|
199402
199585
|
"path": "src/strands/shader.ts",
|
|
199403
199586
|
"declarations": [
|
|
199587
|
+
{
|
|
199588
|
+
"kind": "variable",
|
|
199589
|
+
"name": "MAX_QUIET",
|
|
199590
|
+
"type": {
|
|
199591
|
+
"text": "number"
|
|
199592
|
+
},
|
|
199593
|
+
"default": "4",
|
|
199594
|
+
"description": "The most elements a ribbon dims behind, through the root's \\`quiet\\`."
|
|
199595
|
+
},
|
|
199404
199596
|
{
|
|
199405
199597
|
"kind": "variable",
|
|
199406
199598
|
"name": "LINE_VERTEX",
|
|
199407
|
-
"default": "`#version 300 es layout(location = 0) in vec2 aVert; layout(location = 1) in float aId; uniform float uDpr; uniform float uSoftness; uniform float uContrast; uniform vec3 uGlow; uniform vec3 uTint; uniform vec3 uPeak; out float vSide; out vec3 vColor; ${PATH} void main() { float id = aId; float r5 = h1(id + 7.77); float r6 = h1(id + 9.19); float r7 = h1(id + 11.3); float t = mix(uT.x, uT.y, aVert.x); vec3 info; vec3 unused; vec3 a = strandAt(id, t, info); vec3 b = strandAt(id, t + (uT.y - uT.x) / 700.0, unused); vec2 tg = b.xy - a.xy; tg = length(tg) > 1e-4 ? normalize(tg) : vec2(0.0, 1.0); vec2 nrm = vec2(-tg.y, tg.x); float soft = smoothstep(0.06, 0.28, info.y) * step(1.0 - uSoftness, r6); /* Nearer is thicker, and the back of the ribbon falls out of focus: wider at the same energy, so it reads as haze behind the sharp strands. */ float base = mix(0.35, 1.3, r7 * r7) * uDpr * (1.0 + (0.3 + 0.5 * uDepth) * a.z); float focus = uDepth * smoothstep(-0.1, -0.9, a.z) *
|
|
199599
|
+
"default": "`#version 300 es layout(location = 0) in vec2 aVert; layout(location = 1) in float aId; uniform float uDpr; uniform float uSoftness; uniform float uContrast; uniform vec3 uGlow; uniform vec3 uTint; uniform vec3 uPeak; out float vSide; out float vSigma; out vec3 vColor; ${PATH} void main() { float id = aId; float r5 = h1(id + 7.77); float r6 = h1(id + 9.19); float r7 = h1(id + 11.3); float t = mix(uT.x, uT.y, aVert.x); vec3 info; vec3 unused; vec3 a = strandAt(id, t, info); vec3 b = strandAt(id, t + (uT.y - uT.x) / 700.0, unused); vec2 tg = b.xy - a.xy; tg = length(tg) > 1e-4 ? normalize(tg) : vec2(0.0, 1.0); vec2 nrm = vec2(-tg.y, tg.x); float soft = smoothstep(0.06, 0.28, info.y) * step(1.0 - uSoftness, r6); /* Nearer is thicker, and the back of the ribbon falls out of focus: wider at the same energy, so it reads as haze behind the sharp strands. */ float base = mix(0.35, 1.3, r7 * r7) * uDpr * (1.0 + (0.3 + 0.5 * uDepth) * a.z); float focus = uDepth * smoothstep(-0.1, -0.9, a.z) * 4.0 * uDpr; float w = max(base + soft * mix(8.0, 36.0, r6) * uDpr + focus, 1.0); /* **A profile no narrower than a pixel can carry.** The strand's light falls off across it as a Gaussian a quarter of its width wide, which for a strand a pixel wide is a quarter of a pixel: narrower than the pixels sampling it, so a thin strand broke into a row of dots wherever it ran between pixel centers. Its spread is held to at least 0.7 of a device pixel, and its peak comes down by the same factor, so it carries the same light and reads as one continuous thread. The quad covers three spreads either side. */ float designed = w * 0.228; float sigma = max(designed, 0.7); float drawW = max(w, sigma * 6.0) + 2.5 * uDpr; vec2 res = uView * uDpr; vec2 px = a.xy * uDpr + nrm * aVert.y * drawW * 0.5; gl_Position = vec4(px.x / res.x * 2.0 - 1.0, 1.0 - px.y / res.y * 2.0, 0.0, 1.0); vSide = aVert.y * drawW * 0.5; vSigma = sigma; /* **Light travels along the strand slowly and long.** A pulse every 140 pixels broke each strand into dashes; one every 1,800 or so is light moving down a fiber. */ float shimmer = 0.5 + 0.5 * sin(info.z * 0.0035 - uTime * (0.6 + 0.4 * r5) + r6 * 6.283); /* Contrast spreads the strands' brightness: a few burn and most fall back. The mean is held, so the ribbon as a whole keeps its strength. */ float spread = mix(1.4, 4.5, uContrast); float least = mix(0.35, 0.14, uContrast); float bright = mix(least, 1.0, pow(r5, spread)) * 0.5625 / (least + (1.0 - least) / (spread + 1.0)); float energy = min(base, w) / w; float fall = 0.3 + 0.5 * uDepth; float depth = (1.0 - fall * (1.0 - a.z) * 0.5) / (1.0 - fall * 0.5); float rest = mix(0.35, 0.15, uContrast); vec3 col = mix(uGlow, uTint, step(0.83, r6) * 0.9); col = mix(col, uPeak, step(0.93, r7) * 0.6); vColor = col * energy * info.x * (rest + (1.0 - rest) * shimmer) * bright * depth * (designed / sigma) * quietAt(a.xy); } `",
|
|
199408
199600
|
"description": "Each strand as a ribbon of quads, wide enough to anti-alias and to blur."
|
|
199409
199601
|
},
|
|
199410
199602
|
{
|
|
199411
199603
|
"kind": "variable",
|
|
199412
199604
|
"name": "LINE_FRAGMENT",
|
|
199413
|
-
"default": "`#version 300 es precision highp float; in float vSide; in vec3 vColor; uniform float uScale; out vec4 outColor; void main() { outColor = vec4(vColor * exp(-
|
|
199605
|
+
"default": "`#version 300 es precision highp float; in float vSide; in float vSigma; in vec3 vColor; uniform float uScale; out vec4 outColor; void main() { float d = vSide / vSigma; outColor = vec4(vColor * exp(-0.5 * d * d) * uScale, 1.0); } `",
|
|
199414
199606
|
"description": "A soft profile across the ribbon, added into the buffer."
|
|
199415
199607
|
},
|
|
199416
199608
|
{
|
|
199417
199609
|
"kind": "variable",
|
|
199418
199610
|
"name": "DUST_VERTEX",
|
|
199419
|
-
"default": "`#version 300 es uniform float uDpr; uniform float uStrands; uniform vec3 uGlow; uniform vec3 uPeak; out vec3 vColor; ${PATH} void main() { float id = float(gl_VertexID); float sid = floor(h1(id + 0.5) * uStrands); float r = h1(id + 2.3); float r2 = h1(id + 4.1); float t = mix(uT.x, uT.y, fract(r + uTime * 0.003 * (0.3 + r2))); vec3 info; vec3 a = strandAt(sid, t, info); vec2 off = (vec2(h1(id + 6.1), h1(id + 8.3)) - 0.5) * (24.0 + (150.0 + info.y * uView.x) * h1(id + 9.7)); vec2 res = uView * uDpr; vec2 px = (a.xy + off) * uDpr; gl_Position = vec4(px.x / res.x * 2.0 - 1.0, 1.0 - px.y / res.y * 2.0, 0.0, 1.0); gl_PointSize = mix(1.2, 3.4, r2 * r2) * uDpr; float tw = 0.35 + 0.65 * (0.5 + 0.5 * sin(uTime * (0.5 + 1.8 * r) + r2 * 40.0)); /* By the root of the ribbon's brightness, so specks show along a dim ribbon as well as round a bright bend. */ vColor = mix(uGlow, uPeak, 0.55) * tw * mix(0.2, 0.9, r) * sqrt(info.x) * 0.8; } `",
|
|
199611
|
+
"default": "`#version 300 es uniform float uDpr; uniform float uStrands; uniform vec3 uGlow; uniform vec3 uPeak; out vec3 vColor; ${PATH} void main() { float id = float(gl_VertexID); float sid = floor(h1(id + 0.5) * uStrands); float r = h1(id + 2.3); float r2 = h1(id + 4.1); float t = mix(uT.x, uT.y, fract(r + uTime * 0.003 * (0.3 + r2))); vec3 info; vec3 a = strandAt(sid, t, info); vec2 off = (vec2(h1(id + 6.1), h1(id + 8.3)) - 0.5) * (24.0 + (150.0 + info.y * uView.x) * h1(id + 9.7)); vec2 res = uView * uDpr; vec2 px = (a.xy + off) * uDpr; gl_Position = vec4(px.x / res.x * 2.0 - 1.0, 1.0 - px.y / res.y * 2.0, 0.0, 1.0); gl_PointSize = mix(1.2, 3.4, r2 * r2) * uDpr; float tw = 0.35 + 0.65 * (0.5 + 0.5 * sin(uTime * (0.5 + 1.8 * r) + r2 * 40.0)); /* By the root of the ribbon's brightness, so specks show along a dim ribbon as well as round a bright bend. */ vColor = mix(uGlow, uPeak, 0.55) * tw * mix(0.2, 0.9, r) * sqrt(info.x) * 0.8 * quietAt(a.xy + off); } `",
|
|
199420
199612
|
"description": "Specks drifting along the strands, thickest where the ribbon is bright."
|
|
199421
199613
|
},
|
|
199422
199614
|
{
|
|
@@ -199450,6 +199642,14 @@
|
|
|
199450
199642
|
}
|
|
199451
199643
|
],
|
|
199452
199644
|
"exports": [
|
|
199645
|
+
{
|
|
199646
|
+
"kind": "js",
|
|
199647
|
+
"name": "MAX_QUIET",
|
|
199648
|
+
"declaration": {
|
|
199649
|
+
"name": "MAX_QUIET",
|
|
199650
|
+
"module": "src/strands/shader.ts"
|
|
199651
|
+
}
|
|
199652
|
+
},
|
|
199453
199653
|
{
|
|
199454
199654
|
"kind": "js",
|
|
199455
199655
|
"name": "LINE_VERTEX",
|
|
@@ -199542,7 +199742,7 @@
|
|
|
199542
199742
|
"declarations": [
|
|
199543
199743
|
{
|
|
199544
199744
|
"kind": "class",
|
|
199545
|
-
"description": "Placed inside a `helix-strands` with `travel`, a stop names an element with\n`for` and says which form the ribbon takes when the page reaches it: a `bend`\nturning through it, a `ribbon` passing through `at`, or `waves` crossing at
|
|
199745
|
+
"description": "Placed inside a `helix-strands` with `travel`, a stop names an element with\n`for` and says which form the ribbon takes when the page reaches it: a `bend`\nturning through it, a `ribbon` passing through `at`, a `sweep` crossing in one\ndiagonal from the page's top corner on the side `at` is nearer to the\nelement's far top corner, or `waves` crossing at its top edge. The stops are\nread in page order, whatever order they are written in, and a stop naming no\nelement is skipped.\n\nA stop draws nothing itself and is never shown.\n\n**Every property is reflected**, because the parent watches its stops'\nattributes to lay the ribbon out again: a change made from script reaches the\npage as a change made in markup does. None has a default, so a stop writes\nnothing it was not given.",
|
|
199546
199746
|
"name": "HelixStrandsStop",
|
|
199547
199747
|
"members": [
|
|
199548
199748
|
{
|
|
@@ -199569,7 +199769,7 @@
|
|
|
199569
199769
|
"kind": "field",
|
|
199570
199770
|
"name": "variant",
|
|
199571
199771
|
"type": {
|
|
199572
|
-
"text": "'bend' | 'ribbon' | 'waves' | undefined"
|
|
199772
|
+
"text": "'bend' | 'ribbon' | 'sweep' | 'waves' | undefined"
|
|
199573
199773
|
},
|
|
199574
199774
|
"description": "The form the ribbon takes at the element. When it is not set, the form is `ribbon`.",
|
|
199575
199775
|
"attribute": "variant",
|
|
@@ -199935,7 +200135,7 @@
|
|
|
199935
200135
|
{
|
|
199936
200136
|
"name": "variant",
|
|
199937
200137
|
"type": {
|
|
199938
|
-
"text": "'bend' | 'ribbon' | 'waves' | undefined"
|
|
200138
|
+
"text": "'bend' | 'ribbon' | 'sweep' | 'waves' | undefined"
|
|
199939
200139
|
},
|
|
199940
200140
|
"description": "The form the ribbon takes at the element. When it is not set, the form is `ribbon`.",
|
|
199941
200141
|
"fieldName": "variant"
|
|
@@ -251371,6 +251571,6 @@
|
|
|
251371
251571
|
],
|
|
251372
251572
|
"helix": {
|
|
251373
251573
|
"package": "@fusion.dev/helix",
|
|
251374
|
-
"version": "0.
|
|
251574
|
+
"version": "0.182.0"
|
|
251375
251575
|
}
|
|
251376
251576
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createSheet } from '@fusion.dev/helix-core';
|
|
2
|
-
export const styles = createSheet(`:host {display: grid;position: relative;gap: var(--bar-chart-gap, var(--helix-space-2xs));}[part="plot"] {position: relative;block-size: var(--bar-chart-block-size, 12em);}[part="plot"] svg {block-size: 100%;inline-size: 100%;overflow: visible;}[part="baseline"] {stroke: var(--helix-color-border);stroke-width: var(--helix-border-thin);vector-effect: non-scaling-stroke;}[part~="bar"] {--_bar-chart-corners: var(--bar-chart-bar-radius, 2px) var(--bar-chart-bar-radius, 2px) 0 0;--_bar-chart-base: 0 0 calc(var(--bar-chart-bar-stroke, var(--helix-border-thick)) / 2) 0;clip-path: inset(var(--_bar-chart-foot, 0) round var(--_bar-chart-corners));fill: var(--_bar-chart-series);}:host([orientation="horizontal"]) [part~="bar"] {--_bar-chart-corners: 0 var(--bar-chart-bar-radius, 2px) var(--bar-chart-bar-radius, 2px) 0;--_bar-chart-base: 0 0 0 calc(var(--bar-chart-bar-stroke, var(--helix-border-thick)) / 2);}:host([stacked]) [part~="bar"]:not([part~="bar-end"]) {--_bar-chart-corners: 0;}:host([stacked]) [part~="bar-end"][data-end="negative"] {--_bar-chart-corners: 0 0 var(--bar-chart-bar-radius, 2px) var(--bar-chart-bar-radius, 2px);}:host([stacked][orientation="horizontal"]) [part~="bar-end"][data-end="negative"] {--_bar-chart-corners: var(--bar-chart-bar-radius, 2px) 0 0 var(--bar-chart-bar-radius, 2px);}[part="labels"] {display: grid;grid-auto-columns: 1fr;grid-auto-flow: column;}[part="label"] {color: var(--helix-color-foreground-muted);font-size: var(--helix-text-xs);overflow: hidden;text-align: center;text-overflow: ellipsis;white-space: nowrap;}:host([orientation="horizontal"]) {grid-template-columns: auto 1fr;}:host([orientation="horizontal"]) [part="labels"] {grid-column: 1;grid-row: 1;}:host([orientation="horizontal"]) [part="plot"] {grid-column: 2;grid-row: 1;}:host([orientation="horizontal"]) [part="labels"] {grid-auto-columns: auto;grid-auto-flow: row;grid-auto-rows: 1fr;}:host([orientation="horizontal"]) [part="label"] {align-self: center;text-align: end;}[part~="bar"],
|
|
3
|
-
[part="line"] {--_bar-chart-series: var(--chart-series);}[part="plot"]:has([data-active]) [part~="group"]:not([data-active]) {opacity: 0.45;}[part~="group"] {transition: opacity var(--helix-duration-fast) var(--helix-easing-decelerate);}[part~="bar"] {transition:
|
|
2
|
+
export const styles = createSheet(`:host {display: grid;position: relative;gap: var(--bar-chart-gap, var(--helix-space-2xs));}[part="plot"] {position: relative;block-size: var(--bar-chart-block-size, 12em);}[part="plot"] svg {block-size: 100%;inline-size: 100%;overflow: visible;}[part="baseline"] {stroke: var(--helix-color-border);stroke-width: var(--helix-border-thin);vector-effect: non-scaling-stroke;}[part~="bar"] {--_bar-chart-corners: var(--bar-chart-bar-radius, 2px) var(--bar-chart-bar-radius, 2px) 0 0;--_bar-chart-base: 0 0 calc(var(--bar-chart-bar-stroke, var(--helix-border-thick)) / 2) 0;clip-path: inset(var(--_bar-chart-foot, 0) round var(--_bar-chart-corners));fill: var(--_bar-chart-series);}:host([orientation="horizontal"]) [part~="bar"] {--_bar-chart-corners: 0 var(--bar-chart-bar-radius, 2px) var(--bar-chart-bar-radius, 2px) 0;--_bar-chart-base: 0 0 0 calc(var(--bar-chart-bar-stroke, var(--helix-border-thick)) / 2);}:host([stacked]) [part~="bar"]:not([part~="bar-end"]) {--_bar-chart-corners: 0;}:host([stacked]) [part~="bar-end"][data-end="negative"] {--_bar-chart-corners: 0 0 var(--bar-chart-bar-radius, 2px) var(--bar-chart-bar-radius, 2px);}:host([stacked][orientation="horizontal"]) [part~="bar-end"][data-end="negative"] {--_bar-chart-corners: var(--bar-chart-bar-radius, 2px) 0 0 var(--bar-chart-bar-radius, 2px);}[part="labels"] {display: grid;grid-auto-columns: 1fr;grid-auto-flow: column;}[part="label"] {color: var(--helix-color-foreground-muted);font-size: var(--helix-text-xs);overflow: hidden;text-align: center;text-overflow: ellipsis;white-space: nowrap;}:host([orientation="horizontal"]) {grid-template-columns: auto 1fr;}:host([orientation="horizontal"]) [part="labels"] {grid-column: 1;grid-row: 1;}:host([orientation="horizontal"]) [part="plot"] {grid-column: 2;grid-row: 1;}:host([orientation="horizontal"]) [part="labels"] {grid-auto-columns: auto;grid-auto-flow: row;grid-auto-rows: 1fr;align-self: start;block-size: var(--bar-chart-block-size, 12em);}:host([orientation="horizontal"]) [part="label"] {align-self: center;text-align: end;}[part~="bar"],
|
|
3
|
+
[part="line"] {--_bar-chart-series: var(--chart-series);}:host {--bar-chart-tone-accent: var(--helix-color-accent);--bar-chart-tone-danger: var(--helix-color-danger);--bar-chart-tone-info: var(--helix-color-info);--bar-chart-tone-muted: var(--helix-color-foreground-subtle);--bar-chart-tone-primary: var(--helix-color-primary);--bar-chart-tone-success: var(--helix-color-success);--bar-chart-tone-warning: var(--helix-color-warning);}[part="plot"]:has([data-active]) [part~="group"]:not([data-active]) {opacity: 0.45;}[part~="group"] {transition: opacity var(--helix-duration-fast) var(--helix-easing-decelerate);}[part~="bar"] {transition:
|
|
4
4
|
height var(--helix-duration-normal) var(--helix-easing-decelerate),
|
|
5
5
|
width var(--helix-duration-normal) var(--helix-easing-decelerate),
|
|
6
6
|
x var(--helix-duration-normal) var(--helix-easing-decelerate),
|
package/dist/strands/path.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* screen are all arithmetic.
|
|
8
8
|
*/
|
|
9
9
|
/** The three forms the ribbon takes. */
|
|
10
|
-
export type StrandsVariant = 'bend' | 'ribbon' | 'waves';
|
|
10
|
+
export type StrandsVariant = 'bend' | 'ribbon' | 'sweep' | 'waves';
|
|
11
11
|
/**
|
|
12
12
|
* One point on the centerline: `x` as a share of the width, `y` in CSS pixels,
|
|
13
13
|
* the ribbon's width as a share of the width, and its brightness from `0` to
|
|
@@ -27,6 +27,10 @@ export interface PlacedStop {
|
|
|
27
27
|
height: number;
|
|
28
28
|
/** The target's top, in page pixels. */
|
|
29
29
|
top: number;
|
|
30
|
+
/** The target's left edge, as a share of the width, where it is known. */
|
|
31
|
+
left?: number | undefined;
|
|
32
|
+
/** The target's right edge, as a share of the width, where it is known. */
|
|
33
|
+
right?: number | undefined;
|
|
30
34
|
variant: StrandsVariant;
|
|
31
35
|
}
|
|
32
36
|
/**
|
|
@@ -47,6 +51,33 @@ export declare const MAX_POINTS = 96;
|
|
|
47
51
|
* is meant to be one sweep. `path.pure.spec.ts` measures it on every form.
|
|
48
52
|
*/
|
|
49
53
|
export declare const TURN = 0.5;
|
|
54
|
+
/**
|
|
55
|
+
* The ribbon's width over each form's own at a `spread` of `1`, which the
|
|
56
|
+
* renderer multiplies in. Here so the path can know how far its strands reach.
|
|
57
|
+
*/
|
|
58
|
+
export declare const SPREAD = 1.35;
|
|
59
|
+
/**
|
|
60
|
+
* The shape of the ribbon down a page, each as a multiplier or a share of the
|
|
61
|
+
* width, so a page can try another without the path's arithmetic changing.
|
|
62
|
+
*/
|
|
63
|
+
export interface PathShape {
|
|
64
|
+
/** How far the ribbon swings side to side, over the most its turns allow. */
|
|
65
|
+
swing: number;
|
|
66
|
+
/** How long one S takes, over `PERIOD` screens. */
|
|
67
|
+
period: number;
|
|
68
|
+
/** How far the ribbon's axis sits from the middle, as a share of the width; positive is right. */
|
|
69
|
+
lean: number;
|
|
70
|
+
/** How far from the middle a wave's sweep lands, as a share of the width. */
|
|
71
|
+
sweep: number;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The shape a page draws unless it asks for another: calm, the ribbon
|
|
75
|
+
* swinging six tenths of the most its turns allow over S curves 2.4 screens
|
|
76
|
+
* long, resting a tenth of the width right of the middle. Compared down the
|
|
77
|
+
* whole landing page against wider, quicker, and leaning shapes, this one
|
|
78
|
+
* read as one long current rather than a ribbon zigzagging between cards.
|
|
79
|
+
*/
|
|
80
|
+
export declare const SHAPE: PathShape;
|
|
50
81
|
/**
|
|
51
82
|
* The ribbon drawn inside its own box, which is what an element without
|
|
52
83
|
* `travel` shows.
|
|
@@ -77,10 +108,28 @@ export declare const boxPath: (variant: StrandsVariant, at: number | undefined,
|
|
|
77
108
|
* @param width The viewport's width, in CSS pixels.
|
|
78
109
|
* @param height The viewport's height, in CSS pixels.
|
|
79
110
|
* @param page The page's height, in CSS pixels.
|
|
111
|
+
* @param shape The ribbon's shape down the page.
|
|
80
112
|
*/
|
|
81
|
-
export declare const pagePath: (stops: readonly PlacedStop[], fill: StrandsVariant, width: number, height: number, page: number) => PathPoint[];
|
|
113
|
+
export declare const pagePath: (stops: readonly PlacedStop[], fill: StrandsVariant, width: number, height: number, page: number, shape?: PathShape) => PathPoint[];
|
|
82
114
|
/** One coordinate of a uniform Catmull-Rom segment, the same one the shader runs. */
|
|
83
115
|
export declare const catmull: (p0: number, p1: number, p2: number, p3: number, f: number) => number;
|
|
116
|
+
/**
|
|
117
|
+
* How far along the drawn centerline each point is, in CSS pixels, for the
|
|
118
|
+
* shader to set every frequency by.
|
|
119
|
+
*
|
|
120
|
+
* **Arc length, which only grows.** The shader used the sum of a point's `y`
|
|
121
|
+
* and its `x` in pixels, which grows down a page and across a wave heading
|
|
122
|
+
* right, and runs backward wherever the path heads left faster than it heads
|
|
123
|
+
* down: on a bend's upper arm, and across a wave sweeping left. There the
|
|
124
|
+
* strands' twist and waves ran in reverse, and every strand turned a corner
|
|
125
|
+
* at the same place.
|
|
126
|
+
*
|
|
127
|
+
* Sixteen samples a segment of the same spline the shader draws.
|
|
128
|
+
*
|
|
129
|
+
* @param points The path.
|
|
130
|
+
* @param width The box's width, in CSS pixels, which `x` is a share of.
|
|
131
|
+
*/
|
|
132
|
+
export declare const arcLengths: (points: readonly PathPoint[], width: number) => Float32Array;
|
|
84
133
|
/**
|
|
85
134
|
* The centerline's `y` at even steps of its parameter, for finding which
|
|
86
135
|
* stretch is on screen.
|