@fusion.dev/helix 0.173.0 → 0.174.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 +178 -25
- package/dist/strands/palette.d.ts +1 -1
- package/dist/strands/path.d.ts +17 -6
- package/dist/strands/path.js +149 -43
- package/dist/strands/renderer.d.ts +14 -0
- package/dist/strands/renderer.js +14 -4
- package/dist/strands/root/strands-root.css.js +1 -1
- package/dist/strands/root/strands-root.d.ts +41 -10
- package/dist/strands/root/strands-root.js +32 -5
- package/dist/strands/shader.d.ts +3 -3
- package/dist/strands/shader.js +35 -12
- package/dist/strands/stop/strands-stop.d.ts +5 -5
- package/lint.json +1 -1
- package/package.json +6 -6
- package/types/jsx.d.ts +117 -45
- package/types/vue.d.ts +30 -10
package/custom-elements.json
CHANGED
|
@@ -195529,7 +195529,7 @@
|
|
|
195529
195529
|
"description": "Turns a resolved color into bytes, `undefined` where it cannot."
|
|
195530
195530
|
}
|
|
195531
195531
|
],
|
|
195532
|
-
"description": "The palette, from the colors the canvas's stylesheet resolved for it.\n\n**Carried on color properties of the canvas, which a canvas never paints**,\nthe way `Aura` carries its ramp: a custom property is handed back as the\ntext that was written, and a color property is resolved by the engine first.\nRead there, each color takes the `--strands-*` hook a page wrote anywhere\nabove the element, and the token otherwise:\n\n- `color`: `--strands-glow`, or `primary`.\n- `text-decoration-color`: `--strands-tint`, or `
|
|
195532
|
+
"description": "The palette, from the colors the canvas's stylesheet resolved for it.\n\n**Carried on color properties of the canvas, which a canvas never paints**,\nthe way `Aura` carries its ramp: a custom property is handed back as the\ntext that was written, and a color property is resolved by the engine first.\nRead there, each color takes the `--strands-*` hook a page wrote anywhere\nabove the element, and the token otherwise:\n\n- `color`: `--strands-glow`, or `primary`.\n- `text-decoration-color`: `--strands-tint`, or `accent`.\n- `outline-color`: `--strands-ground`, or the background.\n- `caret-color` and `column-rule-color`: `--strands-peak`, or the dark and\n the light page's own peak.\n\n**The ground says which way the page runs**, read from its luminance rather\nthan asked of the color mode, which is a private token this tier may not\nreach for. A dark page adds light toward a bright peak; a light page darkens\ntoward a deep one, because light added to near-white is invisible."
|
|
195533
195533
|
}
|
|
195534
195534
|
],
|
|
195535
195535
|
"exports": [
|
|
@@ -195564,6 +195564,15 @@
|
|
|
195564
195564
|
"default": "96",
|
|
195565
195565
|
"description": "The most points a path may carry, which is the length of the shader's\nuniform array.\n\nWebGL2 guarantees 256 vertex uniform vectors, and this takes 96 of them. A\npage-long ribbon spends one point per half screen, so 96 covers a page more\nthan forty screens long; a longer one keeps its first 96 points and fades."
|
|
195566
195566
|
},
|
|
195567
|
+
{
|
|
195568
|
+
"kind": "variable",
|
|
195569
|
+
"name": "TURN",
|
|
195570
|
+
"type": {
|
|
195571
|
+
"text": "number"
|
|
195572
|
+
},
|
|
195573
|
+
"default": "0.5",
|
|
195574
|
+
"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."
|
|
195575
|
+
},
|
|
195567
195576
|
{
|
|
195568
195577
|
"kind": "function",
|
|
195569
195578
|
"name": "boxPath",
|
|
@@ -195592,7 +195601,14 @@
|
|
|
195592
195601
|
"type": {
|
|
195593
195602
|
"text": "number"
|
|
195594
195603
|
},
|
|
195595
|
-
"description": "The box's height, in CSS pixels.
|
|
195604
|
+
"description": "The box's height, in CSS pixels."
|
|
195605
|
+
},
|
|
195606
|
+
{
|
|
195607
|
+
"name": "width",
|
|
195608
|
+
"type": {
|
|
195609
|
+
"text": "number"
|
|
195610
|
+
},
|
|
195611
|
+
"description": "The box's width, in CSS pixels. `x` is a share of it, and a bend's apex is drawn in pixels so it keeps its radius at any shape."
|
|
195596
195612
|
}
|
|
195597
195613
|
],
|
|
195598
195614
|
"description": "The ribbon drawn inside its own box, which is what an element without\n`travel` shows."
|
|
@@ -195642,7 +195658,7 @@
|
|
|
195642
195658
|
"description": "The page's height, in CSS pixels."
|
|
195643
195659
|
}
|
|
195644
195660
|
],
|
|
195645
|
-
"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, where it turns off
|
|
195661
|
+
"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."
|
|
195646
195662
|
},
|
|
195647
195663
|
{
|
|
195648
195664
|
"kind": "function",
|
|
@@ -195744,6 +195760,14 @@
|
|
|
195744
195760
|
"module": "src/strands/path.ts"
|
|
195745
195761
|
}
|
|
195746
195762
|
},
|
|
195763
|
+
{
|
|
195764
|
+
"kind": "js",
|
|
195765
|
+
"name": "TURN",
|
|
195766
|
+
"declaration": {
|
|
195767
|
+
"name": "TURN",
|
|
195768
|
+
"module": "src/strands/path.ts"
|
|
195769
|
+
}
|
|
195770
|
+
},
|
|
195747
195771
|
{
|
|
195748
195772
|
"kind": "js",
|
|
195749
195773
|
"name": "boxPath",
|
|
@@ -195808,6 +195832,20 @@
|
|
|
195808
195832
|
"default": "60",
|
|
195809
195833
|
"description": "The fewest, at `density` 0. Fewer stops reading as a ribbon at all."
|
|
195810
195834
|
},
|
|
195835
|
+
{
|
|
195836
|
+
"kind": "variable",
|
|
195837
|
+
"name": "DUST",
|
|
195838
|
+
"type": {
|
|
195839
|
+
"text": "number"
|
|
195840
|
+
},
|
|
195841
|
+
"default": "600",
|
|
195842
|
+
"description": "Specks of dust around the strands at a `dust` of `1`."
|
|
195843
|
+
},
|
|
195844
|
+
{
|
|
195845
|
+
"kind": "variable",
|
|
195846
|
+
"name": "MAX_DUST",
|
|
195847
|
+
"description": "The most specks a frame draws, at a `dust` of `4`."
|
|
195848
|
+
},
|
|
195811
195849
|
{
|
|
195812
195850
|
"kind": "class",
|
|
195813
195851
|
"description": "The pipeline, on one context: strands and dust added into a float buffer,\ntwo levels of bloom, and the composite over the page color.\n\n**Created whole or not at all.** `create` answers `null` when any program\nfails to link, so the element has one question to ask and one fallback to\ntake, and never draws half a pipeline.\n\n**Float buffers where the GPU offers them, and eight bits where it does not.**\nLight is added strand by strand, and a hot bend sums far past `1`; an eight\nbit buffer clips it, so there the energy is scaled down on the way in and\nback up in the composite, which keeps the bend hot at the cost of some\ngradation in the dimmest strands.",
|
|
@@ -196236,6 +196274,22 @@
|
|
|
196236
196274
|
"module": "src/strands/renderer.ts"
|
|
196237
196275
|
}
|
|
196238
196276
|
},
|
|
196277
|
+
{
|
|
196278
|
+
"kind": "js",
|
|
196279
|
+
"name": "DUST",
|
|
196280
|
+
"declaration": {
|
|
196281
|
+
"name": "DUST",
|
|
196282
|
+
"module": "src/strands/renderer.ts"
|
|
196283
|
+
}
|
|
196284
|
+
},
|
|
196285
|
+
{
|
|
196286
|
+
"kind": "js",
|
|
196287
|
+
"name": "MAX_DUST",
|
|
196288
|
+
"declaration": {
|
|
196289
|
+
"name": "MAX_DUST",
|
|
196290
|
+
"module": "src/strands/renderer.ts"
|
|
196291
|
+
}
|
|
196292
|
+
},
|
|
196239
196293
|
{
|
|
196240
196294
|
"kind": "js",
|
|
196241
196295
|
"name": "StrandsRenderer",
|
|
@@ -196272,7 +196326,7 @@
|
|
|
196272
196326
|
"declarations": [
|
|
196273
196327
|
{
|
|
196274
196328
|
"kind": "class",
|
|
196275
|
-
"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-
|
|
196329
|
+
"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**Three forms, set with `variant`.** `bend` turns bright strands through one tight point, with its\narms opening to the right. `ribbon`, the default, is a broad, soft ribbon in\nlong curves. `waves` is sharp strands crossing the full width.\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.",
|
|
196276
196330
|
"name": "HelixStrands",
|
|
196277
196331
|
"cssProperties": [
|
|
196278
196332
|
{
|
|
@@ -196288,7 +196342,7 @@
|
|
|
196288
196342
|
"name": "--strands-peak"
|
|
196289
196343
|
},
|
|
196290
196344
|
{
|
|
196291
|
-
"description": "The color of a few strands, for depth. Defaults to `--helix-color-
|
|
196345
|
+
"description": "The color of a few strands, for depth. Defaults to `--helix-color-accent`, which is the primary itself unless the theme relates an accent to the brand, as `accent: { from: 'brand', rotate: 40 }` does.",
|
|
196292
196346
|
"name": "--strands-tint"
|
|
196293
196347
|
}
|
|
196294
196348
|
],
|
|
@@ -196315,9 +196369,29 @@
|
|
|
196315
196369
|
"type": {
|
|
196316
196370
|
"text": "number | undefined"
|
|
196317
196371
|
},
|
|
196318
|
-
"description": "Where the form sits across the box, as a share of the width: the
|
|
196372
|
+
"description": "Where the form sits across the box, as a share of the width: the bend's\napex or the ribbon's axis. `0` is the left edge and `1` the right. A wave\ncrosses the whole width and does not read it. Unset, a bend's apex sits at `0.5`\nand a ribbon runs down the middle.\n\n**A share rather than a length**, so the ribbon keeps its place when the\nbox changes shape. Read inside a box only; in `travel` each stop has its\nown.",
|
|
196319
196373
|
"attribute": "at"
|
|
196320
196374
|
},
|
|
196375
|
+
{
|
|
196376
|
+
"kind": "field",
|
|
196377
|
+
"name": "bloom",
|
|
196378
|
+
"type": {
|
|
196379
|
+
"text": "number"
|
|
196380
|
+
},
|
|
196381
|
+
"default": "1",
|
|
196382
|
+
"description": "How much the glow around the strands adds, as a multiplier. `0` draws the\nstrands alone, crisp and dimmer, and `1` is the default glow.",
|
|
196383
|
+
"attribute": "bloom"
|
|
196384
|
+
},
|
|
196385
|
+
{
|
|
196386
|
+
"kind": "field",
|
|
196387
|
+
"name": "contrast",
|
|
196388
|
+
"type": {
|
|
196389
|
+
"text": "number"
|
|
196390
|
+
},
|
|
196391
|
+
"default": "1",
|
|
196392
|
+
"description": "How far apart the brightest and dimmest strands are, from `0`, most of\nthem alike, to `1`, a few burning bright over many faint ones. Clamped to\nthat range. The ribbon as a whole keeps its strength.",
|
|
196393
|
+
"attribute": "contrast"
|
|
196394
|
+
},
|
|
196321
196395
|
{
|
|
196322
196396
|
"kind": "field",
|
|
196323
196397
|
"name": "density",
|
|
@@ -196328,6 +196402,36 @@
|
|
|
196328
196402
|
"description": "How many strands the ribbon has, from `0`, sixty, to `1`, three hundred and\nforty. Clamped to that range.",
|
|
196329
196403
|
"attribute": "density"
|
|
196330
196404
|
},
|
|
196405
|
+
{
|
|
196406
|
+
"kind": "field",
|
|
196407
|
+
"name": "depth",
|
|
196408
|
+
"type": {
|
|
196409
|
+
"text": "number"
|
|
196410
|
+
},
|
|
196411
|
+
"default": "1",
|
|
196412
|
+
"description": "How much the ribbon's depth shows, from `0`, flat, to `1`. Clamped to that\nrange. The strands at the front of the ribbon's roll are drawn thicker,\nbrighter, and further from its axis, and those at the back thinner, dimmer,\nand out of focus.",
|
|
196413
|
+
"attribute": "depth"
|
|
196414
|
+
},
|
|
196415
|
+
{
|
|
196416
|
+
"kind": "field",
|
|
196417
|
+
"name": "drift",
|
|
196418
|
+
"type": {
|
|
196419
|
+
"text": "number"
|
|
196420
|
+
},
|
|
196421
|
+
"default": "1",
|
|
196422
|
+
"description": "How differently each strand moves, from `0`, the whole ribbon rolling and\nwaving as one, to `1`, each strand at its own pace and angle, crossing\nover the others. Clamped to that range.",
|
|
196423
|
+
"attribute": "drift"
|
|
196424
|
+
},
|
|
196425
|
+
{
|
|
196426
|
+
"kind": "field",
|
|
196427
|
+
"name": "dust",
|
|
196428
|
+
"type": {
|
|
196429
|
+
"text": "number"
|
|
196430
|
+
},
|
|
196431
|
+
"default": "1",
|
|
196432
|
+
"description": "How many specks of dust drift around the strands, as a multiplier: `0`\ndraws none, `1` six hundred, and `4`, the most, two thousand four\nhundred. They gather where the ribbon is brightest.",
|
|
196433
|
+
"attribute": "dust"
|
|
196434
|
+
},
|
|
196331
196435
|
{
|
|
196332
196436
|
"kind": "field",
|
|
196333
196437
|
"name": "gain",
|
|
@@ -196344,8 +196448,8 @@
|
|
|
196344
196448
|
"type": {
|
|
196345
196449
|
"text": "number"
|
|
196346
196450
|
},
|
|
196347
|
-
"default": "0
|
|
196348
|
-
"description": "The share of strands drawn out of focus where the ribbon is wide, from `0`,\nevery strand sharp, to `1`, every one soft. Clamped to that range. A tight\nform, such as a
|
|
196451
|
+
"default": "0",
|
|
196452
|
+
"description": "The share of strands drawn out of focus where the ribbon is wide, from `0`,\nevery strand sharp, to `1`, every one soft. Clamped to that range. A tight\nform, such as a bend's apex or a wave, stays sharp whatever this says.",
|
|
196349
196453
|
"attribute": "softness"
|
|
196350
196454
|
},
|
|
196351
196455
|
{
|
|
@@ -196383,7 +196487,7 @@
|
|
|
196383
196487
|
"kind": "field",
|
|
196384
196488
|
"name": "variant",
|
|
196385
196489
|
"type": {
|
|
196386
|
-
"text": "'
|
|
196490
|
+
"text": "'bend' | 'ribbon' | 'waves' | undefined"
|
|
196387
196491
|
},
|
|
196388
196492
|
"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.",
|
|
196389
196493
|
"attribute": "variant"
|
|
@@ -197217,9 +197321,27 @@
|
|
|
197217
197321
|
"type": {
|
|
197218
197322
|
"text": "number | undefined"
|
|
197219
197323
|
},
|
|
197220
|
-
"description": "Where the form sits across the box, as a share of the width: the
|
|
197324
|
+
"description": "Where the form sits across the box, as a share of the width: the bend's\napex or the ribbon's axis. `0` is the left edge and `1` the right. A wave\ncrosses the whole width and does not read it. Unset, a bend's apex sits at `0.5`\nand a ribbon runs down the middle.\n\n**A share rather than a length**, so the ribbon keeps its place when the\nbox changes shape. Read inside a box only; in `travel` each stop has its\nown.",
|
|
197221
197325
|
"fieldName": "at"
|
|
197222
197326
|
},
|
|
197327
|
+
{
|
|
197328
|
+
"name": "bloom",
|
|
197329
|
+
"type": {
|
|
197330
|
+
"text": "number"
|
|
197331
|
+
},
|
|
197332
|
+
"default": "1",
|
|
197333
|
+
"description": "How much the glow around the strands adds, as a multiplier. `0` draws the\nstrands alone, crisp and dimmer, and `1` is the default glow.",
|
|
197334
|
+
"fieldName": "bloom"
|
|
197335
|
+
},
|
|
197336
|
+
{
|
|
197337
|
+
"name": "contrast",
|
|
197338
|
+
"type": {
|
|
197339
|
+
"text": "number"
|
|
197340
|
+
},
|
|
197341
|
+
"default": "1",
|
|
197342
|
+
"description": "How far apart the brightest and dimmest strands are, from `0`, most of\nthem alike, to `1`, a few burning bright over many faint ones. Clamped to\nthat range. The ribbon as a whole keeps its strength.",
|
|
197343
|
+
"fieldName": "contrast"
|
|
197344
|
+
},
|
|
197223
197345
|
{
|
|
197224
197346
|
"name": "density",
|
|
197225
197347
|
"type": {
|
|
@@ -197229,6 +197351,33 @@
|
|
|
197229
197351
|
"description": "How many strands the ribbon has, from `0`, sixty, to `1`, three hundred and\nforty. Clamped to that range.",
|
|
197230
197352
|
"fieldName": "density"
|
|
197231
197353
|
},
|
|
197354
|
+
{
|
|
197355
|
+
"name": "depth",
|
|
197356
|
+
"type": {
|
|
197357
|
+
"text": "number"
|
|
197358
|
+
},
|
|
197359
|
+
"default": "1",
|
|
197360
|
+
"description": "How much the ribbon's depth shows, from `0`, flat, to `1`. Clamped to that\nrange. The strands at the front of the ribbon's roll are drawn thicker,\nbrighter, and further from its axis, and those at the back thinner, dimmer,\nand out of focus.",
|
|
197361
|
+
"fieldName": "depth"
|
|
197362
|
+
},
|
|
197363
|
+
{
|
|
197364
|
+
"name": "drift",
|
|
197365
|
+
"type": {
|
|
197366
|
+
"text": "number"
|
|
197367
|
+
},
|
|
197368
|
+
"default": "1",
|
|
197369
|
+
"description": "How differently each strand moves, from `0`, the whole ribbon rolling and\nwaving as one, to `1`, each strand at its own pace and angle, crossing\nover the others. Clamped to that range.",
|
|
197370
|
+
"fieldName": "drift"
|
|
197371
|
+
},
|
|
197372
|
+
{
|
|
197373
|
+
"name": "dust",
|
|
197374
|
+
"type": {
|
|
197375
|
+
"text": "number"
|
|
197376
|
+
},
|
|
197377
|
+
"default": "1",
|
|
197378
|
+
"description": "How many specks of dust drift around the strands, as a multiplier: `0`\ndraws none, `1` six hundred, and `4`, the most, two thousand four\nhundred. They gather where the ribbon is brightest.",
|
|
197379
|
+
"fieldName": "dust"
|
|
197380
|
+
},
|
|
197232
197381
|
{
|
|
197233
197382
|
"name": "gain",
|
|
197234
197383
|
"type": {
|
|
@@ -197243,8 +197392,8 @@
|
|
|
197243
197392
|
"type": {
|
|
197244
197393
|
"text": "number"
|
|
197245
197394
|
},
|
|
197246
|
-
"default": "0
|
|
197247
|
-
"description": "The share of strands drawn out of focus where the ribbon is wide, from `0`,\nevery strand sharp, to `1`, every one soft. Clamped to that range. A tight\nform, such as a
|
|
197395
|
+
"default": "0",
|
|
197396
|
+
"description": "The share of strands drawn out of focus where the ribbon is wide, from `0`,\nevery strand sharp, to `1`, every one soft. Clamped to that range. A tight\nform, such as a bend's apex or a wave, stays sharp whatever this says.",
|
|
197248
197397
|
"fieldName": "softness"
|
|
197249
197398
|
},
|
|
197250
197399
|
{
|
|
@@ -197277,7 +197426,7 @@
|
|
|
197277
197426
|
{
|
|
197278
197427
|
"name": "variant",
|
|
197279
197428
|
"type": {
|
|
197280
|
-
"text": "'
|
|
197429
|
+
"text": "'bend' | 'ribbon' | 'waves' | undefined"
|
|
197281
197430
|
},
|
|
197282
197431
|
"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.",
|
|
197283
197432
|
"fieldName": "variant"
|
|
@@ -197322,7 +197471,7 @@
|
|
|
197322
197471
|
"slug": "preview"
|
|
197323
197472
|
},
|
|
197324
197473
|
{
|
|
197325
|
-
"description": "A
|
|
197474
|
+
"description": "A bend turning at a quarter of the width, and another at three quarters.",
|
|
197326
197475
|
"slug": "at"
|
|
197327
197476
|
},
|
|
197328
197477
|
{
|
|
@@ -197334,11 +197483,15 @@
|
|
|
197334
197483
|
"slug": "density-and-softness"
|
|
197335
197484
|
},
|
|
197336
197485
|
{
|
|
197337
|
-
"description": "
|
|
197486
|
+
"description": "A flat ribbon that moves as one beside the default, deep one, whose strands each move their own way.",
|
|
197487
|
+
"slug": "depth-and-motion"
|
|
197488
|
+
},
|
|
197489
|
+
{
|
|
197490
|
+
"description": "One ribbon down the whole page: a bend through the opening section, soft ribbon after it, and a wave above the last section.",
|
|
197338
197491
|
"slug": "travel"
|
|
197339
197492
|
},
|
|
197340
197493
|
{
|
|
197341
|
-
"description": "The three forms: a bright
|
|
197494
|
+
"description": "The three forms: a bright bend, a soft ribbon, and sharp waves.",
|
|
197342
197495
|
"slug": "variants"
|
|
197343
197496
|
}
|
|
197344
197497
|
],
|
|
@@ -197376,7 +197529,7 @@
|
|
|
197376
197529
|
{
|
|
197377
197530
|
"kind": "variable",
|
|
197378
197531
|
"name": "LINE_VERTEX",
|
|
197379
|
-
"default": "`#version 300 es layout(location = 0) in vec2 aVert; layout(location = 1) in float aId; uniform float uDpr; uniform float uSoftness; 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); float base = mix(0.35, 1.3, r7 * r7) * uDpr * (1.0 + 0.3 * a.z); float w = max(base + soft * mix(8.0, 36.0, r6) * uDpr, 1.0); float drawW = w + 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 / w; float shimmer = 0.5 + 0.5 * sin(info.z * 0.044 - uTime * (2.0 + 2.0 * r5) + r6 * 6.283); shimmer *= shimmer; float
|
|
197532
|
+
"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) * 10.0 * uDpr; float w = max(base + soft * mix(8.0, 36.0, r6) * uDpr + focus, 1.0); float drawW = w + 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 / w; float shimmer = 0.5 + 0.5 * sin(info.z * 0.044 - uTime * (2.0 + 2.0 * r5) + r6 * 6.283); shimmer *= shimmer; /* 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.25, 0.04, 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; } `",
|
|
197380
197533
|
"description": "Each strand as a ribbon of quads, wide enough to anti-alias and to blur."
|
|
197381
197534
|
},
|
|
197382
197535
|
{
|
|
@@ -197388,7 +197541,7 @@
|
|
|
197388
197541
|
{
|
|
197389
197542
|
"kind": "variable",
|
|
197390
197543
|
"name": "DUST_VERTEX",
|
|
197391
|
-
"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)); vColor = mix(uGlow, uPeak, 0.55) * tw * mix(0.2, 0.9, r) * info.x * 0.8; } `",
|
|
197544
|
+
"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; } `",
|
|
197392
197545
|
"description": "Specks drifting along the strands, thickest where the ribbon is bright."
|
|
197393
197546
|
},
|
|
197394
197547
|
{
|
|
@@ -197417,7 +197570,7 @@
|
|
|
197417
197570
|
{
|
|
197418
197571
|
"kind": "variable",
|
|
197419
197572
|
"name": "COMPOSITE_FRAGMENT",
|
|
197420
|
-
"default": "`#version 300 es precision highp float; in vec2 vUv; uniform sampler2D uScene; uniform sampler2D uNear; uniform sampler2D uFar; uniform vec3 uGround; uniform vec3 uInk; uniform float uLight; uniform float uGain; out vec4 outColor; float hash(vec2 p) { return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453); } void main() { vec3 e = texture(uScene, vUv).rgb + texture(uNear, vUv).rgb * 1.1 + texture(uFar, vUv).rgb * 0.9; e *= uGain; vec3 dark = 1.0 - (1.0 - uGround) * exp(-e); float lum = dot(e, vec3(0.3, 0.55, 0.15)); vec3 light = mix(uGround, uInk, 1.0 - exp(-lum * 1.4)); vec3 c = mix(dark, light, uLight); c += (hash(gl_FragCoord.xy) - 0.5) / 255.0; outColor = vec4(c, 1.0); } `",
|
|
197573
|
+
"default": "`#version 300 es precision highp float; in vec2 vUv; uniform sampler2D uScene; uniform sampler2D uNear; uniform sampler2D uFar; uniform vec3 uGround; uniform vec3 uInk; uniform float uLight; uniform float uGain; uniform float uBloom; out vec4 outColor; float hash(vec2 p) { return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453); } void main() { vec3 e = texture(uScene, vUv).rgb + (texture(uNear, vUv).rgb * 1.1 + texture(uFar, vUv).rgb * 0.9) * uBloom; e *= uGain; vec3 dark = 1.0 - (1.0 - uGround) * exp(-e); float lum = dot(e, vec3(0.3, 0.55, 0.15)); vec3 light = mix(uGround, uInk, 1.0 - exp(-lum * 1.4)); vec3 c = mix(dark, light, uLight); c += (hash(gl_FragCoord.xy) - 0.5) / 255.0; outColor = vec4(c, 1.0); } `",
|
|
197421
197574
|
"description": "The light and its bloom over the page color.\n\nOn a dark page the light is screened onto the ground, so it saturates to\nthe peak rather than clipping. On a light page added light is invisible, so\nthe same energy darkens the ground toward the peak as ink. A step of noise\nunder a code value hides the banding a slow gradient shows on eight bits."
|
|
197422
197575
|
}
|
|
197423
197576
|
],
|
|
@@ -197514,7 +197667,7 @@
|
|
|
197514
197667
|
"declarations": [
|
|
197515
197668
|
{
|
|
197516
197669
|
"kind": "class",
|
|
197517
|
-
"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 `
|
|
197670
|
+
"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\nits top edge. The stops are read in page order, whatever order they are\nwritten in, and a stop naming no element 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.",
|
|
197518
197671
|
"name": "HelixStrandsStop",
|
|
197519
197672
|
"members": [
|
|
197520
197673
|
{
|
|
@@ -197523,7 +197676,7 @@
|
|
|
197523
197676
|
"type": {
|
|
197524
197677
|
"text": "number | undefined"
|
|
197525
197678
|
},
|
|
197526
|
-
"description": "Where the form sits across the page, as a share of the width: the
|
|
197679
|
+
"description": "Where the form sits across the page, as a share of the width: the bend's\napex or the ribbon's axis. A wave crosses the whole width and does not\nread it. Unset, a bend's apex sits at `0.5` and a ribbon runs down the middle.",
|
|
197527
197680
|
"attribute": "at",
|
|
197528
197681
|
"reflects": true
|
|
197529
197682
|
},
|
|
@@ -197541,7 +197694,7 @@
|
|
|
197541
197694
|
"kind": "field",
|
|
197542
197695
|
"name": "variant",
|
|
197543
197696
|
"type": {
|
|
197544
|
-
"text": "'
|
|
197697
|
+
"text": "'bend' | 'ribbon' | 'waves' | undefined"
|
|
197545
197698
|
},
|
|
197546
197699
|
"description": "The form the ribbon takes at the element. When it is not set, the form is `ribbon`.",
|
|
197547
197700
|
"attribute": "variant",
|
|
@@ -197893,7 +198046,7 @@
|
|
|
197893
198046
|
"type": {
|
|
197894
198047
|
"text": "number | undefined"
|
|
197895
198048
|
},
|
|
197896
|
-
"description": "Where the form sits across the page, as a share of the width: the
|
|
198049
|
+
"description": "Where the form sits across the page, as a share of the width: the bend's\napex or the ribbon's axis. A wave crosses the whole width and does not\nread it. Unset, a bend's apex sits at `0.5` and a ribbon runs down the middle.",
|
|
197897
198050
|
"fieldName": "at"
|
|
197898
198051
|
},
|
|
197899
198052
|
{
|
|
@@ -197907,7 +198060,7 @@
|
|
|
197907
198060
|
{
|
|
197908
198061
|
"name": "variant",
|
|
197909
198062
|
"type": {
|
|
197910
|
-
"text": "'
|
|
198063
|
+
"text": "'bend' | 'ribbon' | 'waves' | undefined"
|
|
197911
198064
|
},
|
|
197912
198065
|
"description": "The form the ribbon takes at the element. When it is not set, the form is `ribbon`.",
|
|
197913
198066
|
"fieldName": "variant"
|
|
@@ -249123,6 +249276,6 @@
|
|
|
249123
249276
|
],
|
|
249124
249277
|
"helix": {
|
|
249125
249278
|
"package": "@fusion.dev/helix",
|
|
249126
|
-
"version": "0.
|
|
249279
|
+
"version": "0.174.0"
|
|
249127
249280
|
}
|
|
249128
249281
|
}
|
|
@@ -26,7 +26,7 @@ export declare const RESTING_PALETTE: StrandsPalette;
|
|
|
26
26
|
* above the element, and the token otherwise:
|
|
27
27
|
*
|
|
28
28
|
* - `color`: `--strands-glow`, or `primary`.
|
|
29
|
-
* - `text-decoration-color`: `--strands-tint`, or `
|
|
29
|
+
* - `text-decoration-color`: `--strands-tint`, or `accent`.
|
|
30
30
|
* - `outline-color`: `--strands-ground`, or the background.
|
|
31
31
|
* - `caret-color` and `column-rule-color`: `--strands-peak`, or the dark and
|
|
32
32
|
* the light page's own peak.
|
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 = '
|
|
10
|
+
export type StrandsVariant = 'bend' | 'ribbon' | '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
|
|
@@ -38,6 +38,15 @@ export interface PlacedStop {
|
|
|
38
38
|
* than forty screens long; a longer one keeps its first 96 points and fades.
|
|
39
39
|
*/
|
|
40
40
|
export declare const MAX_POINTS = 96;
|
|
41
|
+
/**
|
|
42
|
+
* The tightest any form turns, as a share of the box's height: the radius of
|
|
43
|
+
* its sharpest curve.
|
|
44
|
+
*
|
|
45
|
+
* Half the height. A bend's apex a few dozen pixels round kinked the strands
|
|
46
|
+
* that ran along its inside, and read as a fold in the light where every form
|
|
47
|
+
* is meant to be one sweep. `path.pure.spec.ts` measures it on every form.
|
|
48
|
+
*/
|
|
49
|
+
export declare const TURN = 0.5;
|
|
41
50
|
/**
|
|
42
51
|
* The ribbon drawn inside its own box, which is what an element without
|
|
43
52
|
* `travel` shows.
|
|
@@ -45,18 +54,20 @@ export declare const MAX_POINTS = 96;
|
|
|
45
54
|
* @param variant The form to draw.
|
|
46
55
|
* @param at Where it sits across the box, as a share of the width. A wave
|
|
47
56
|
* crosses the whole width and does not read it.
|
|
48
|
-
* @param height The box's height, in CSS pixels.
|
|
49
|
-
*
|
|
57
|
+
* @param height The box's height, in CSS pixels.
|
|
58
|
+
* @param width The box's width, in CSS pixels. `x` is a share of it, and a
|
|
59
|
+
* bend's apex is drawn in pixels so it keeps its radius at any shape.
|
|
50
60
|
*/
|
|
51
|
-
export declare const boxPath: (variant: StrandsVariant, at: number | undefined, height: number) => PathPoint[];
|
|
61
|
+
export declare const boxPath: (variant: StrandsVariant, at: number | undefined, height: number, width: number) => PathPoint[];
|
|
52
62
|
/**
|
|
53
63
|
* The ribbon laid down a whole page, which is what an element with `travel`
|
|
54
64
|
* shows.
|
|
55
65
|
*
|
|
56
66
|
* Each stop places its form at its target, in page order. Between two stops
|
|
57
67
|
* the ribbon fills the gap with soft S-curves in `fill`'s place, except
|
|
58
|
-
* between two waves
|
|
59
|
-
*
|
|
68
|
+
* between two waves less than a screen and a half apart, where it turns off
|
|
69
|
+
* screen so each wave reads alone.
|
|
70
|
+
* Without stops, `fill` runs the length of the page: a bend opens the page and
|
|
60
71
|
* a ribbon follows it, waves cross every screen and a third, and a ribbon
|
|
61
72
|
* meanders the whole way. After a last wave the ribbon does not come back, so
|
|
62
73
|
* the page ends on the wave.
|