@fusion.dev/helix 0.0.0-dev
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/LICENSE +21 -0
- package/custom-elements.json +99157 -0
- package/dist/accordion/index.d.ts +2 -0
- package/dist/accordion/index.js +2 -0
- package/dist/accordion/item/accordion-item.css.d.ts +1 -0
- package/dist/accordion/item/accordion-item.css.js +92 -0
- package/dist/accordion/item/accordion-item.d.ts +39 -0
- package/dist/accordion/item/accordion-item.js +45 -0
- package/dist/accordion/root/accordion-root.css.d.ts +1 -0
- package/dist/accordion/root/accordion-root.css.js +25 -0
- package/dist/accordion/root/accordion-root.d.ts +49 -0
- package/dist/accordion/root/accordion-root.js +40 -0
- package/dist/announcement/index.d.ts +1 -0
- package/dist/announcement/index.js +1 -0
- package/dist/announcement/root/announcement-root.css.d.ts +1 -0
- package/dist/announcement/root/announcement-root.css.js +145 -0
- package/dist/announcement/root/announcement-root.d.ts +26 -0
- package/dist/announcement/root/announcement-root.js +32 -0
- package/dist/app-header/index.d.ts +1 -0
- package/dist/app-header/index.js +1 -0
- package/dist/app-header/root/app-header-root.css.d.ts +1 -0
- package/dist/app-header/root/app-header-root.css.js +112 -0
- package/dist/app-header/root/app-header-root.d.ts +103 -0
- package/dist/app-header/root/app-header-root.js +72 -0
- package/dist/aura/index.d.ts +1 -0
- package/dist/aura/index.js +1 -0
- package/dist/aura/root/aura-axis.d.ts +61 -0
- package/dist/aura/root/aura-axis.js +68 -0
- package/dist/aura/root/aura-root.css.d.ts +1 -0
- package/dist/aura/root/aura-root.css.js +35 -0
- package/dist/aura/root/aura-root.d.ts +447 -0
- package/dist/aura/root/aura-root.js +1024 -0
- package/dist/aura/root/aura-shader.d.ts +46 -0
- package/dist/aura/root/aura-shader.js +1145 -0
- package/dist/avatar/group/avatar-group.css.d.ts +1 -0
- package/dist/avatar/group/avatar-group.css.js +48 -0
- package/dist/avatar/group/avatar-group.d.ts +34 -0
- package/dist/avatar/group/avatar-group.js +40 -0
- package/dist/avatar/index.d.ts +2 -0
- package/dist/avatar/index.js +2 -0
- package/dist/avatar/root/avatar-root.css.d.ts +1 -0
- package/dist/avatar/root/avatar-root.css.js +55 -0
- package/dist/avatar/root/avatar-root.d.ts +41 -0
- package/dist/avatar/root/avatar-root.js +46 -0
- package/dist/badge/index.d.ts +1 -0
- package/dist/badge/index.js +1 -0
- package/dist/badge/root/badge-root.css.d.ts +1 -0
- package/dist/badge/root/badge-root.css.js +91 -0
- package/dist/badge/root/badge-root.d.ts +38 -0
- package/dist/badge/root/badge-root.js +38 -0
- package/dist/bar-chart/index.d.ts +1 -0
- package/dist/bar-chart/index.js +1 -0
- package/dist/bar-chart/root/bar-chart-root.css.d.ts +1 -0
- package/dist/bar-chart/root/bar-chart-root.css.js +445 -0
- package/dist/bar-chart/root/bar-chart-root.d.ts +177 -0
- package/dist/bar-chart/root/bar-chart-root.js +122 -0
- package/dist/blockquote/index.d.ts +1 -0
- package/dist/blockquote/index.js +1 -0
- package/dist/blockquote/root/blockquote-root.css.d.ts +1 -0
- package/dist/blockquote/root/blockquote-root.css.js +42 -0
- package/dist/blockquote/root/blockquote-root.d.ts +27 -0
- package/dist/blockquote/root/blockquote-root.js +33 -0
- package/dist/breadcrumbs/breadcrumb/breadcrumb.css.d.ts +1 -0
- package/dist/breadcrumbs/breadcrumb/breadcrumb.css.js +109 -0
- package/dist/breadcrumbs/breadcrumb/breadcrumb.d.ts +38 -0
- package/dist/breadcrumbs/breadcrumb/breadcrumb.js +44 -0
- package/dist/breadcrumbs/index.d.ts +2 -0
- package/dist/breadcrumbs/index.js +2 -0
- package/dist/breadcrumbs/root/breadcrumbs-root.css.d.ts +1 -0
- package/dist/breadcrumbs/root/breadcrumbs-root.css.js +23 -0
- package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +29 -0
- package/dist/breadcrumbs/root/breadcrumbs-root.js +35 -0
- package/dist/button/index.d.ts +1 -0
- package/dist/button/index.js +1 -0
- package/dist/button/root/button-root.css.d.ts +1 -0
- package/dist/button/root/button-root.css.js +190 -0
- package/dist/button/root/button-root.d.ts +95 -0
- package/dist/button/root/button-root.js +59 -0
- package/dist/button-group/index.d.ts +1 -0
- package/dist/button-group/index.js +1 -0
- package/dist/button-group/root/button-group-root.css.d.ts +1 -0
- package/dist/button-group/root/button-group-root.css.js +54 -0
- package/dist/button-group/root/button-group-root.d.ts +48 -0
- package/dist/button-group/root/button-group-root.js +44 -0
- package/dist/callout/index.d.ts +1 -0
- package/dist/callout/index.js +1 -0
- package/dist/callout/root/callout-root.css.d.ts +1 -0
- package/dist/callout/root/callout-root.css.js +82 -0
- package/dist/callout/root/callout-root.d.ts +36 -0
- package/dist/callout/root/callout-root.js +42 -0
- package/dist/card/index.d.ts +1 -0
- package/dist/card/index.js +1 -0
- package/dist/card/root/card-root.css.d.ts +1 -0
- package/dist/card/root/card-root.css.js +111 -0
- package/dist/card/root/card-root.d.ts +120 -0
- package/dist/card/root/card-root.js +74 -0
- package/dist/carousel/index.d.ts +1 -0
- package/dist/carousel/index.js +1 -0
- package/dist/carousel/root/carousel-root.css.d.ts +1 -0
- package/dist/carousel/root/carousel-root.css.js +347 -0
- package/dist/carousel/root/carousel-root.d.ts +111 -0
- package/dist/carousel/root/carousel-root.js +53 -0
- package/dist/chat/composer/chat-composer.css.d.ts +1 -0
- package/dist/chat/composer/chat-composer.css.js +103 -0
- package/dist/chat/composer/chat-composer.d.ts +37 -0
- package/dist/chat/composer/chat-composer.js +43 -0
- package/dist/chat/index.d.ts +3 -0
- package/dist/chat/index.js +3 -0
- package/dist/chat/message/chat-message.css.d.ts +1 -0
- package/dist/chat/message/chat-message.css.js +270 -0
- package/dist/chat/message/chat-message.d.ts +66 -0
- package/dist/chat/message/chat-message.js +50 -0
- package/dist/chat/root/chat-root.css.d.ts +1 -0
- package/dist/chat/root/chat-root.css.js +134 -0
- package/dist/chat/root/chat-root.d.ts +51 -0
- package/dist/chat/root/chat-root.js +57 -0
- package/dist/checkbox/index.d.ts +1 -0
- package/dist/checkbox/index.js +1 -0
- package/dist/checkbox/root/checkbox-root.css.d.ts +1 -0
- package/dist/checkbox/root/checkbox-root.css.js +177 -0
- package/dist/checkbox/root/checkbox-root.d.ts +51 -0
- package/dist/checkbox/root/checkbox-root.js +48 -0
- package/dist/checkbox-group/index.d.ts +1 -0
- package/dist/checkbox-group/index.js +1 -0
- package/dist/checkbox-group/root/checkbox-group-root.css.d.ts +1 -0
- package/dist/checkbox-group/root/checkbox-group-root.css.js +30 -0
- package/dist/checkbox-group/root/checkbox-group-root.d.ts +29 -0
- package/dist/checkbox-group/root/checkbox-group-root.js +37 -0
- package/dist/code/index.d.ts +1 -0
- package/dist/code/index.js +1 -0
- package/dist/code/root/code-root.css.d.ts +1 -0
- package/dist/code/root/code-root.css.js +30 -0
- package/dist/code/root/code-root.d.ts +27 -0
- package/dist/code/root/code-root.js +33 -0
- package/dist/code-block/index.d.ts +1 -0
- package/dist/code-block/index.js +1 -0
- package/dist/code-block/root/code-block-root.css.d.ts +1 -0
- package/dist/code-block/root/code-block-root.css.js +84 -0
- package/dist/code-block/root/code-block-root.d.ts +31 -0
- package/dist/code-block/root/code-block-root.js +37 -0
- package/dist/color-input/index.d.ts +1 -0
- package/dist/color-input/index.js +1 -0
- package/dist/color-input/root/color-input-root.css.d.ts +1 -0
- package/dist/color-input/root/color-input-root.css.js +193 -0
- package/dist/color-input/root/color-input-root.d.ts +50 -0
- package/dist/color-input/root/color-input-root.js +62 -0
- package/dist/color-picker/index.d.ts +1 -0
- package/dist/color-picker/index.js +1 -0
- package/dist/color-picker/root/color-picker-root.css.d.ts +1 -0
- package/dist/color-picker/root/color-picker-root.css.js +282 -0
- package/dist/color-picker/root/color-picker-root.d.ts +53 -0
- package/dist/color-picker/root/color-picker-root.js +64 -0
- package/dist/combobox/index.d.ts +1 -0
- package/dist/combobox/index.js +1 -0
- package/dist/combobox/root/combobox-root.css.d.ts +1 -0
- package/dist/combobox/root/combobox-root.css.js +249 -0
- package/dist/combobox/root/combobox-root.d.ts +37 -0
- package/dist/combobox/root/combobox-root.js +49 -0
- package/dist/command/index.d.ts +1 -0
- package/dist/command/index.js +1 -0
- package/dist/command/root/command-root.css.d.ts +1 -0
- package/dist/command/root/command-root.css.js +76 -0
- package/dist/command/root/command-root.d.ts +31 -0
- package/dist/command/root/command-root.js +40 -0
- package/dist/copy-button/index.d.ts +1 -0
- package/dist/copy-button/index.js +1 -0
- package/dist/copy-button/root/copy-button-root.css.d.ts +1 -0
- package/dist/copy-button/root/copy-button-root.css.js +37 -0
- package/dist/copy-button/root/copy-button-root.d.ts +28 -0
- package/dist/copy-button/root/copy-button-root.js +34 -0
- package/dist/data-table/index.d.ts +1 -0
- package/dist/data-table/index.js +1 -0
- package/dist/data-table/root/data-table-root.css.d.ts +1 -0
- package/dist/data-table/root/data-table-root.css.js +91 -0
- package/dist/data-table/root/data-table-root.d.ts +49 -0
- package/dist/data-table/root/data-table-root.js +55 -0
- package/dist/date-input/index.d.ts +1 -0
- package/dist/date-input/index.js +1 -0
- package/dist/date-input/root/date-input-root.css.d.ts +1 -0
- package/dist/date-input/root/date-input-root.css.js +172 -0
- package/dist/date-input/root/date-input-root.d.ts +44 -0
- package/dist/date-input/root/date-input-root.js +59 -0
- package/dist/date-picker/index.d.ts +1 -0
- package/dist/date-picker/index.js +1 -0
- package/dist/date-picker/root/date-picker-root.css.d.ts +1 -0
- package/dist/date-picker/root/date-picker-root.css.js +219 -0
- package/dist/date-picker/root/date-picker-root.d.ts +38 -0
- package/dist/date-picker/root/date-picker-root.js +44 -0
- package/dist/dialog/index.d.ts +1 -0
- package/dist/dialog/index.js +1 -0
- package/dist/dialog/root/dialog-root.css.d.ts +1 -0
- package/dist/dialog/root/dialog-root.css.js +184 -0
- package/dist/dialog/root/dialog-root.d.ts +81 -0
- package/dist/dialog/root/dialog-root.js +54 -0
- package/dist/divider/index.d.ts +1 -0
- package/dist/divider/index.js +1 -0
- package/dist/divider/root/divider-root.css.d.ts +1 -0
- package/dist/divider/root/divider-root.css.js +82 -0
- package/dist/divider/root/divider-root.d.ts +34 -0
- package/dist/divider/root/divider-root.js +40 -0
- package/dist/donut-chart/index.d.ts +1 -0
- package/dist/donut-chart/index.js +1 -0
- package/dist/donut-chart/root/donut-chart-root.css.d.ts +1 -0
- package/dist/donut-chart/root/donut-chart-root.css.js +326 -0
- package/dist/donut-chart/root/donut-chart-root.d.ts +111 -0
- package/dist/donut-chart/root/donut-chart-root.js +76 -0
- package/dist/drawer/index.d.ts +1 -0
- package/dist/drawer/index.js +1 -0
- package/dist/drawer/root/drawer-root.css.d.ts +1 -0
- package/dist/drawer/root/drawer-root.css.js +151 -0
- package/dist/drawer/root/drawer-root.d.ts +69 -0
- package/dist/drawer/root/drawer-root.js +58 -0
- package/dist/drilldown/index.d.ts +2 -0
- package/dist/drilldown/index.js +2 -0
- package/dist/drilldown/item/drilldown-item.css.d.ts +1 -0
- package/dist/drilldown/item/drilldown-item.css.js +47 -0
- package/dist/drilldown/item/drilldown-item.d.ts +25 -0
- package/dist/drilldown/item/drilldown-item.js +31 -0
- package/dist/drilldown/root/drilldown-root.css.d.ts +1 -0
- package/dist/drilldown/root/drilldown-root.css.js +125 -0
- package/dist/drilldown/root/drilldown-root.d.ts +33 -0
- package/dist/drilldown/root/drilldown-root.js +39 -0
- package/dist/element-events.generated.d.ts +1 -0
- package/dist/element-events.generated.js +123 -0
- package/dist/empty/index.d.ts +1 -0
- package/dist/empty/index.js +1 -0
- package/dist/empty/root/empty-root.css.d.ts +1 -0
- package/dist/empty/root/empty-root.css.js +45 -0
- package/dist/empty/root/empty-root.d.ts +26 -0
- package/dist/empty/root/empty-root.js +32 -0
- package/dist/file-input/index.d.ts +1 -0
- package/dist/file-input/index.js +1 -0
- package/dist/file-input/root/file-input-root.css.d.ts +1 -0
- package/dist/file-input/root/file-input-root.css.js +194 -0
- package/dist/file-input/root/file-input-root.d.ts +40 -0
- package/dist/file-input/root/file-input-root.js +53 -0
- package/dist/flex/index.d.ts +1 -0
- package/dist/flex/index.js +1 -0
- package/dist/flex/root/flex-root.css.d.ts +1 -0
- package/dist/flex/root/flex-root.css.js +81 -0
- package/dist/flex/root/flex-root.d.ts +61 -0
- package/dist/flex/root/flex-root.js +75 -0
- package/dist/format-date/index.d.ts +1 -0
- package/dist/format-date/index.js +1 -0
- package/dist/format-date/root/format-date-root.css.d.ts +1 -0
- package/dist/format-date/root/format-date-root.css.js +15 -0
- package/dist/format-date/root/format-date-root.d.ts +28 -0
- package/dist/format-date/root/format-date-root.js +34 -0
- package/dist/grid/index.d.ts +1 -0
- package/dist/grid/index.js +1 -0
- package/dist/grid/root/grid-root.css.d.ts +1 -0
- package/dist/grid/root/grid-root.css.js +74 -0
- package/dist/grid/root/grid-root.d.ts +79 -0
- package/dist/grid/root/grid-root.js +125 -0
- package/dist/heatmap/index.d.ts +1 -0
- package/dist/heatmap/index.js +1 -0
- package/dist/heatmap/root/heatmap-root.css.d.ts +1 -0
- package/dist/heatmap/root/heatmap-root.css.js +141 -0
- package/dist/heatmap/root/heatmap-root.d.ts +87 -0
- package/dist/heatmap/root/heatmap-root.js +96 -0
- package/dist/icon/glyph.css.d.ts +1 -0
- package/dist/icon/glyph.css.js +7 -0
- package/dist/icon/index.d.ts +1 -0
- package/dist/icon/index.js +1 -0
- package/dist/icon/root/icon-root.css.d.ts +1 -0
- package/dist/icon/root/icon-root.css.js +20 -0
- package/dist/icon/root/icon-root.d.ts +29 -0
- package/dist/icon/root/icon-root.js +35 -0
- package/dist/icon-button/index.d.ts +1 -0
- package/dist/icon-button/index.js +1 -0
- package/dist/icon-button/root/icon-button-root.css.d.ts +1 -0
- package/dist/icon-button/root/icon-button-root.css.js +165 -0
- package/dist/icon-button/root/icon-button-root.d.ts +65 -0
- package/dist/icon-button/root/icon-button-root.js +63 -0
- package/dist/image/index.d.ts +1 -0
- package/dist/image/index.js +1 -0
- package/dist/image/root/image-root.css.d.ts +1 -0
- package/dist/image/root/image-root.css.js +73 -0
- package/dist/image/root/image-root.d.ts +39 -0
- package/dist/image/root/image-root.js +52 -0
- package/dist/index.d.ts +100 -0
- package/dist/index.js +100 -0
- package/dist/input/index.d.ts +1 -0
- package/dist/input/index.js +1 -0
- package/dist/input/root/input-root.css.d.ts +1 -0
- package/dist/input/root/input-root.css.js +123 -0
- package/dist/input/root/input-root.d.ts +36 -0
- package/dist/input/root/input-root.js +48 -0
- package/dist/kbd/index.d.ts +1 -0
- package/dist/kbd/index.js +1 -0
- package/dist/kbd/root/kbd-root.css.d.ts +1 -0
- package/dist/kbd/root/kbd-root.css.js +47 -0
- package/dist/kbd/root/kbd-root.d.ts +30 -0
- package/dist/kbd/root/kbd-root.js +36 -0
- package/dist/legend/index.d.ts +1 -0
- package/dist/legend/index.js +1 -0
- package/dist/legend/root/legend-root.css.d.ts +1 -0
- package/dist/legend/root/legend-root.css.js +90 -0
- package/dist/legend/root/legend-root.d.ts +128 -0
- package/dist/legend/root/legend-root.js +99 -0
- package/dist/line-chart/index.d.ts +1 -0
- package/dist/line-chart/index.js +1 -0
- package/dist/line-chart/root/line-chart-root.css.d.ts +1 -0
- package/dist/line-chart/root/line-chart-root.css.js +293 -0
- package/dist/line-chart/root/line-chart-root.d.ts +106 -0
- package/dist/line-chart/root/line-chart-root.js +74 -0
- package/dist/list/index.d.ts +2 -0
- package/dist/list/index.js +2 -0
- package/dist/list/item/list-item.css.d.ts +1 -0
- package/dist/list/item/list-item.css.js +70 -0
- package/dist/list/item/list-item.d.ts +49 -0
- package/dist/list/item/list-item.js +58 -0
- package/dist/list/root/list-root.css.d.ts +1 -0
- package/dist/list/root/list-root.css.js +76 -0
- package/dist/list/root/list-root.d.ts +54 -0
- package/dist/list/root/list-root.js +50 -0
- package/dist/listbox/index.d.ts +1 -0
- package/dist/listbox/index.js +1 -0
- package/dist/listbox/root/listbox-root.css.d.ts +1 -0
- package/dist/listbox/root/listbox-root.css.js +110 -0
- package/dist/listbox/root/listbox-root.d.ts +30 -0
- package/dist/listbox/root/listbox-root.js +38 -0
- package/dist/loader/index.d.ts +1 -0
- package/dist/loader/index.js +1 -0
- package/dist/loader/root/loader-root.css.d.ts +1 -0
- package/dist/loader/root/loader-root.css.js +159 -0
- package/dist/loader/root/loader-root.d.ts +49 -0
- package/dist/loader/root/loader-root.js +42 -0
- package/dist/megamenu/index.d.ts +1 -0
- package/dist/megamenu/index.js +1 -0
- package/dist/megamenu/root/megamenu-root.css.d.ts +1 -0
- package/dist/megamenu/root/megamenu-root.css.js +153 -0
- package/dist/megamenu/root/megamenu-root.d.ts +34 -0
- package/dist/megamenu/root/megamenu-root.js +40 -0
- package/dist/menu/index.d.ts +2 -0
- package/dist/menu/index.js +2 -0
- package/dist/menu/item/menu-item.css.d.ts +1 -0
- package/dist/menu/item/menu-item.css.js +87 -0
- package/dist/menu/item/menu-item.d.ts +26 -0
- package/dist/menu/item/menu-item.js +32 -0
- package/dist/menu/root/menu-root.css.d.ts +1 -0
- package/dist/menu/root/menu-root.css.js +161 -0
- package/dist/menu/root/menu-root.d.ts +36 -0
- package/dist/menu/root/menu-root.js +42 -0
- package/dist/meter/index.d.ts +1 -0
- package/dist/meter/index.js +1 -0
- package/dist/meter/root/meter-root.css.d.ts +1 -0
- package/dist/meter/root/meter-root.css.js +218 -0
- package/dist/meter/root/meter-root.d.ts +79 -0
- package/dist/meter/root/meter-root.js +72 -0
- package/dist/mixins/mixin-control-surface/mixin-control-surface.d.ts +28 -0
- package/dist/mixins/mixin-control-surface/mixin-control-surface.js +21 -0
- package/dist/navigation/index.d.ts +1 -0
- package/dist/navigation/index.js +1 -0
- package/dist/navigation/root/navigation-root.css.d.ts +1 -0
- package/dist/navigation/root/navigation-root.css.js +50 -0
- package/dist/navigation/root/navigation-root.d.ts +28 -0
- package/dist/navigation/root/navigation-root.js +34 -0
- package/dist/notifications/index.d.ts +2 -0
- package/dist/notifications/index.js +2 -0
- package/dist/notifications/notification/notification.css.d.ts +1 -0
- package/dist/notifications/notification/notification.css.js +194 -0
- package/dist/notifications/notification/notification.d.ts +64 -0
- package/dist/notifications/notification/notification.js +71 -0
- package/dist/notifications/root/notifications-root.css.d.ts +1 -0
- package/dist/notifications/root/notifications-root.css.js +94 -0
- package/dist/notifications/root/notifications-root.d.ts +43 -0
- package/dist/notifications/root/notifications-root.js +49 -0
- package/dist/number-input/index.d.ts +1 -0
- package/dist/number-input/index.js +1 -0
- package/dist/number-input/root/number-input-root.css.d.ts +1 -0
- package/dist/number-input/root/number-input-root.css.js +149 -0
- package/dist/number-input/root/number-input-root.d.ts +41 -0
- package/dist/number-input/root/number-input-root.js +49 -0
- package/dist/option/group/option-group.css.d.ts +1 -0
- package/dist/option/group/option-group.css.js +24 -0
- package/dist/option/group/option-group.d.ts +23 -0
- package/dist/option/group/option-group.js +29 -0
- package/dist/option/index.d.ts +2 -0
- package/dist/option/index.js +2 -0
- package/dist/option/root/option-root.css.d.ts +1 -0
- package/dist/option/root/option-root.css.js +93 -0
- package/dist/option/root/option-root.d.ts +30 -0
- package/dist/option/root/option-root.js +36 -0
- package/dist/outline/index.d.ts +1 -0
- package/dist/outline/index.js +1 -0
- package/dist/outline/root/outline-root.css.d.ts +1 -0
- package/dist/outline/root/outline-root.css.js +144 -0
- package/dist/outline/root/outline-root.d.ts +31 -0
- package/dist/outline/root/outline-root.js +37 -0
- package/dist/pagination/index.d.ts +3 -0
- package/dist/pagination/index.js +3 -0
- package/dist/pagination/root/pagination-root.css.d.ts +1 -0
- package/dist/pagination/root/pagination-root.css.js +158 -0
- package/dist/pagination/root/pagination-root.d.ts +59 -0
- package/dist/pagination/root/pagination-root.js +65 -0
- package/dist/pagination/size/pagination-size.css.d.ts +1 -0
- package/dist/pagination/size/pagination-size.css.js +24 -0
- package/dist/pagination/size/pagination-size.d.ts +31 -0
- package/dist/pagination/size/pagination-size.js +44 -0
- package/dist/pagination/summary/pagination-summary.css.d.ts +1 -0
- package/dist/pagination/summary/pagination-summary.css.js +9 -0
- package/dist/pagination/summary/pagination-summary.d.ts +23 -0
- package/dist/pagination/summary/pagination-summary.js +29 -0
- package/dist/pin-input/index.d.ts +1 -0
- package/dist/pin-input/index.js +1 -0
- package/dist/pin-input/root/pin-input-root.css.d.ts +1 -0
- package/dist/pin-input/root/pin-input-root.css.js +74 -0
- package/dist/pin-input/root/pin-input-root.d.ts +37 -0
- package/dist/pin-input/root/pin-input-root.js +45 -0
- package/dist/popover/index.d.ts +1 -0
- package/dist/popover/index.js +1 -0
- package/dist/popover/root/popover-root.css.d.ts +1 -0
- package/dist/popover/root/popover-root.css.js +93 -0
- package/dist/popover/root/popover-root.d.ts +53 -0
- package/dist/popover/root/popover-root.js +50 -0
- package/dist/progress/index.d.ts +1 -0
- package/dist/progress/index.js +1 -0
- package/dist/progress/root/progress-root.css.d.ts +1 -0
- package/dist/progress/root/progress-root.css.js +225 -0
- package/dist/progress/root/progress-root.d.ts +54 -0
- package/dist/progress/root/progress-root.js +45 -0
- package/dist/qr-code/index.d.ts +1 -0
- package/dist/qr-code/index.js +1 -0
- package/dist/qr-code/root/qr-code-root.css.d.ts +1 -0
- package/dist/qr-code/root/qr-code-root.css.js +58 -0
- package/dist/qr-code/root/qr-code-root.d.ts +37 -0
- package/dist/qr-code/root/qr-code-root.js +43 -0
- package/dist/quote/index.d.ts +1 -0
- package/dist/quote/index.js +1 -0
- package/dist/quote/root/quote-root.css.d.ts +1 -0
- package/dist/quote/root/quote-root.css.js +20 -0
- package/dist/quote/root/quote-root.d.ts +25 -0
- package/dist/quote/root/quote-root.js +31 -0
- package/dist/radio/group/radio-group.css.d.ts +1 -0
- package/dist/radio/group/radio-group.css.js +23 -0
- package/dist/radio/group/radio-group.d.ts +26 -0
- package/dist/radio/group/radio-group.js +34 -0
- package/dist/radio/index.d.ts +2 -0
- package/dist/radio/index.js +2 -0
- package/dist/radio/root/radio-root.css.d.ts +1 -0
- package/dist/radio/root/radio-root.css.js +198 -0
- package/dist/radio/root/radio-root.d.ts +73 -0
- package/dist/radio/root/radio-root.js +74 -0
- package/dist/rating/index.d.ts +1 -0
- package/dist/rating/index.js +1 -0
- package/dist/rating/root/rating-root.css.d.ts +1 -0
- package/dist/rating/root/rating-root.css.js +122 -0
- package/dist/rating/root/rating-root.d.ts +52 -0
- package/dist/rating/root/rating-root.js +42 -0
- package/dist/sandbox/index.d.ts +20 -0
- package/dist/sandbox/index.js +20 -0
- package/dist/sandbox/preview/sandbox-preview.css.d.ts +1 -0
- package/dist/sandbox/preview/sandbox-preview.css.js +14 -0
- package/dist/sandbox/preview/sandbox-preview.d.ts +224 -0
- package/dist/sandbox/preview/sandbox-preview.js +306 -0
- package/dist/sandbox/root/sandbox-root.css.d.ts +1 -0
- package/dist/sandbox/root/sandbox-root.css.js +73 -0
- package/dist/sandbox/root/sandbox-root.d.ts +324 -0
- package/dist/sandbox/root/sandbox-root.js +569 -0
- package/dist/sandbox/source/sandbox-source.css.d.ts +1 -0
- package/dist/sandbox/source/sandbox-source.css.js +27 -0
- package/dist/sandbox/source/sandbox-source.d.ts +105 -0
- package/dist/sandbox/source/sandbox-source.js +173 -0
- package/dist/sandbox/status-bar/sandbox-status-bar.css.d.ts +1 -0
- package/dist/sandbox/status-bar/sandbox-status-bar.css.js +23 -0
- package/dist/sandbox/status-bar/sandbox-status-bar.d.ts +59 -0
- package/dist/sandbox/status-bar/sandbox-status-bar.js +86 -0
- package/dist/sandbox/terminal/sandbox-terminal.css.d.ts +1 -0
- package/dist/sandbox/terminal/sandbox-terminal.css.js +69 -0
- package/dist/sandbox/terminal/sandbox-terminal.d.ts +71 -0
- package/dist/sandbox/terminal/sandbox-terminal.js +130 -0
- package/dist/sandbox/toolbar/sandbox-toolbar.css.d.ts +1 -0
- package/dist/sandbox/toolbar/sandbox-toolbar.css.js +32 -0
- package/dist/sandbox/toolbar/sandbox-toolbar.d.ts +37 -0
- package/dist/sandbox/toolbar/sandbox-toolbar.js +49 -0
- package/dist/scroll-area/index.d.ts +1 -0
- package/dist/scroll-area/index.js +1 -0
- package/dist/scroll-area/root/scroll-area-root.css.d.ts +1 -0
- package/dist/scroll-area/root/scroll-area-root.css.js +118 -0
- package/dist/scroll-area/root/scroll-area-root.d.ts +34 -0
- package/dist/scroll-area/root/scroll-area-root.js +40 -0
- package/dist/select/index.d.ts +1 -0
- package/dist/select/index.js +1 -0
- package/dist/select/root/select-root.css.d.ts +1 -0
- package/dist/select/root/select-root.css.js +197 -0
- package/dist/select/root/select-root.d.ts +71 -0
- package/dist/select/root/select-root.js +60 -0
- package/dist/shared/chart/series.css.d.ts +1 -0
- package/dist/shared/chart/series.css.js +35 -0
- package/dist/shared/chart/terminus.css.d.ts +1 -0
- package/dist/shared/chart/terminus.css.js +41 -0
- package/dist/shared/field/field-inline.css.d.ts +1 -0
- package/dist/shared/field/field-inline.css.js +7 -0
- package/dist/shared/field/field-stacked.css.d.ts +1 -0
- package/dist/shared/field/field-stacked.css.js +7 -0
- package/dist/shared/field/field.css.d.ts +1 -0
- package/dist/shared/field/field.css.js +59 -0
- package/dist/skeleton/index.d.ts +1 -0
- package/dist/skeleton/index.js +1 -0
- package/dist/skeleton/root/skeleton-root.css.d.ts +1 -0
- package/dist/skeleton/root/skeleton-root.css.js +74 -0
- package/dist/skeleton/root/skeleton-root.d.ts +34 -0
- package/dist/skeleton/root/skeleton-root.js +38 -0
- package/dist/slider/index.d.ts +1 -0
- package/dist/slider/index.js +1 -0
- package/dist/slider/root/slider-root.css.d.ts +1 -0
- package/dist/slider/root/slider-root.css.js +335 -0
- package/dist/slider/root/slider-root.d.ts +42 -0
- package/dist/slider/root/slider-root.js +50 -0
- package/dist/sparkline/index.d.ts +1 -0
- package/dist/sparkline/index.js +1 -0
- package/dist/sparkline/root/sparkline-root.css.d.ts +1 -0
- package/dist/sparkline/root/sparkline-root.css.js +103 -0
- package/dist/sparkline/root/sparkline-root.d.ts +114 -0
- package/dist/sparkline/root/sparkline-root.js +67 -0
- package/dist/speed-dial/index.d.ts +2 -0
- package/dist/speed-dial/index.js +2 -0
- package/dist/speed-dial/item/speed-dial-item.css.d.ts +1 -0
- package/dist/speed-dial/item/speed-dial-item.css.js +80 -0
- package/dist/speed-dial/item/speed-dial-item.d.ts +26 -0
- package/dist/speed-dial/item/speed-dial-item.js +32 -0
- package/dist/speed-dial/root/speed-dial-root.css.d.ts +1 -0
- package/dist/speed-dial/root/speed-dial-root.css.js +140 -0
- package/dist/speed-dial/root/speed-dial-root.d.ts +27 -0
- package/dist/speed-dial/root/speed-dial-root.js +34 -0
- package/dist/splitter/index.d.ts +1 -0
- package/dist/splitter/index.js +1 -0
- package/dist/splitter/root/splitter-root.css.d.ts +1 -0
- package/dist/splitter/root/splitter-root.css.js +203 -0
- package/dist/splitter/root/splitter-root.d.ts +78 -0
- package/dist/splitter/root/splitter-root.js +70 -0
- package/dist/stat/group/stat-group.css.d.ts +1 -0
- package/dist/stat/group/stat-group.css.js +12 -0
- package/dist/stat/group/stat-group.d.ts +30 -0
- package/dist/stat/group/stat-group.js +43 -0
- package/dist/stat/index.d.ts +2 -0
- package/dist/stat/index.js +2 -0
- package/dist/stat/root/stat-root.css.d.ts +1 -0
- package/dist/stat/root/stat-root.css.js +60 -0
- package/dist/stat/root/stat-root.d.ts +27 -0
- package/dist/stat/root/stat-root.js +33 -0
- package/dist/steps/index.d.ts +2 -0
- package/dist/steps/index.js +2 -0
- package/dist/steps/root/steps-root.css.d.ts +1 -0
- package/dist/steps/root/steps-root.css.js +94 -0
- package/dist/steps/root/steps-root.d.ts +36 -0
- package/dist/steps/root/steps-root.js +42 -0
- package/dist/steps/step/step.css.d.ts +1 -0
- package/dist/steps/step/step.css.js +158 -0
- package/dist/steps/step/step.d.ts +20 -0
- package/dist/steps/step/step.js +30 -0
- package/dist/switch/index.d.ts +1 -0
- package/dist/switch/index.js +1 -0
- package/dist/switch/root/switch-root.css.d.ts +1 -0
- package/dist/switch/root/switch-root.css.js +113 -0
- package/dist/switch/root/switch-root.d.ts +42 -0
- package/dist/switch/root/switch-root.js +50 -0
- package/dist/table/cell/table-cell.css.d.ts +1 -0
- package/dist/table/cell/table-cell.css.js +25 -0
- package/dist/table/cell/table-cell.d.ts +24 -0
- package/dist/table/cell/table-cell.js +30 -0
- package/dist/table/column/table-column.css.d.ts +1 -0
- package/dist/table/column/table-column.css.js +21 -0
- package/dist/table/column/table-column.d.ts +23 -0
- package/dist/table/column/table-column.js +29 -0
- package/dist/table/index.d.ts +4 -0
- package/dist/table/index.js +4 -0
- package/dist/table/root/table-root.css.d.ts +1 -0
- package/dist/table/root/table-root.css.js +39 -0
- package/dist/table/root/table-root.d.ts +29 -0
- package/dist/table/root/table-root.js +35 -0
- package/dist/table/row/table-row.css.d.ts +1 -0
- package/dist/table/row/table-row.css.js +5 -0
- package/dist/table/row/table-row.d.ts +24 -0
- package/dist/table/row/table-row.js +30 -0
- package/dist/tabs/index.d.ts +3 -0
- package/dist/tabs/index.js +3 -0
- package/dist/tabs/panel/tab-panel.css.d.ts +1 -0
- package/dist/tabs/panel/tab-panel.css.js +17 -0
- package/dist/tabs/panel/tab-panel.d.ts +26 -0
- package/dist/tabs/panel/tab-panel.js +32 -0
- package/dist/tabs/root/tabs-root.css.d.ts +1 -0
- package/dist/tabs/root/tabs-root.css.js +136 -0
- package/dist/tabs/root/tabs-root.d.ts +29 -0
- package/dist/tabs/root/tabs-root.js +35 -0
- package/dist/tabs/tab/tab.css.d.ts +1 -0
- package/dist/tabs/tab/tab.css.js +57 -0
- package/dist/tabs/tab/tab.d.ts +26 -0
- package/dist/tabs/tab/tab.js +32 -0
- package/dist/tag/index.d.ts +1 -0
- package/dist/tag/index.js +1 -0
- package/dist/tag/root/tag-root.css.d.ts +1 -0
- package/dist/tag/root/tag-root.css.js +112 -0
- package/dist/tag/root/tag-root.d.ts +66 -0
- package/dist/tag/root/tag-root.js +48 -0
- package/dist/text/index.d.ts +1 -0
- package/dist/text/index.js +1 -0
- package/dist/text/root/text-root.css.d.ts +1 -0
- package/dist/text/root/text-root.css.js +113 -0
- package/dist/text/root/text-root.d.ts +83 -0
- package/dist/text/root/text-root.js +92 -0
- package/dist/textarea/index.d.ts +1 -0
- package/dist/textarea/index.js +1 -0
- package/dist/textarea/root/textarea-root.css.d.ts +1 -0
- package/dist/textarea/root/textarea-root.css.js +79 -0
- package/dist/textarea/root/textarea-root.d.ts +27 -0
- package/dist/textarea/root/textarea-root.js +35 -0
- package/dist/time-input/index.d.ts +1 -0
- package/dist/time-input/index.js +1 -0
- package/dist/time-input/root/time-input-root.css.d.ts +1 -0
- package/dist/time-input/root/time-input-root.css.js +184 -0
- package/dist/time-input/root/time-input-root.d.ts +42 -0
- package/dist/time-input/root/time-input-root.js +53 -0
- package/dist/time-picker/index.d.ts +1 -0
- package/dist/time-picker/index.js +1 -0
- package/dist/time-picker/root/time-picker-root.css.d.ts +1 -0
- package/dist/time-picker/root/time-picker-root.css.js +147 -0
- package/dist/time-picker/root/time-picker-root.d.ts +38 -0
- package/dist/time-picker/root/time-picker-root.js +48 -0
- package/dist/timeline/index.d.ts +2 -0
- package/dist/timeline/index.js +2 -0
- package/dist/timeline/item/timeline-item.css.d.ts +1 -0
- package/dist/timeline/item/timeline-item.css.js +111 -0
- package/dist/timeline/item/timeline-item.d.ts +27 -0
- package/dist/timeline/item/timeline-item.js +33 -0
- package/dist/timeline/root/timeline-root.css.d.ts +1 -0
- package/dist/timeline/root/timeline-root.css.js +12 -0
- package/dist/timeline/root/timeline-root.d.ts +25 -0
- package/dist/timeline/root/timeline-root.js +31 -0
- package/dist/toast/index.d.ts +2 -0
- package/dist/toast/index.js +2 -0
- package/dist/toast/item/toast-item.css.d.ts +1 -0
- package/dist/toast/item/toast-item.css.js +233 -0
- package/dist/toast/item/toast-item.d.ts +31 -0
- package/dist/toast/item/toast-item.js +37 -0
- package/dist/toast/root/toast-root.css.d.ts +1 -0
- package/dist/toast/root/toast-root.css.js +66 -0
- package/dist/toast/root/toast-root.d.ts +37 -0
- package/dist/toast/root/toast-root.js +43 -0
- package/dist/toggle/group/toggle-group.css.d.ts +1 -0
- package/dist/toggle/group/toggle-group.css.js +118 -0
- package/dist/toggle/group/toggle-group.d.ts +49 -0
- package/dist/toggle/group/toggle-group.js +47 -0
- package/dist/toggle/index.d.ts +2 -0
- package/dist/toggle/index.js +2 -0
- package/dist/toggle/root/toggle-root.css.d.ts +1 -0
- package/dist/toggle/root/toggle-root.css.js +25 -0
- package/dist/toggle/root/toggle-root.d.ts +28 -0
- package/dist/toggle/root/toggle-root.js +34 -0
- package/dist/toolbar/index.d.ts +1 -0
- package/dist/toolbar/index.js +1 -0
- package/dist/toolbar/root/toolbar-root.css.d.ts +1 -0
- package/dist/toolbar/root/toolbar-root.css.js +28 -0
- package/dist/toolbar/root/toolbar-root.d.ts +29 -0
- package/dist/toolbar/root/toolbar-root.js +35 -0
- package/dist/tooltip/index.d.ts +1 -0
- package/dist/tooltip/index.js +1 -0
- package/dist/tooltip/root/tooltip-root.css.d.ts +1 -0
- package/dist/tooltip/root/tooltip-root.css.js +121 -0
- package/dist/tooltip/root/tooltip-root.d.ts +63 -0
- package/dist/tooltip/root/tooltip-root.js +42 -0
- package/dist/tour/index.d.ts +2 -0
- package/dist/tour/index.js +2 -0
- package/dist/tour/root/tour-root.css.d.ts +1 -0
- package/dist/tour/root/tour-root.css.js +30 -0
- package/dist/tour/root/tour-root.d.ts +24 -0
- package/dist/tour/root/tour-root.js +30 -0
- package/dist/tour/stop/tour-stop.css.d.ts +1 -0
- package/dist/tour/stop/tour-stop.css.js +77 -0
- package/dist/tour/stop/tour-stop.d.ts +34 -0
- package/dist/tour/stop/tour-stop.js +40 -0
- package/dist/tree/index.d.ts +2 -0
- package/dist/tree/index.js +2 -0
- package/dist/tree/item/tree-item.css.d.ts +1 -0
- package/dist/tree/item/tree-item.css.js +177 -0
- package/dist/tree/item/tree-item.d.ts +44 -0
- package/dist/tree/item/tree-item.js +50 -0
- package/dist/tree/root/tree-root.css.d.ts +1 -0
- package/dist/tree/root/tree-root.css.js +43 -0
- package/dist/tree/root/tree-root.d.ts +63 -0
- package/dist/tree/root/tree-root.js +47 -0
- package/dist/trend/index.d.ts +1 -0
- package/dist/trend/index.js +1 -0
- package/dist/trend/root/trend-root.css.d.ts +1 -0
- package/dist/trend/root/trend-root.css.js +50 -0
- package/dist/trend/root/trend-root.d.ts +48 -0
- package/dist/trend/root/trend-root.js +55 -0
- package/dist/video/index.d.ts +1 -0
- package/dist/video/index.js +1 -0
- package/dist/video/root/video-root.css.d.ts +1 -0
- package/dist/video/root/video-root.css.js +404 -0
- package/dist/video/root/video-root.d.ts +87 -0
- package/dist/video/root/video-root.js +61 -0
- package/dist/video-playlist/index.d.ts +3 -0
- package/dist/video-playlist/index.js +3 -0
- package/dist/video-playlist/item/video-playlist-item.css.d.ts +1 -0
- package/dist/video-playlist/item/video-playlist-item.css.js +95 -0
- package/dist/video-playlist/item/video-playlist-item.d.ts +25 -0
- package/dist/video-playlist/item/video-playlist-item.js +31 -0
- package/dist/video-playlist/menu/video-playlist-menu.css.d.ts +1 -0
- package/dist/video-playlist/menu/video-playlist-menu.css.js +44 -0
- package/dist/video-playlist/menu/video-playlist-menu.d.ts +43 -0
- package/dist/video-playlist/menu/video-playlist-menu.js +56 -0
- package/dist/video-playlist/root/video-playlist-root.css.d.ts +1 -0
- package/dist/video-playlist/root/video-playlist-root.css.js +21 -0
- package/dist/video-playlist/root/video-playlist-root.d.ts +26 -0
- package/dist/video-playlist/root/video-playlist-root.js +32 -0
- package/dist/virtual-list/index.d.ts +1 -0
- package/dist/virtual-list/index.js +1 -0
- package/dist/virtual-list/root/virtual-list-root.css.d.ts +1 -0
- package/dist/virtual-list/root/virtual-list-root.css.js +27 -0
- package/dist/virtual-list/root/virtual-list-root.d.ts +31 -0
- package/dist/virtual-list/root/virtual-list-root.js +37 -0
- package/elements.css +287 -0
- package/jsx.d.ts +54748 -0
- package/package.json +80 -0
- package/svelte.d.ts +139 -0
- package/vue.d.ts +11511 -0
|
@@ -0,0 +1,1024 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var HelixAura_1;
|
|
8
|
+
import { customElement, HelixElement, TokenColorController, } from '@fusion.dev/helix-core';
|
|
9
|
+
import { html } from 'lit';
|
|
10
|
+
import { property } from 'lit/decorators.js';
|
|
11
|
+
import { tiltFor } from './aura-axis.js';
|
|
12
|
+
import { styles } from './aura-root.css.js';
|
|
13
|
+
import { FRAGMENT, INTERACTIONS, SHAPES, VERTEX } from './aura-shader.js';
|
|
14
|
+
/**
|
|
15
|
+
* The widest either edge of the drawing buffer may get, in device pixels.
|
|
16
|
+
*
|
|
17
|
+
* Past `MAX_RENDERBUFFER_SIZE` a canvas does not draw at all, and WebGL2
|
|
18
|
+
* guarantees only 2048. Desktop parts report 16384 and older integrated ones
|
|
19
|
+
* report 8192, which a page-length field can pass.
|
|
20
|
+
*/
|
|
21
|
+
const MAX_CANVAS_EDGE = 4096;
|
|
22
|
+
/**
|
|
23
|
+
* The most device pixels the drawing buffer may hold, at 2048 squared.
|
|
24
|
+
*
|
|
25
|
+
* Every one of them runs five octaves of noise through two warps on every
|
|
26
|
+
* frame, so this is the fill rate rather than the fidelity: roughly what the
|
|
27
|
+
* component already cost over the two screens it was designed against.
|
|
28
|
+
*/
|
|
29
|
+
const MAX_CANVAS_PIXELS = 4_194_304;
|
|
30
|
+
/**
|
|
31
|
+
* How long the opening frame will wait for the box to stop changing, in ms.
|
|
32
|
+
*
|
|
33
|
+
* The field is scaled by its box, so painting a box that is still settling draws
|
|
34
|
+
* the same shape at several sizes and reads as the background zooming out. The
|
|
35
|
+
* wait ends one animation frame after the last change; this is only the cap, for
|
|
36
|
+
* a page that never stops resizing it. Longer than any load takes to settle and
|
|
37
|
+
* shorter than a reader takes to conclude the background is just a gradient.
|
|
38
|
+
*/
|
|
39
|
+
const OPENING_PATIENCE = 500;
|
|
40
|
+
/**
|
|
41
|
+
* @summary A lit, drifting background, drawn from the token layer.
|
|
42
|
+
*
|
|
43
|
+
* @description
|
|
44
|
+
* One fragment shader over a full-screen triangle, with the palette read from
|
|
45
|
+
* the tokens rather than given as colors. That is the whole reason this belongs
|
|
46
|
+
* in a design system instead of in a page: a background written with hex values
|
|
47
|
+
* is an asset that has to be re-cut when the brand moves, and one written
|
|
48
|
+
* against `--helix-color-primary` is a consequence of it.
|
|
49
|
+
*
|
|
50
|
+
* **Every shape ramps through four token stops**, and the token layer inverts
|
|
51
|
+
* each of them: the page's own background, `primary-subtle`, `primary`, and
|
|
52
|
+
* then a peak. The peak is the foreground on a dark page and `primary-active`
|
|
53
|
+
* on a light one, because mixing a saturated hue toward near-black takes the
|
|
54
|
+
* chroma out of exactly the pixels carrying the most of it. Which way the page
|
|
55
|
+
* runs is not asked of the mode, which is a private token: it is read off the
|
|
56
|
+
* ground's own luminance, which the shader already has.
|
|
57
|
+
*
|
|
58
|
+
* **No dependency, and no scene graph.** The geometry is three vertices derived
|
|
59
|
+
* from `gl_VertexID`, so there is no attribute, no buffer and no upload. The
|
|
60
|
+
* common implementations of this reach for a 3D library to draw one quad, which
|
|
61
|
+
* is a camera and a material system for four vertices that never move.
|
|
62
|
+
*
|
|
63
|
+
* **It stops when nobody is looking**, off screen and in a background tab, and
|
|
64
|
+
* `prefers-reduced-motion` gets one still frame rather than an empty box: the
|
|
65
|
+
* composition is the point and the drift is a garnish.
|
|
66
|
+
*
|
|
67
|
+
* **A layer over an interactive aura has to let the pointer through.** The
|
|
68
|
+
* element is hit-testable only when `interactive` is set, because a background
|
|
69
|
+
* that swallows clicks is worse than one that does nothing, but a scrim or an
|
|
70
|
+
* overlay a consumer paints on top will absorb the move before it arrives. Any
|
|
71
|
+
* decorative layer above this wants `pointer-events: none`. It has already
|
|
72
|
+
* caught this repository's own bench once.
|
|
73
|
+
*
|
|
74
|
+
* **The fallback needs no detection.** Where WebGL is refused the canvas never
|
|
75
|
+
* paints and is transparent, and the host carries a gradient of the same tokens
|
|
76
|
+
* underneath. Nothing has to ask whether it worked.
|
|
77
|
+
*
|
|
78
|
+
* Presentation only, so there is no headless tier: the split exists to keep
|
|
79
|
+
* behavior separate from styling, and there is no structure or semantics here
|
|
80
|
+
* to separate. Decorative, so the host is hidden from assistive technology and
|
|
81
|
+
* takes no pointer events.
|
|
82
|
+
*
|
|
83
|
+
* @since 0.1.0
|
|
84
|
+
* @status experimental
|
|
85
|
+
* @category media
|
|
86
|
+
* @aliases Backdrop, Background, Atmosphere, Gradient
|
|
87
|
+
* @documentation https://helix.fusion.dev/components/aura
|
|
88
|
+
*
|
|
89
|
+
* @csspart canvas - The surface the shader draws into.
|
|
90
|
+
*/
|
|
91
|
+
let HelixAura = class HelixAura extends HelixElement {
|
|
92
|
+
constructor() {
|
|
93
|
+
super(...arguments);
|
|
94
|
+
/**
|
|
95
|
+
* How far the settings wander on their own, `0` still and `1` restless.
|
|
96
|
+
*
|
|
97
|
+
* **One property rather than a range on each of the five.** A range per axis
|
|
98
|
+
* is five more things to author and four more chances to write a pair that
|
|
99
|
+
* fights another; the reason to want any of it is the same reason in every
|
|
100
|
+
* case, which is that a fixed field is legibly a loop. So this is an amount,
|
|
101
|
+
* and each axis is given its own span and its own period.
|
|
102
|
+
*
|
|
103
|
+
* The periods are irrational multiples of each other, so no two axes come
|
|
104
|
+
* back into phase and the field has no cycle a reader can count. That is the
|
|
105
|
+
* difference between a background that breathes and one that is obviously on
|
|
106
|
+
* a timer.
|
|
107
|
+
*/
|
|
108
|
+
this.drift = 0;
|
|
109
|
+
/**
|
|
110
|
+
* How far the pointer reaches into the field, `0` upward.
|
|
111
|
+
*
|
|
112
|
+
* Multiplied into the presence the pointer already fades in and out with, so
|
|
113
|
+
* it scales the whole response rather than any one part of it, whichever
|
|
114
|
+
* interaction is in play.
|
|
115
|
+
*/
|
|
116
|
+
this.reach = 1;
|
|
117
|
+
/**
|
|
118
|
+
* Whether the pointer shifts and lifts the field.
|
|
119
|
+
*
|
|
120
|
+
* Reflected because the stylesheet selects on it: a background is not
|
|
121
|
+
* hit-testable at rest, or it would swallow clicks meant for what is over it,
|
|
122
|
+
* and an element that is not hit-testable never receives the `pointermove`
|
|
123
|
+
* this listens for. Asking for the pointer is asking for the hit test.
|
|
124
|
+
*/
|
|
125
|
+
this.interactive = false;
|
|
126
|
+
/**
|
|
127
|
+
* How soft the falloff is, `0` tight and `1` diffuse.
|
|
128
|
+
*/
|
|
129
|
+
this.bloom = 0.5;
|
|
130
|
+
/**
|
|
131
|
+
* Overall brightness, as a multiplier on the field.
|
|
132
|
+
*/
|
|
133
|
+
this.gain = 1;
|
|
134
|
+
/**
|
|
135
|
+
* Feature size, as a multiplier on the sampled coordinates.
|
|
136
|
+
*/
|
|
137
|
+
this.scale = 1;
|
|
138
|
+
/**
|
|
139
|
+
* How fast it drifts, as a multiplier on time.
|
|
140
|
+
*/
|
|
141
|
+
this.speed = 1;
|
|
142
|
+
/**
|
|
143
|
+
* The field's rotation, in degrees.
|
|
144
|
+
*/
|
|
145
|
+
this.tilt = 14;
|
|
146
|
+
/**
|
|
147
|
+
* How much the members of a population differ from one another, `0` a set
|
|
148
|
+
* that is uniform and `1` the resting amount. Clamped to that range: these
|
|
149
|
+
* are interpolations, so a larger number extrapolates rather than
|
|
150
|
+
* exaggerating, and a streak whose length has passed through zero is drawn
|
|
151
|
+
* as a bar across the whole frame.
|
|
152
|
+
*
|
|
153
|
+
* Read by the shapes made of many similar things, whether those are counted
|
|
154
|
+
* or continuous: `streaks`, whose lanes draw a speed, a length, a width, a
|
|
155
|
+
* spacing and a weight apiece; `particles`, whose motes draw a size, a
|
|
156
|
+
* brightness and a wander; and `rays` and `aurora`, whose fan, bundles and
|
|
157
|
+
* folds widen or even out. `braid`, `waves` and `flow` have a
|
|
158
|
+
* single subject and nothing to vary, and `threads` is even on purpose, so on
|
|
159
|
+
* those four this is inert.
|
|
160
|
+
*/
|
|
161
|
+
this.variance = 1;
|
|
162
|
+
/** Repaints when the palette moves, which no re-render would do on its own. */
|
|
163
|
+
this.tokens = new TokenColorController(this, () => {
|
|
164
|
+
this.readPalette();
|
|
165
|
+
this.paintOnce();
|
|
166
|
+
});
|
|
167
|
+
/**
|
|
168
|
+
* The four ramp stops, resolved.
|
|
169
|
+
*
|
|
170
|
+
* **Cached, because reading them is not free and they do not move.** Each
|
|
171
|
+
* read sets a style, calls `getComputedStyle`, fills a pixel and reads it
|
|
172
|
+
* back: a style recalc and a canvas readback apiece. Doing that inside
|
|
173
|
+
* `paint` meant four of each on every frame, forever, to fetch values that
|
|
174
|
+
* change only when the color mode does. The controller already says when
|
|
175
|
+
* that happens, so this is filled from there and from the first paint.
|
|
176
|
+
*/
|
|
177
|
+
this.palette = {
|
|
178
|
+
glow: [0.29, 0.61, 1],
|
|
179
|
+
ground: [0, 0, 0],
|
|
180
|
+
haze: [0.02, 0.15, 0.34],
|
|
181
|
+
peak: [1, 1, 1],
|
|
182
|
+
};
|
|
183
|
+
this.canvas = null;
|
|
184
|
+
this.gl = null;
|
|
185
|
+
this.program = null;
|
|
186
|
+
this.uniforms = {};
|
|
187
|
+
/** The pending context release, or `0`. Canceled by a reconnection. */
|
|
188
|
+
this.release = 0;
|
|
189
|
+
this.frame = 0;
|
|
190
|
+
this.elapsed = 0;
|
|
191
|
+
this.last = 0;
|
|
192
|
+
this.width = 0;
|
|
193
|
+
this.height = 0;
|
|
194
|
+
/**
|
|
195
|
+
* Where the pointer has been, as flat triples of x, y and age.
|
|
196
|
+
*
|
|
197
|
+
* A ring rather than a queue: the oldest slot is overwritten, so nothing is
|
|
198
|
+
* allocated and the cost is the same on the first second and the thousandth.
|
|
199
|
+
*/
|
|
200
|
+
this.trail = new Float32Array(8 * 3).fill(1);
|
|
201
|
+
this.trailNext = 0;
|
|
202
|
+
/**
|
|
203
|
+
* The same marks, oldest first, which is what the shader is given.
|
|
204
|
+
*
|
|
205
|
+
* The ring's own order is not time order, and the wake is drawn as a polyline
|
|
206
|
+
* through consecutive entries: a segment across the wrap joined the newest
|
|
207
|
+
* mark to the oldest and drew a bright bar clean through the middle of the
|
|
208
|
+
* field. Unrolled once per frame, which is eight copies.
|
|
209
|
+
*/
|
|
210
|
+
this.ordered = new Float32Array(9 * 3).fill(1);
|
|
211
|
+
/**
|
|
212
|
+
* The live end of the stroke, outside the ring.
|
|
213
|
+
*
|
|
214
|
+
* **In the ring it destroyed a mark every time it committed.** The head was
|
|
215
|
+
* the slot at `trailNext`, so advancing wrote over whatever was oldest, and
|
|
216
|
+
* the tail of the stroke lost a point instantly rather than fading. Held
|
|
217
|
+
* apart, committing appends where the head already is: the polyline goes from
|
|
218
|
+
* ending at P to ending at P, P, which is the same shape, and nothing jumps.
|
|
219
|
+
*/
|
|
220
|
+
this.head = { x: 1, y: 1 };
|
|
221
|
+
/** Where the pointer is, and where the field has got to. The gap is weight. */
|
|
222
|
+
/* `presence`, not `reach`: the eased value is how far the pointer has faded
|
|
223
|
+
in, and `reach` is now the consumer's amplitude. The two multiply. */
|
|
224
|
+
this.target = { presence: 0, x: 0, y: 0 };
|
|
225
|
+
this.eased = { presence: 0, x: 0, y: 0 };
|
|
226
|
+
/**
|
|
227
|
+
* The element's box, cached.
|
|
228
|
+
*
|
|
229
|
+
* **Read per event, this was the ragged half.** `getBoundingClientRect` forces
|
|
230
|
+
* a synchronous layout, and a pointer emits events far faster than the
|
|
231
|
+
* display refreshes: a 1000Hz mouse flushed layout a thousand times a second
|
|
232
|
+
* to compute a number that only changes when the page reflows. Refreshed from
|
|
233
|
+
* the resize observer and from scroll, both of which are exactly when it can
|
|
234
|
+
* go stale, and never from the handler that reads it.
|
|
235
|
+
*/
|
|
236
|
+
this.box = { height: 1, left: 0, top: 0, width: 1 };
|
|
237
|
+
/**
|
|
238
|
+
* Whether the field has drawn its opening frame yet.
|
|
239
|
+
*
|
|
240
|
+
* **The box changes shape while a page is arriving, and this shader is scaled
|
|
241
|
+
* by the box.** `p.y` spans [-1, 1] over the element's height, so a feature's
|
|
242
|
+
* size in pixels is proportional to how tall the box happens to be when the
|
|
243
|
+
* frame is drawn. A page that upgrades its custom elements, loads its fonts
|
|
244
|
+
* and settles its images passes through several heights on the way to its
|
|
245
|
+
* final one, and painting each of them draws the same field at several
|
|
246
|
+
* scales: it opens coarse and tightens, which reads as the background zooming
|
|
247
|
+
* out on load rather than as a background.
|
|
248
|
+
*
|
|
249
|
+
* Refusing the degenerate 0 by 0 box fixed the worst of it, a 2 by 2 drawing
|
|
250
|
+
* buffer smeared over the page, and left the ordinary case: a first real box
|
|
251
|
+
* that is simply not the last one.
|
|
252
|
+
*
|
|
253
|
+
* So the opening frame waits for the box to stop moving. Nothing paints until
|
|
254
|
+
* a measurement has stood unchanged for one animation frame, which is the
|
|
255
|
+
* cheapest definition of settled that is not a guess, and the host's own
|
|
256
|
+
* gradient covers the wait. After that a resize repaints immediately, because
|
|
257
|
+
* by then a change is the window moving rather than the page arriving.
|
|
258
|
+
*/
|
|
259
|
+
this.opened = false;
|
|
260
|
+
/** The pending opening frame, canceled and rescheduled by each new box. */
|
|
261
|
+
this.opening = 0;
|
|
262
|
+
/**
|
|
263
|
+
* When to stop waiting and draw anyway.
|
|
264
|
+
*
|
|
265
|
+
* A page that resizes the field every frame forever would otherwise never get
|
|
266
|
+
* an opening frame at all. Half a second is far longer than a load takes to
|
|
267
|
+
* settle and far shorter than a reader waits before deciding the background is
|
|
268
|
+
* simply a gradient.
|
|
269
|
+
*/
|
|
270
|
+
this.openBy = 0;
|
|
271
|
+
/**
|
|
272
|
+
* Gives the context back, once nothing has claimed the element again.
|
|
273
|
+
*
|
|
274
|
+
* **The context is not released by dropping the reference.** A browser caps
|
|
275
|
+
* live WebGL contexts at about sixteen and drops the oldest when a
|
|
276
|
+
* seventeenth is asked for, so a page that mounts and unmounts auras kills
|
|
277
|
+
* the ones still on screen: the symptom is an aura elsewhere going blank,
|
|
278
|
+
* which looks like a fault in that element and is this one. The context
|
|
279
|
+
* belongs to the canvas, and the canvas is held by the shadow root until the
|
|
280
|
+
* element is collected, which is a moment nothing here controls and which is
|
|
281
|
+
* far too late for a cap of sixteen. `WEBGL_lose_context` is the only way.
|
|
282
|
+
*
|
|
283
|
+
* **It spends the canvas**, which is what `build` is written around: the
|
|
284
|
+
* canvas can never serve a context again and a returning element takes a
|
|
285
|
+
* fresh one.
|
|
286
|
+
*/
|
|
287
|
+
this.drop = () => {
|
|
288
|
+
this.release = 0;
|
|
289
|
+
if (this.gl && this.program) {
|
|
290
|
+
this.gl.deleteProgram(this.program);
|
|
291
|
+
}
|
|
292
|
+
this.gl?.getExtension('WEBGL_lose_context')?.loseContext();
|
|
293
|
+
this.program = null;
|
|
294
|
+
this.gl = null;
|
|
295
|
+
};
|
|
296
|
+
this.tick = (now) => {
|
|
297
|
+
if (!this.last) {
|
|
298
|
+
this.last = now;
|
|
299
|
+
}
|
|
300
|
+
/* Skipped rather than rescheduled on a timer: `requestAnimationFrame` is
|
|
301
|
+
what pauses in a background tab and what matches the display, and a
|
|
302
|
+
`setTimeout` loop would give up both to save the same work. */
|
|
303
|
+
if (!this.interactive && now - this.last < HelixAura_1.CAPPED) {
|
|
304
|
+
this.frame = requestAnimationFrame(this.tick);
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
/* Clamped: a tab returning from the background delivers one enormous delta,
|
|
308
|
+
and the field would teleport to wherever the pointer had gone. */
|
|
309
|
+
const delta = Math.min((now - this.last) / 1000, 0.05);
|
|
310
|
+
this.last = now;
|
|
311
|
+
/* Accumulated rather than measured from a start stamp. A stamp reset on
|
|
312
|
+
every pause means a reader who switched tabs and came back finds the
|
|
313
|
+
field snapped to its opening frame, which is the one thing a background
|
|
314
|
+
must never do. */
|
|
315
|
+
this.elapsed += delta * Math.max(0, this.drifted(this.speed, 0.4, 0.043));
|
|
316
|
+
/* Two time constants, because position and presence are two different
|
|
317
|
+
jobs and one number was serving both badly.
|
|
318
|
+
|
|
319
|
+
**Position tracks.** A parallax that lags is not weighty, it is late: at
|
|
320
|
+
85 milliseconds it took about two tenths of a second to close nine tenths
|
|
321
|
+
of the gap, which is well inside what a reader perceives as the page
|
|
322
|
+
being slow rather than the field being heavy. 28 milliseconds puts it at
|
|
323
|
+
the edge of perception while still absorbing the jitter a raw pointer
|
|
324
|
+
carries, which is the only thing the easing was ever for.
|
|
325
|
+
|
|
326
|
+
**Presence does not.** `reach` is the effect fading in as the pointer
|
|
327
|
+
arrives and out as it leaves, and that wants to be gradual: snapped on,
|
|
328
|
+
the whole field flinches the instant a cursor crosses the edge.
|
|
329
|
+
|
|
330
|
+
Frame-rate independent, written as a time constant rather than a
|
|
331
|
+
per-frame factor: a factor ties the feel to the refresh rate, so a 120Hz
|
|
332
|
+
display would chase twice as eagerly as a 60Hz one. */
|
|
333
|
+
/* **The constant scales with the gap, because one constant cannot do both
|
|
334
|
+
jobs.** A fixed 28 milliseconds leaves a moving pointer a distance v * t
|
|
335
|
+
behind it for as long as it keeps moving: about 56 pixels at a 2000
|
|
336
|
+
pixel per second flick and twice that at twice the speed, which is what
|
|
337
|
+
reads as the field being unable to keep up. Lowering it for everyone
|
|
338
|
+
would give the jitter of a resting hand straight back to the shader,
|
|
339
|
+
which is the only thing the smoothing was ever there for.
|
|
340
|
+
|
|
341
|
+
Jitter is small and a flick is large, so the size of the gap is the
|
|
342
|
+
signal that tells them apart. At rest this still eases over about 25
|
|
343
|
+
milliseconds; a gap of one shape unit closes over nine, and two over
|
|
344
|
+
five. Nothing to tune per shape and nothing to measure per frame beyond
|
|
345
|
+
a distance already implied by the two points. */
|
|
346
|
+
const drift = Math.hypot(this.target.x - this.eased.x, this.target.y - this.eased.y);
|
|
347
|
+
const follow = 1 - Math.exp(-delta / (0.028 / (1 + drift * 2.4)));
|
|
348
|
+
if (!this.interactive) {
|
|
349
|
+
this.target.presence = 0;
|
|
350
|
+
}
|
|
351
|
+
this.eased.x += (this.target.x - this.eased.x) * follow;
|
|
352
|
+
this.eased.y += (this.target.y - this.eased.y) * follow;
|
|
353
|
+
/* Presence rises fast and falls slowly, which is not symmetry for its own
|
|
354
|
+
sake. A single constant meant the effect took about four tenths of a
|
|
355
|
+
second to reach full strength every time a pointer entered, and that
|
|
356
|
+
ramp is indistinguishable from lag: a reader moves in, nothing much
|
|
357
|
+
happens, and by the time it does they have decided the page is slow.
|
|
358
|
+
Rising in 115 milliseconds it answers immediately; falling over half a
|
|
359
|
+
second it lets go without the field flinching as the cursor crosses out. */
|
|
360
|
+
const rising = this.target.presence > this.eased.presence;
|
|
361
|
+
const fade = 1 - Math.exp(-delta / (rising ? 0.05 : 0.22));
|
|
362
|
+
this.eased.presence += (this.target.presence - this.eased.presence) * fade;
|
|
363
|
+
this.age(delta);
|
|
364
|
+
this.advanceWake();
|
|
365
|
+
this.paint();
|
|
366
|
+
this.frame = requestAnimationFrame(this.tick);
|
|
367
|
+
};
|
|
368
|
+
this.handlePointer = (event) => {
|
|
369
|
+
if (this.motion?.matches) {
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
372
|
+
const { height, left, top, width } = this.box;
|
|
373
|
+
const aspect = width / height;
|
|
374
|
+
this.target.x = ((event.clientX - left) / width - 0.5) * 2 * aspect;
|
|
375
|
+
this.target.y = -((event.clientY - top) / height - 0.5) * 2;
|
|
376
|
+
this.target.presence = this.interactive ? 1 : 0;
|
|
377
|
+
};
|
|
378
|
+
this.handleLeave = () => {
|
|
379
|
+
this.target.presence = 0;
|
|
380
|
+
};
|
|
381
|
+
this.handleVisibility = () => {
|
|
382
|
+
if (document.hidden) {
|
|
383
|
+
this.stop();
|
|
384
|
+
}
|
|
385
|
+
else {
|
|
386
|
+
this.play();
|
|
387
|
+
}
|
|
388
|
+
};
|
|
389
|
+
this.handleScroll = () => {
|
|
390
|
+
/* Only the origin can have moved, and only what the pointer is measured
|
|
391
|
+
against needs it, so this refreshes the cache and draws nothing. */
|
|
392
|
+
const rect = this.getBoundingClientRect();
|
|
393
|
+
this.box = { ...this.box, left: rect.left, top: rect.top };
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
static { HelixAura_1 = this; }
|
|
397
|
+
static { this.styles = [styles]; }
|
|
398
|
+
/** What every context is asked for, here rather than at two call sites. */
|
|
399
|
+
static { this.CONTEXT = {
|
|
400
|
+
alpha: true,
|
|
401
|
+
antialias: false,
|
|
402
|
+
depth: false,
|
|
403
|
+
powerPreference: 'low-power',
|
|
404
|
+
stencil: false,
|
|
405
|
+
}; }
|
|
406
|
+
render() {
|
|
407
|
+
/* `aria-hidden` on the canvas rather than on the host, because a consumer
|
|
408
|
+
may want to label the region this sits behind and a hidden host would
|
|
409
|
+
take that with it. The canvas itself never has anything to announce. */
|
|
410
|
+
return html `<canvas part="canvas" aria-hidden="true"></canvas>`;
|
|
411
|
+
}
|
|
412
|
+
firstUpdated() {
|
|
413
|
+
this.start();
|
|
414
|
+
}
|
|
415
|
+
/* Everything the canvas needs, in one place both lifecycles can reach.
|
|
416
|
+
*
|
|
417
|
+
* This was the body of `firstUpdated`, which runs once for the life of the
|
|
418
|
+
* element, while `disconnectedCallback` deletes the program, drops the
|
|
419
|
+
* context and disconnects both observers, and runs every time the element
|
|
420
|
+
* moves. So an aura reordered by a framework came back with `this.gl` null
|
|
421
|
+
* and nothing to rebuild it: a live component painting nothing, for the rest
|
|
422
|
+
* of the page's life, with no error anywhere.
|
|
423
|
+
*
|
|
424
|
+
* Guarded at the call site on `hasUpdated`, because the first connection
|
|
425
|
+
* happens before the first render and there is no canvas yet.
|
|
426
|
+
* `check:observers` holds the pairing. */
|
|
427
|
+
start() {
|
|
428
|
+
/* Client only, and by contract. There is no canvas on a server, so the
|
|
429
|
+
shader is an enhancement over markup that already renders a gradient. */
|
|
430
|
+
if (!this.renderRoot.querySelector('canvas')) {
|
|
431
|
+
return;
|
|
432
|
+
}
|
|
433
|
+
/* A reconnection that outran its own release has everything already: the
|
|
434
|
+
context is live and the program is linked, so the reorder costs the
|
|
435
|
+
listeners and the observers and no GL work at all. */
|
|
436
|
+
if (!this.program && !this.build()) {
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
this.motion = window.matchMedia('(prefers-reduced-motion: reduce)');
|
|
440
|
+
this.addEventListener('pointermove', this.handlePointer);
|
|
441
|
+
this.addEventListener('pointerleave', this.handleLeave);
|
|
442
|
+
this.visible = new IntersectionObserver(([entry]) => {
|
|
443
|
+
if (entry?.isIntersecting) {
|
|
444
|
+
this.play();
|
|
445
|
+
}
|
|
446
|
+
else {
|
|
447
|
+
this.stop();
|
|
448
|
+
}
|
|
449
|
+
});
|
|
450
|
+
this.visible.observe(this);
|
|
451
|
+
document.addEventListener('visibilitychange', this.handleVisibility);
|
|
452
|
+
/* Scroll moves the box without resizing it, and the cached origin is what
|
|
453
|
+
the pointer is measured against. Passive, because nothing here cancels. */
|
|
454
|
+
window.addEventListener('scroll', this.handleScroll, { capture: true, passive: true });
|
|
455
|
+
this.sized = new ResizeObserver(() => {
|
|
456
|
+
/* **A resize repaints unconditionally, where a resize used to ask.**
|
|
457
|
+
`measure` clears the drawing buffer whenever it resizes it, because
|
|
458
|
+
assigning `canvas.width` is a reset and not a hint. `paintOnce` declines
|
|
459
|
+
while the loop holds a frame handle, which is right for a property
|
|
460
|
+
change the loop is about to draw anyway and wrong here: the canvas is
|
|
461
|
+
already transparent by the time it declines, so the fallback gradient
|
|
462
|
+
underneath showed through until the next tick landed. One frame, on
|
|
463
|
+
every reflow that changed the box. */
|
|
464
|
+
if (!this.measure()) {
|
|
465
|
+
this.paintOnce();
|
|
466
|
+
return;
|
|
467
|
+
}
|
|
468
|
+
if (this.opened) {
|
|
469
|
+
this.paint();
|
|
470
|
+
this.play();
|
|
471
|
+
return;
|
|
472
|
+
}
|
|
473
|
+
this.open();
|
|
474
|
+
});
|
|
475
|
+
this.sized.observe(this);
|
|
476
|
+
this.readPalette();
|
|
477
|
+
if (this.measure()) {
|
|
478
|
+
this.open();
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
/**
|
|
482
|
+
* The context and the program, from whatever canvas can still give one.
|
|
483
|
+
*
|
|
484
|
+
* **A canvas whose context was force-lost never yields a working one again**,
|
|
485
|
+
* and the release below used to assume the opposite: `getContext` hands back
|
|
486
|
+
* the very same dead object, which reports `isContextLost()` and answers
|
|
487
|
+
* `null` to every `getShaderParameter`. So `link` failed, `start` returned
|
|
488
|
+
* before installing a single observer, and the element sat connected and
|
|
489
|
+
* permanently blind, holding whatever buffer it last painted. Measured on the
|
|
490
|
+
* landing page, where one remove-and-reinsert was enough: the frozen frame
|
|
491
|
+
* was the 2x2 the first `measure` took before layout, stretched across two
|
|
492
|
+
* screens as a gray smear that reads as a broken gradient rather than as a
|
|
493
|
+
* dead component. The only sound in the console was `getShaderInfoLog`
|
|
494
|
+
* answering `null`, twice per element.
|
|
495
|
+
*
|
|
496
|
+
* A spent canvas is therefore replaced rather than re-asked. `restoreContext`
|
|
497
|
+
* is the other way and is not reachable from here: it needs the `webglcontextlost`
|
|
498
|
+
* event default-prevented and the extension held from before the loss, and it
|
|
499
|
+
* restores asynchronously, so `start` would have to become a state machine to
|
|
500
|
+
* use it. A fresh canvas is synchronous and cannot half-succeed.
|
|
501
|
+
*/
|
|
502
|
+
build() {
|
|
503
|
+
let canvas = this.renderRoot.querySelector('canvas');
|
|
504
|
+
if (!canvas) {
|
|
505
|
+
return false;
|
|
506
|
+
}
|
|
507
|
+
/* `antialias` off, because nothing here has a geometric edge to alias:
|
|
508
|
+
every boundary is a gradient the shader computes. Multisampling would
|
|
509
|
+
allocate a second screen-sized buffer to average pixels already smooth.
|
|
510
|
+
`preserveDrawingBuffer` off too, which costs the ability to sample the
|
|
511
|
+
canvas from a test and saves a full-screen copy on every frame. */
|
|
512
|
+
let gl = canvas.getContext('webgl2', HelixAura_1.CONTEXT);
|
|
513
|
+
if (gl?.isContextLost()) {
|
|
514
|
+
/* Swapped under Lit, which is safe because the template is static: the
|
|
515
|
+
strings never change, so no re-render ever touches this node again. */
|
|
516
|
+
const fresh = document.createElement('canvas');
|
|
517
|
+
fresh.setAttribute('part', 'canvas');
|
|
518
|
+
fresh.setAttribute('aria-hidden', 'true');
|
|
519
|
+
canvas.replaceWith(fresh);
|
|
520
|
+
canvas = fresh;
|
|
521
|
+
/* Cleared, so `measure` sizes the new buffer rather than comparing it
|
|
522
|
+
against the spent one's dimensions and returning early. */
|
|
523
|
+
this.width = 0;
|
|
524
|
+
this.height = 0;
|
|
525
|
+
gl = canvas.getContext('webgl2', HelixAura_1.CONTEXT);
|
|
526
|
+
}
|
|
527
|
+
this.canvas = canvas;
|
|
528
|
+
this.gl = gl;
|
|
529
|
+
if (!gl || gl.isContextLost()) {
|
|
530
|
+
return false;
|
|
531
|
+
}
|
|
532
|
+
this.program = this.link(VERTEX, FRAGMENT);
|
|
533
|
+
if (!this.program) {
|
|
534
|
+
return false;
|
|
535
|
+
}
|
|
536
|
+
gl.useProgram(this.program);
|
|
537
|
+
for (const name of [
|
|
538
|
+
'uBloom',
|
|
539
|
+
'uGain',
|
|
540
|
+
'uGlow',
|
|
541
|
+
'uGround',
|
|
542
|
+
'uHaze',
|
|
543
|
+
'uInk',
|
|
544
|
+
'uInteraction',
|
|
545
|
+
'uPeak',
|
|
546
|
+
'uPointer',
|
|
547
|
+
'uReach',
|
|
548
|
+
'uResolution',
|
|
549
|
+
'uScale',
|
|
550
|
+
'uShape',
|
|
551
|
+
'uTilt',
|
|
552
|
+
'uTime',
|
|
553
|
+
'uTrail',
|
|
554
|
+
'uVariance',
|
|
555
|
+
]) {
|
|
556
|
+
this.uniforms[name] = gl.getUniformLocation(this.program, name);
|
|
557
|
+
}
|
|
558
|
+
return true;
|
|
559
|
+
}
|
|
560
|
+
connectedCallback() {
|
|
561
|
+
super.connectedCallback();
|
|
562
|
+
/* A move is a removal followed by an insertion, so the release scheduled a
|
|
563
|
+
moment ago was never about this element going away. Canceled here, which
|
|
564
|
+
is what makes a framework reorder cost no GL work at all. */
|
|
565
|
+
if (this.release) {
|
|
566
|
+
clearTimeout(this.release);
|
|
567
|
+
this.release = 0;
|
|
568
|
+
}
|
|
569
|
+
if (this.hasUpdated) {
|
|
570
|
+
this.start();
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
updated() {
|
|
574
|
+
/* A property change has to reach the screen even when the loop is stopped,
|
|
575
|
+
which is every reader who asked for no motion. The canvas holds its last
|
|
576
|
+
frame and no re-render repaints it. */
|
|
577
|
+
this.paintOnce();
|
|
578
|
+
}
|
|
579
|
+
disconnectedCallback() {
|
|
580
|
+
super.disconnectedCallback();
|
|
581
|
+
this.stop();
|
|
582
|
+
this.visible?.disconnect();
|
|
583
|
+
this.visible = undefined;
|
|
584
|
+
this.removeEventListener('pointermove', this.handlePointer);
|
|
585
|
+
this.removeEventListener('pointerleave', this.handleLeave);
|
|
586
|
+
document.removeEventListener('visibilitychange', this.handleVisibility);
|
|
587
|
+
window.removeEventListener('scroll', this.handleScroll, { capture: true });
|
|
588
|
+
this.sized?.disconnect();
|
|
589
|
+
this.sized = undefined;
|
|
590
|
+
/* **Deferred by a task, and canceled by a reconnection.**
|
|
591
|
+
*
|
|
592
|
+
* The DOM has no signal for a move: a framework reordering its children
|
|
593
|
+
* removes the node and inserts it again, and the element is told only that
|
|
594
|
+
* it was disconnected. Releasing the context there punished every reorder
|
|
595
|
+
* for a departure that never happened, and the landing page reorders three
|
|
596
|
+
* auras on the way in. An insertion in the same task cancels this, so a
|
|
597
|
+
* move is free and a real removal still pays a task later.
|
|
598
|
+
*
|
|
599
|
+
* A task rather than a microtask, because what has to fit inside the window
|
|
600
|
+
* is a framework's whole commit rather than one call. */
|
|
601
|
+
this.release = window.setTimeout(this.drop, 0);
|
|
602
|
+
}
|
|
603
|
+
/**
|
|
604
|
+
* Resolves the ramp. Called when the palette moves, not when a frame draws.
|
|
605
|
+
*
|
|
606
|
+
* Light pages peak on a deep brand blue and dark ones on the foreground, and
|
|
607
|
+
* the ground is what says which: mixing a saturated hue toward near-black
|
|
608
|
+
* takes the chroma out of exactly the pixels carrying the most of it. Read
|
|
609
|
+
* from the ground's own luminance rather than asked of the color mode, which
|
|
610
|
+
* is a private token this tier may not reach for.
|
|
611
|
+
*/
|
|
612
|
+
readPalette() {
|
|
613
|
+
const ground = this.tokens.read('--helix-color-background', [0, 0, 0]);
|
|
614
|
+
const light = ground[0] * 0.2126 + ground[1] * 0.7152 + ground[2] * 0.0722 > 0.5;
|
|
615
|
+
this.palette = {
|
|
616
|
+
glow: this.tokens.read('--helix-color-primary', [0.29, 0.61, 1]),
|
|
617
|
+
ground,
|
|
618
|
+
haze: this.tokens.read('--helix-color-primary-subtle', [0.02, 0.15, 0.34]),
|
|
619
|
+
peak: light
|
|
620
|
+
? this.tokens.read('--helix-color-primary-active', [0.1, 0.2, 0.55])
|
|
621
|
+
: this.tokens.read('--helix-color-foreground', [1, 1, 1]),
|
|
622
|
+
};
|
|
623
|
+
}
|
|
624
|
+
link(vertex, fragment) {
|
|
625
|
+
const gl = this.gl;
|
|
626
|
+
if (!gl) {
|
|
627
|
+
return null;
|
|
628
|
+
}
|
|
629
|
+
const compile = (type, source) => {
|
|
630
|
+
const shader = gl.createShader(type);
|
|
631
|
+
if (!shader) {
|
|
632
|
+
return null;
|
|
633
|
+
}
|
|
634
|
+
gl.shaderSource(shader, source);
|
|
635
|
+
gl.compileShader(shader);
|
|
636
|
+
if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
|
|
637
|
+
console.error(gl.getShaderInfoLog(shader));
|
|
638
|
+
gl.deleteShader(shader);
|
|
639
|
+
return null;
|
|
640
|
+
}
|
|
641
|
+
return shader;
|
|
642
|
+
};
|
|
643
|
+
const vs = compile(gl.VERTEX_SHADER, vertex);
|
|
644
|
+
const fs = compile(gl.FRAGMENT_SHADER, fragment);
|
|
645
|
+
const program = vs && fs ? gl.createProgram() : null;
|
|
646
|
+
if (!vs || !fs || !program) {
|
|
647
|
+
return null;
|
|
648
|
+
}
|
|
649
|
+
gl.attachShader(program, vs);
|
|
650
|
+
gl.attachShader(program, fs);
|
|
651
|
+
gl.linkProgram(program);
|
|
652
|
+
gl.deleteShader(vs);
|
|
653
|
+
gl.deleteShader(fs);
|
|
654
|
+
return program;
|
|
655
|
+
}
|
|
656
|
+
/**
|
|
657
|
+
* Re-reads the box and resizes the drawing buffer to match.
|
|
658
|
+
*
|
|
659
|
+
* **Called from the observer, never from the frame.** `clientWidth` is a
|
|
660
|
+
* layout read, and doing it in `tick` meant a forced synchronous layout on
|
|
661
|
+
* every single frame to learn a number that changes when the box changes and
|
|
662
|
+
* at no other time. A `ResizeObserver` is told when that is.
|
|
663
|
+
*
|
|
664
|
+
* Returns whether the drawing buffer was resized, which is the same question
|
|
665
|
+
* as whether it was cleared, and so whether the caller owes it a frame.
|
|
666
|
+
*/
|
|
667
|
+
measure() {
|
|
668
|
+
/* Read through `this` rather than destructured, which is not a style
|
|
669
|
+
preference: `noUnusedPrivateClassMembers` does not count a destructured
|
|
670
|
+
read, so a `const { canvas } = this` here is the field's only use and the
|
|
671
|
+
rule offers to delete the field. `TokenColorController` carries the same
|
|
672
|
+
false positive under a suppression; this one costs a word instead. */
|
|
673
|
+
const canvas = this.canvas;
|
|
674
|
+
const gl = this.gl;
|
|
675
|
+
if (!canvas || !gl) {
|
|
676
|
+
return false;
|
|
677
|
+
}
|
|
678
|
+
const rect = this.getBoundingClientRect();
|
|
679
|
+
/* **An empty rect is layout that has not happened, not a box a pixel
|
|
680
|
+
across.** These two were `Math.max(rect.width, 1)`, which never reports a
|
|
681
|
+
bad measurement and instead manufactures a plausible one. Before first
|
|
682
|
+
layout the rect is 0 by 0, so the clamp produced a 1 by 1 box, and every
|
|
683
|
+
line below faithfully computed a drawing buffer for it: two pixels by
|
|
684
|
+
two. The shader then painted four pixels and the compositor stretched
|
|
685
|
+
them over the whole page.
|
|
686
|
+
|
|
687
|
+
That is the settle. The field opened as one enormous soft blob, held it
|
|
688
|
+
until a real box arrived, and snapped to its true feature size, which
|
|
689
|
+
reads as the background scaling down. Instrumented on a reload it logged
|
|
690
|
+
`boxH: 1, bufH: 2` at 216ms with `readyState: "complete"`.
|
|
691
|
+
|
|
692
|
+
Declining is the whole fix. There is nothing worth drawing yet and the
|
|
693
|
+
observer below is already waiting to say when there is; the host's own
|
|
694
|
+
gradient covers the gap, which is what it is for. */
|
|
695
|
+
if (rect.width < 1 || rect.height < 1) {
|
|
696
|
+
return false;
|
|
697
|
+
}
|
|
698
|
+
this.box = {
|
|
699
|
+
height: rect.height,
|
|
700
|
+
left: rect.left,
|
|
701
|
+
top: rect.top,
|
|
702
|
+
width: rect.width,
|
|
703
|
+
};
|
|
704
|
+
/* Capped at two, and a little under native beneath that. Every pixel runs
|
|
705
|
+
five octaves of noise through two warps, and a 6K display at its full
|
|
706
|
+
ratio is four times the work for a gradient nobody can resolve. Not as
|
|
707
|
+
far under as it was: a parallax shift resolves on the buffer's own grid,
|
|
708
|
+
so an aggressive scale makes the field step as it slides. */
|
|
709
|
+
let dpr = Math.min(window.devicePixelRatio || 1, 2) * 0.85;
|
|
710
|
+
/* **Then capped again against the box, because a ratio is not a budget.**
|
|
711
|
+
The number above answers "how fine per CSS pixel" and says nothing about
|
|
712
|
+
how many there are, which is fine while a field is a screen or two and
|
|
713
|
+
stops being fine the moment one is asked to light a whole page. Measured
|
|
714
|
+
on the landing page at 1280 by 6330: 2176 by 10761, or 23.4 million
|
|
715
|
+
pixels of five-octave noise every frame, against the 5.3 million the same
|
|
716
|
+
component costs over two screens.
|
|
717
|
+
|
|
718
|
+
Two separate ceilings, because they fail differently.
|
|
719
|
+
|
|
720
|
+
An edge past `MAX_RENDERBUFFER_SIZE` does not render slowly, it does not
|
|
721
|
+
render. WebGL2 guarantees only 2048, and while desktops report 16384 the
|
|
722
|
+
8192 that older integrated parts report is under that same 10761: the
|
|
723
|
+
aura would have been missing outright rather than expensive, and only on
|
|
724
|
+
the machines least able to say so. 4096 clears the guarantee twice over
|
|
725
|
+
and is far more than a field with no edge in it can show.
|
|
726
|
+
|
|
727
|
+
The pixel budget is the fill rate, and 2048 squared is close to what the
|
|
728
|
+
component already cost at the size it was designed for, so a page-length
|
|
729
|
+
field now costs about what a hero-sized one did rather than four of them.
|
|
730
|
+
|
|
731
|
+
Both are applied to `dpr` rather than to the dimensions, so width and
|
|
732
|
+
height come down together. The shader corrects for aspect off
|
|
733
|
+
`uResolution`, and scaling one axis alone would stretch the shape. */
|
|
734
|
+
const edge = Math.max(this.box.width, this.box.height) * dpr;
|
|
735
|
+
if (edge > MAX_CANVAS_EDGE) {
|
|
736
|
+
dpr *= MAX_CANVAS_EDGE / edge;
|
|
737
|
+
}
|
|
738
|
+
const pixels = this.box.width * this.box.height * dpr * dpr;
|
|
739
|
+
if (pixels > MAX_CANVAS_PIXELS) {
|
|
740
|
+
dpr *= Math.sqrt(MAX_CANVAS_PIXELS / pixels);
|
|
741
|
+
}
|
|
742
|
+
const width = Math.round(this.box.width * dpr);
|
|
743
|
+
const height = Math.round(this.box.height * dpr);
|
|
744
|
+
if (width === this.width && height === this.height) {
|
|
745
|
+
return false;
|
|
746
|
+
}
|
|
747
|
+
this.width = width;
|
|
748
|
+
this.height = height;
|
|
749
|
+
canvas.width = width;
|
|
750
|
+
canvas.height = height;
|
|
751
|
+
gl.viewport(0, 0, width, height);
|
|
752
|
+
gl.uniform2f(this.uniforms.uResolution ?? null, width, height);
|
|
753
|
+
return true;
|
|
754
|
+
}
|
|
755
|
+
paint() {
|
|
756
|
+
const { gl, uniforms } = this;
|
|
757
|
+
/* `width` is zero until a measurement succeeded, and a paint before that is
|
|
758
|
+
a paint into the degenerate buffer described on `measure`. Guarded here
|
|
759
|
+
rather than at each caller because `play` is started from the
|
|
760
|
+
intersection observer and from `visibilitychange` as well as from setup,
|
|
761
|
+
and one of those running early is the whole fault. */
|
|
762
|
+
if (!gl || !this.program || !this.width) {
|
|
763
|
+
return;
|
|
764
|
+
}
|
|
765
|
+
const { glow, ground, haze, peak } = this.palette;
|
|
766
|
+
gl.uniform3fv(uniforms.uGround ?? null, ground);
|
|
767
|
+
gl.uniform3fv(uniforms.uHaze ?? null, haze);
|
|
768
|
+
gl.uniform3fv(uniforms.uGlow ?? null, glow);
|
|
769
|
+
gl.uniform3fv(uniforms.uPeak ?? null, peak);
|
|
770
|
+
gl.uniform1f(uniforms.uTime ?? null, this.elapsed);
|
|
771
|
+
gl.uniform1i(uniforms.uShape ?? null, SHAPES.indexOf(this.variant ?? 'braid'));
|
|
772
|
+
/* Each axis wanders on its own period. The seeds are deliberately not
|
|
773
|
+
simple ratios of each other: two axes on periods that divide would come
|
|
774
|
+
back into phase and give the whole field a beat. */
|
|
775
|
+
gl.uniform1f(uniforms.uTilt ?? null, this.drifted(this.bearing, 14, 0.037));
|
|
776
|
+
gl.uniform1f(uniforms.uScale ?? null, this.drifted(this.scale, 0.32, 0.061));
|
|
777
|
+
gl.uniform1f(uniforms.uBloom ?? null, this.drifted(this.bloom, 0.22, 0.029));
|
|
778
|
+
gl.uniform1f(uniforms.uGain ?? null, this.drifted(this.gain, 0.3, 0.053));
|
|
779
|
+
gl.uniform1f(uniforms.uVariance ?? null, this.variance);
|
|
780
|
+
/* Unrolled oldest first, with the live head appended last. `trailNext` is
|
|
781
|
+
the next slot to be written and so the oldest again, now that the head no
|
|
782
|
+
longer lives in the ring. */
|
|
783
|
+
for (let i = 0; i < 8; i++) {
|
|
784
|
+
const from = ((this.trailNext + i) % 8) * 3;
|
|
785
|
+
const to = i * 3;
|
|
786
|
+
this.ordered[to] = this.trail[from] ?? 1;
|
|
787
|
+
this.ordered[to + 1] = this.trail[from + 1] ?? 1;
|
|
788
|
+
this.ordered[to + 2] = this.trail[from + 2] ?? 1;
|
|
789
|
+
}
|
|
790
|
+
this.ordered[24] = this.head.x;
|
|
791
|
+
this.ordered[25] = this.head.y;
|
|
792
|
+
this.ordered[26] = 0;
|
|
793
|
+
gl.uniform3fv(uniforms.uTrail ?? null, this.ordered);
|
|
794
|
+
gl.uniform2f(uniforms.uPointer ?? null, this.eased.x, this.eased.y);
|
|
795
|
+
gl.uniform1f(uniforms.uReach ?? null, this.eased.presence * Math.max(0, this.reach));
|
|
796
|
+
gl.uniform1i(uniforms.uInteraction ?? null, Math.max(0, INTERACTIONS.indexOf(this.interaction ?? 'native')));
|
|
797
|
+
gl.drawArrays(gl.TRIANGLES, 0, 3);
|
|
798
|
+
}
|
|
799
|
+
/**
|
|
800
|
+
* The opening frame, one animation frame after the box last changed.
|
|
801
|
+
*
|
|
802
|
+
* Each new measurement cancels the pending frame and books another, so a run
|
|
803
|
+
* of resizes collapses to a single paint at the end of it rather than one per
|
|
804
|
+
* step. `openBy` stops that from being unbounded.
|
|
805
|
+
*/
|
|
806
|
+
open() {
|
|
807
|
+
if (this.opening) {
|
|
808
|
+
cancelAnimationFrame(this.opening);
|
|
809
|
+
this.opening = 0;
|
|
810
|
+
}
|
|
811
|
+
if (this.openBy === 0) {
|
|
812
|
+
this.openBy = performance.now() + OPENING_PATIENCE;
|
|
813
|
+
}
|
|
814
|
+
const draw = () => {
|
|
815
|
+
this.opening = 0;
|
|
816
|
+
this.opened = true;
|
|
817
|
+
this.paint();
|
|
818
|
+
this.play();
|
|
819
|
+
};
|
|
820
|
+
if (performance.now() >= this.openBy) {
|
|
821
|
+
draw();
|
|
822
|
+
return;
|
|
823
|
+
}
|
|
824
|
+
this.opening = requestAnimationFrame(draw);
|
|
825
|
+
}
|
|
826
|
+
/** One frame, now, for a change that has to show while the loop is stopped. */
|
|
827
|
+
paintOnce() {
|
|
828
|
+
if (this.frame) {
|
|
829
|
+
return;
|
|
830
|
+
}
|
|
831
|
+
this.paint();
|
|
832
|
+
}
|
|
833
|
+
/**
|
|
834
|
+
* The shortest gap between two painted frames, for a field nobody points at.
|
|
835
|
+
*
|
|
836
|
+
* **A drifting field does not need the display's rate and a pointer does.**
|
|
837
|
+
* `tick` advances on `(now - this.last) / 1000`, so motion is wall-clock: at
|
|
838
|
+
* half the frames the field moves the same distance in the same time, sampled
|
|
839
|
+
* more coarsely. `delta` is already clamped at 0.05, which is a floor of 20
|
|
840
|
+
* frames a second, and 30 sits inside that with room. A cap at 15 would land
|
|
841
|
+
* on the clamp and the field would genuinely drag, which is the failure that
|
|
842
|
+
* would be misdiagnosed as choppiness.
|
|
843
|
+
*
|
|
844
|
+
* **`interactive` is the exception and it is the whole exception.** The
|
|
845
|
+
* element eases `presence` toward the pointer on a 50ms rise constant, so at
|
|
846
|
+
* 33ms a frame the entire response is one or two samples and the follow reads
|
|
847
|
+
* as a lag rather than a lightness. Every field on the landing page leaves
|
|
848
|
+
* `interactive` unset; the only one that sets it is the lab on
|
|
849
|
+
* `/helix/aura`, where it is a toggle a reader chose. So the cap applies where
|
|
850
|
+
* nothing is being followed and lifts where something is.
|
|
851
|
+
*
|
|
852
|
+
* **Measured before it was capped, because the cost had changed.** 252 was
|
|
853
|
+
* filed against one field on the first two screens. It is three now, one per
|
|
854
|
+
* transparent run of the page, and with the frame limiter off they drew 2,654
|
|
855
|
+
* times in three seconds against 1,276 for one: the work scales with the count
|
|
856
|
+
* because each instance draws once per callback. Capping the two that nobody
|
|
857
|
+
* points at is most of that back.
|
|
858
|
+
*/
|
|
859
|
+
static { this.CAPPED = 1000 / 30; }
|
|
860
|
+
play() {
|
|
861
|
+
if (this.frame ||
|
|
862
|
+
this.motion?.matches ||
|
|
863
|
+
document.hidden ||
|
|
864
|
+
!this.gl ||
|
|
865
|
+
!this.width ||
|
|
866
|
+
!this.opened) {
|
|
867
|
+
return;
|
|
868
|
+
}
|
|
869
|
+
this.frame = requestAnimationFrame(this.tick);
|
|
870
|
+
}
|
|
871
|
+
stop() {
|
|
872
|
+
if (this.frame) {
|
|
873
|
+
cancelAnimationFrame(this.frame);
|
|
874
|
+
this.frame = 0;
|
|
875
|
+
}
|
|
876
|
+
/* `last` alone is cleared, so the next frame measures no delta against a
|
|
877
|
+
stale stamp. `elapsed` is deliberately kept. */
|
|
878
|
+
this.last = 0;
|
|
879
|
+
}
|
|
880
|
+
/*
|
|
881
|
+
* One axis, wandering around its set value.
|
|
882
|
+
*
|
|
883
|
+
* Two sines at an irrational ratio rather than one, so a single axis has no
|
|
884
|
+
* period of its own either. Bounded by construction: the weights sum to one,
|
|
885
|
+
* so the value never leaves `base` plus or minus `span`.
|
|
886
|
+
*/
|
|
887
|
+
/**
|
|
888
|
+
* The angle actually drawn, which is `terminus` resolved against the box.
|
|
889
|
+
*
|
|
890
|
+
* A getter rather than a stored value because the box changes and this has no
|
|
891
|
+
* business knowing when: it is read once per frame from numbers already
|
|
892
|
+
* there.
|
|
893
|
+
*
|
|
894
|
+
* The solve is `tiltFor` in `aura-axis.ts` rather than an expression here,
|
|
895
|
+
* and that is the fix for how this went wrong twice. Both times the
|
|
896
|
+
* arithmetic sat inside this getter next to a sentence describing different
|
|
897
|
+
* arithmetic, and nothing in the repository could tell they disagreed. It is
|
|
898
|
+
* callable now, and `aura-root.dom.spec.ts` runs it against a model of the
|
|
899
|
+
* shader in both directions. See 155.
|
|
900
|
+
*/
|
|
901
|
+
get bearing() {
|
|
902
|
+
if (this.terminus === undefined) {
|
|
903
|
+
return this.tilt;
|
|
904
|
+
}
|
|
905
|
+
const { height, width } = this.box;
|
|
906
|
+
return tiltFor(this.terminus, width / Math.max(height, 1));
|
|
907
|
+
}
|
|
908
|
+
drifted(base, span, seed) {
|
|
909
|
+
if (!this.drift) {
|
|
910
|
+
return base;
|
|
911
|
+
}
|
|
912
|
+
const t = this.elapsed;
|
|
913
|
+
const wave = Math.sin(t * seed) * 0.6 + Math.sin(t * seed * 1.618 + 2.1) * 0.4;
|
|
914
|
+
return base + span * this.drift * wave;
|
|
915
|
+
}
|
|
916
|
+
/** Ages the wake, and drops a fresh mark where the pointer has moved far. */
|
|
917
|
+
age(delta) {
|
|
918
|
+
/* Two seconds to fade. Long enough that a wake outlives the gesture that
|
|
919
|
+
made it, which is the whole effect, and short enough that a page left
|
|
920
|
+
alone settles rather than keeping a drawing nobody made. */
|
|
921
|
+
for (let i = 2; i < this.trail.length; i += 3) {
|
|
922
|
+
const next = (this.trail[i] ?? 1) + delta / 2;
|
|
923
|
+
this.trail[i] = next > 1 ? 1 : next;
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
/**
|
|
927
|
+
* Keeps the head of the wake on the cursor, and commits it as it travels.
|
|
928
|
+
*
|
|
929
|
+
* **The head used to be a committed mark, and that was both faults at once.**
|
|
930
|
+
* Marks are spaced by distance so eight slots cover a gesture rather than the
|
|
931
|
+
* last few milliseconds of one, but committing was also the only time the
|
|
932
|
+
* stroke grew: its leading end therefore sat up to a full gate behind the
|
|
933
|
+
* pointer, and caught up in jumps of exactly that size. Latent, and jagged,
|
|
934
|
+
* for one reason.
|
|
935
|
+
*
|
|
936
|
+
* So the slot at `trailNext` is provisional. It is rewritten every frame to
|
|
937
|
+
* wherever the field has actually eased to, which is where the cursor looks
|
|
938
|
+
* like it is, so the stroke always reaches the pointer. Crossing the gate does
|
|
939
|
+
* not move the head, it just stops the previous position from being
|
|
940
|
+
* overwritten, and a new provisional head starts from there. The wake grows
|
|
941
|
+
* continuously and is still only ever eight points.
|
|
942
|
+
*
|
|
943
|
+
* Measured against `eased` rather than `target`, or the stroke would reach a
|
|
944
|
+
* place the field has not arrived at yet and lead its own parallax.
|
|
945
|
+
*/
|
|
946
|
+
advanceWake() {
|
|
947
|
+
if (!this.interactive) {
|
|
948
|
+
return;
|
|
949
|
+
}
|
|
950
|
+
this.head.x = this.eased.x;
|
|
951
|
+
this.head.y = this.eased.y;
|
|
952
|
+
const last = ((this.trailNext + 7) % 8) * 3;
|
|
953
|
+
const dx = this.head.x - (this.trail[last] ?? 0);
|
|
954
|
+
const dy = this.head.y - (this.trail[last + 1] ?? 0);
|
|
955
|
+
if (dx * dx + dy * dy < 0.014) {
|
|
956
|
+
return;
|
|
957
|
+
}
|
|
958
|
+
const at = this.trailNext * 3;
|
|
959
|
+
this.trail[at] = this.head.x;
|
|
960
|
+
this.trail[at + 1] = this.head.y;
|
|
961
|
+
this.trail[at + 2] = 0;
|
|
962
|
+
this.trailNext = (this.trailNext + 1) % 8;
|
|
963
|
+
/* Every other mark ages a slot's worth on each commit, on top of ageing
|
|
964
|
+
with time.
|
|
965
|
+
|
|
966
|
+
Time alone is not enough, because what has to be spent by the moment the
|
|
967
|
+
ring reuses a slot is a function of *distance traveled*, not of seconds:
|
|
968
|
+
marks commit every gate length, so a brisk gesture laps the ring long
|
|
969
|
+
before a two second fade has taken the oldest down, and overwriting a
|
|
970
|
+
mark that is still bright is a pop at the tail.
|
|
971
|
+
|
|
972
|
+
A seventh, not an eighth. A mark is written at nought and is skipped on
|
|
973
|
+
its own commit, so it collects exactly seven increments before its slot
|
|
974
|
+
comes round again. Measured at an eighth, every overwritten slot stood at
|
|
975
|
+
0.875: faint, and not gone, and a faint point vanishing is still a pop. */
|
|
976
|
+
for (let i = 2; i < this.trail.length; i += 3) {
|
|
977
|
+
if (i === at + 2) {
|
|
978
|
+
continue;
|
|
979
|
+
}
|
|
980
|
+
const next = (this.trail[i] ?? 1) + 1 / 7;
|
|
981
|
+
this.trail[i] = next > 1 ? 1 : next;
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
};
|
|
985
|
+
__decorate([
|
|
986
|
+
property({ reflect: true })
|
|
987
|
+
], HelixAura.prototype, "variant", void 0);
|
|
988
|
+
__decorate([
|
|
989
|
+
property({ type: Number })
|
|
990
|
+
], HelixAura.prototype, "drift", void 0);
|
|
991
|
+
__decorate([
|
|
992
|
+
property()
|
|
993
|
+
], HelixAura.prototype, "interaction", void 0);
|
|
994
|
+
__decorate([
|
|
995
|
+
property({ type: Number })
|
|
996
|
+
], HelixAura.prototype, "reach", void 0);
|
|
997
|
+
__decorate([
|
|
998
|
+
property({ reflect: true, type: Boolean })
|
|
999
|
+
], HelixAura.prototype, "interactive", void 0);
|
|
1000
|
+
__decorate([
|
|
1001
|
+
property({ type: Number })
|
|
1002
|
+
], HelixAura.prototype, "bloom", void 0);
|
|
1003
|
+
__decorate([
|
|
1004
|
+
property({ type: Number })
|
|
1005
|
+
], HelixAura.prototype, "gain", void 0);
|
|
1006
|
+
__decorate([
|
|
1007
|
+
property({ type: Number })
|
|
1008
|
+
], HelixAura.prototype, "scale", void 0);
|
|
1009
|
+
__decorate([
|
|
1010
|
+
property({ type: Number })
|
|
1011
|
+
], HelixAura.prototype, "speed", void 0);
|
|
1012
|
+
__decorate([
|
|
1013
|
+
property({ type: Number })
|
|
1014
|
+
], HelixAura.prototype, "tilt", void 0);
|
|
1015
|
+
__decorate([
|
|
1016
|
+
property({ type: Number })
|
|
1017
|
+
], HelixAura.prototype, "terminus", void 0);
|
|
1018
|
+
__decorate([
|
|
1019
|
+
property({ type: Number })
|
|
1020
|
+
], HelixAura.prototype, "variance", void 0);
|
|
1021
|
+
HelixAura = HelixAura_1 = __decorate([
|
|
1022
|
+
customElement('helix-aura')
|
|
1023
|
+
], HelixAura);
|
|
1024
|
+
export { HelixAura };
|