ngwr 16.4.0 → 16.6.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/back-top/styles/_index.scss +6 -0
- package/breadcrumbs/styles/_rules.scss +34 -0
- package/cascader/styles/_rules.scss +7 -0
- package/charts/bar-chart/styles/_index.scss +494 -305
- package/charts/boxplot-chart/styles/_index.scss +114 -48
- package/charts/bullet-chart/styles/_index.scss +113 -42
- package/charts/calendar-heatmap/styles/_index.scss +111 -20
- package/charts/candlestick-chart/styles/_index.scss +61 -26
- package/charts/chart-legend/styles/_index.scss +120 -10
- package/charts/core/styles/_index.scss +201 -5
- package/charts/donut-chart/styles/_index.scss +76 -21
- package/charts/funnel-chart/styles/_index.scss +66 -38
- package/charts/gauge/styles/_index.scss +12 -1
- package/charts/heatmap-chart/styles/_index.scss +90 -53
- package/charts/line-chart/styles/_index.scss +143 -139
- package/charts/meter-group/styles/_index.scss +87 -25
- package/charts/radar-chart/styles/_index.scss +82 -40
- package/charts/scatter-chart/styles/_index.scss +117 -44
- package/charts/sparkline/styles/_index.scss +7 -1
- package/charts/treemap-chart/styles/_index.scss +94 -42
- package/charts/waterfall-chart/styles/_index.scss +150 -87
- package/color-picker/styles/_index.scss +7 -3
- package/copy-value/styles/_index.scss +21 -2
- package/counter/styles/_index.scss +1 -8
- package/date-picker/styles/_index.scss +15 -9
- package/date-stamp/styles/_index.scss +2 -1
- package/dialog/styles/_index.scss +43 -0
- package/drawer/styles/_index.scss +5 -1
- package/editor/styles/_index.scss +1 -8
- package/event-calendar/styles/_index.scss +2 -6
- package/fesm2022/ngwr-affix.mjs +1 -1
- package/fesm2022/ngwr-affix.mjs.map +1 -1
- package/fesm2022/ngwr-anchor.mjs +9 -2
- package/fesm2022/ngwr-anchor.mjs.map +1 -1
- package/fesm2022/ngwr-animations-aurora.mjs.map +1 -1
- package/fesm2022/ngwr-animations-blur-reveal.mjs.map +1 -1
- package/fesm2022/ngwr-animations-click-sparks.mjs.map +1 -1
- package/fesm2022/ngwr-animations-confetti.mjs.map +1 -1
- package/fesm2022/ngwr-animations-decode.mjs.map +1 -1
- package/fesm2022/ngwr-animations-destruct.mjs.map +1 -1
- package/fesm2022/ngwr-animations-dot-grid.mjs.map +1 -1
- package/fesm2022/ngwr-animations-falling-letters.mjs.map +1 -1
- package/fesm2022/ngwr-animations-flow-lines.mjs.map +1 -1
- package/fesm2022/ngwr-animations-fluid-cursor.mjs.map +1 -1
- package/fesm2022/ngwr-animations-glitch.mjs.map +1 -1
- package/fesm2022/ngwr-animations-glow-border.mjs.map +1 -1
- package/fesm2022/ngwr-animations-gradient-flow.mjs.map +1 -1
- package/fesm2022/ngwr-animations-marquee.mjs.map +1 -1
- package/fesm2022/ngwr-animations-orbit.mjs.map +1 -1
- package/fesm2022/ngwr-animations-reveal.mjs.map +1 -1
- package/fesm2022/ngwr-animations-ripple-grid.mjs.map +1 -1
- package/fesm2022/ngwr-animations-rotate-reveal.mjs.map +1 -1
- package/fesm2022/ngwr-animations-shimmer.mjs.map +1 -1
- package/fesm2022/ngwr-animations-spotlight.mjs.map +1 -1
- package/fesm2022/ngwr-animations-thread-lines.mjs.map +1 -1
- package/fesm2022/ngwr-animations-tilt.mjs +20 -13
- package/fesm2022/ngwr-animations-tilt.mjs.map +1 -1
- package/fesm2022/ngwr-animations-typewriter.mjs.map +1 -1
- package/fesm2022/ngwr-breadcrumbs.mjs +40 -7
- package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngwr-button.mjs +12 -3
- package/fesm2022/ngwr-button.mjs.map +1 -1
- package/fesm2022/ngwr-carousel-testing.mjs +4 -1
- package/fesm2022/ngwr-carousel-testing.mjs.map +1 -1
- package/fesm2022/ngwr-carousel.mjs +27 -2
- package/fesm2022/ngwr-carousel.mjs.map +1 -1
- package/fesm2022/ngwr-cascader-testing.mjs.map +1 -1
- package/fesm2022/ngwr-cascader.mjs +72 -8
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-charts-bar-chart-testing.mjs +16 -14
- package/fesm2022/ngwr-charts-bar-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-bar-chart.mjs +399 -141
- package/fesm2022/ngwr-charts-bar-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-boxplot-chart-testing.mjs +19 -5
- package/fesm2022/ngwr-charts-boxplot-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-boxplot-chart.mjs +250 -56
- package/fesm2022/ngwr-charts-boxplot-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-bullet-chart.mjs +118 -18
- package/fesm2022/ngwr-charts-bullet-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-calendar-heatmap.mjs +266 -46
- package/fesm2022/ngwr-charts-calendar-heatmap.mjs.map +1 -1
- package/fesm2022/ngwr-charts-candlestick-chart-testing.mjs +21 -10
- package/fesm2022/ngwr-charts-candlestick-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-candlestick-chart.mjs +319 -72
- package/fesm2022/ngwr-charts-candlestick-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-chart-legend.mjs +211 -9
- package/fesm2022/ngwr-charts-chart-legend.mjs.map +1 -1
- package/fesm2022/ngwr-charts-core.mjs +311 -23
- package/fesm2022/ngwr-charts-core.mjs.map +1 -1
- package/fesm2022/ngwr-charts-donut-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-donut-chart.mjs +206 -27
- package/fesm2022/ngwr-charts-donut-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-funnel-chart-testing.mjs +4 -4
- package/fesm2022/ngwr-charts-funnel-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-funnel-chart.mjs +113 -10
- package/fesm2022/ngwr-charts-funnel-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-gauge-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-gauge.mjs +98 -12
- package/fesm2022/ngwr-charts-gauge.mjs.map +1 -1
- package/fesm2022/ngwr-charts-heatmap-chart.mjs +226 -31
- package/fesm2022/ngwr-charts-heatmap-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-line-chart-testing.mjs +16 -4
- package/fesm2022/ngwr-charts-line-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-line-chart.mjs +407 -172
- package/fesm2022/ngwr-charts-line-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-meter-group-testing.mjs +4 -4
- package/fesm2022/ngwr-charts-meter-group-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-meter-group.mjs +225 -31
- package/fesm2022/ngwr-charts-meter-group.mjs.map +1 -1
- package/fesm2022/ngwr-charts-radar-chart-testing.mjs +2 -1
- package/fesm2022/ngwr-charts-radar-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-radar-chart.mjs +255 -66
- package/fesm2022/ngwr-charts-radar-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-scatter-chart-testing.mjs +39 -18
- package/fesm2022/ngwr-charts-scatter-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-scatter-chart.mjs +431 -53
- package/fesm2022/ngwr-charts-scatter-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-sparkline.mjs +19 -8
- package/fesm2022/ngwr-charts-sparkline.mjs.map +1 -1
- package/fesm2022/ngwr-charts-treemap-chart.mjs +253 -44
- package/fesm2022/ngwr-charts-treemap-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-waterfall-chart-testing.mjs +15 -7
- package/fesm2022/ngwr-charts-waterfall-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-waterfall-chart.mjs +151 -23
- package/fesm2022/ngwr-charts-waterfall-chart.mjs.map +1 -1
- package/fesm2022/ngwr-checkbox.mjs +3 -2
- package/fesm2022/ngwr-checkbox.mjs.map +1 -1
- package/fesm2022/ngwr-color-picker.mjs +65 -5
- package/fesm2022/ngwr-color-picker.mjs.map +1 -1
- package/fesm2022/ngwr-context-menu-testing.mjs.map +1 -1
- package/fesm2022/ngwr-context-menu.mjs +51 -24
- package/fesm2022/ngwr-context-menu.mjs.map +1 -1
- package/fesm2022/ngwr-copy-value-testing.mjs +5 -1
- package/fesm2022/ngwr-copy-value-testing.mjs.map +1 -1
- package/fesm2022/ngwr-copy-value.mjs +38 -2
- package/fesm2022/ngwr-copy-value.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker.mjs +105 -9
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-dialog.mjs +29 -11
- package/fesm2022/ngwr-dialog.mjs.map +1 -1
- package/fesm2022/ngwr-directives.mjs +9 -6
- package/fesm2022/ngwr-directives.mjs.map +1 -1
- package/fesm2022/ngwr-drawer.mjs +19 -3
- package/fesm2022/ngwr-drawer.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +35 -6
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-editor.mjs +1 -0
- package/fesm2022/ngwr-editor.mjs.map +1 -1
- package/fesm2022/ngwr-event-calendar.mjs +20 -9
- package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-form.mjs +170 -3
- package/fesm2022/ngwr-form.mjs.map +1 -1
- package/fesm2022/ngwr-graph.mjs +81 -13
- package/fesm2022/ngwr-graph.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ar.mjs +20 -0
- package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-cs.mjs +20 -0
- package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-de.mjs +20 -0
- package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +20 -0
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-es.mjs +20 -0
- package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-fr.mjs +20 -0
- package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-he.mjs +20 -0
- package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-hi.mjs +20 -0
- package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-id.mjs +20 -0
- package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-it.mjs +20 -0
- package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ja.mjs +20 -0
- package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ko.mjs +20 -0
- package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-nl.mjs +20 -0
- package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pl.mjs +20 -0
- package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pt.mjs +20 -0
- package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +20 -0
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-sv.mjs +20 -0
- package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-tr.mjs +20 -0
- package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-uk.mjs +20 -0
- package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-vi.mjs +20 -0
- package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh-tw.mjs +20 -0
- package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh.mjs +20 -0
- package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
- package/fesm2022/ngwr-i18n.mjs +82 -11
- package/fesm2022/ngwr-i18n.mjs.map +1 -1
- package/fesm2022/ngwr-input-number.mjs +24 -1
- package/fesm2022/ngwr-input-number.mjs.map +1 -1
- package/fesm2022/ngwr-input-otp.mjs +2 -2
- package/fesm2022/ngwr-input-otp.mjs.map +1 -1
- package/fesm2022/ngwr-input.mjs +10 -2
- package/fesm2022/ngwr-input.mjs.map +1 -1
- package/fesm2022/ngwr-layout.mjs.map +1 -1
- package/fesm2022/ngwr-lightbox.mjs +20 -3
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-list.mjs +1 -1
- package/fesm2022/ngwr-list.mjs.map +1 -1
- package/fesm2022/ngwr-loading-bar-router.mjs.map +1 -1
- package/fesm2022/ngwr-loading-bar.mjs +2 -2
- package/fesm2022/ngwr-loading-bar.mjs.map +1 -1
- package/fesm2022/ngwr-mention.mjs +8 -0
- package/fesm2022/ngwr-mention.mjs.map +1 -1
- package/fesm2022/ngwr-meta.mjs +9 -6
- package/fesm2022/ngwr-meta.mjs.map +1 -1
- package/fesm2022/ngwr-overlay.mjs +21 -2
- package/fesm2022/ngwr-overlay.mjs.map +1 -1
- package/fesm2022/ngwr-page-header.mjs +21 -0
- package/fesm2022/ngwr-page-header.mjs.map +1 -1
- package/fesm2022/ngwr-pagination.mjs +2 -0
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-pipes.mjs +8 -1
- package/fesm2022/ngwr-pipes.mjs.map +1 -1
- package/fesm2022/ngwr-popconfirm-testing.mjs +4 -1
- package/fesm2022/ngwr-popconfirm-testing.mjs.map +1 -1
- package/fesm2022/ngwr-popconfirm.mjs +43 -6
- package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
- package/fesm2022/ngwr-popover.mjs +114 -15
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-qr.mjs +6 -2
- package/fesm2022/ngwr-qr.mjs.map +1 -1
- package/fesm2022/ngwr-radio.mjs +71 -5
- package/fesm2022/ngwr-radio.mjs.map +1 -1
- package/fesm2022/ngwr-schema-form.mjs +12 -1
- package/fesm2022/ngwr-schema-form.mjs.map +1 -1
- package/fesm2022/ngwr-scroll.mjs +1 -3
- package/fesm2022/ngwr-scroll.mjs.map +1 -1
- package/fesm2022/ngwr-segmented.mjs +20 -0
- package/fesm2022/ngwr-segmented.mjs.map +1 -1
- package/fesm2022/ngwr-select.mjs +80 -9
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-sortable-list.mjs +16 -4
- package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
- package/fesm2022/ngwr-storage.mjs +1 -1
- package/fesm2022/ngwr-storage.mjs.map +1 -1
- package/fesm2022/ngwr-switch.mjs +2 -2
- package/fesm2022/ngwr-switch.mjs.map +1 -1
- package/fesm2022/ngwr-table.mjs +43 -7
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tabs-router.mjs.map +1 -1
- package/fesm2022/ngwr-textarea.mjs +2 -2
- package/fesm2022/ngwr-textarea.mjs.map +1 -1
- package/fesm2022/ngwr-toast.mjs +28 -0
- package/fesm2022/ngwr-toast.mjs.map +1 -1
- package/fesm2022/ngwr-tour.mjs +16 -11
- package/fesm2022/ngwr-tour.mjs.map +1 -1
- package/fesm2022/ngwr-tree-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tree.mjs +49 -16
- package/fesm2022/ngwr-tree.mjs.map +1 -1
- package/fesm2022/ngwr-typography.mjs +20 -0
- package/fesm2022/ngwr-typography.mjs.map +1 -1
- package/fesm2022/ngwr-utils-router.mjs.map +1 -1
- package/fesm2022/ngwr-utils.mjs +46 -4
- package/fesm2022/ngwr-utils.mjs.map +1 -1
- package/fesm2022/ngwr-validators.mjs +33 -1
- package/fesm2022/ngwr-validators.mjs.map +1 -1
- package/fesm2022/ngwr-version.mjs +1 -1
- package/fesm2022/ngwr-version.mjs.map +1 -1
- package/fesm2022/ngwr-window.mjs +16 -9
- package/fesm2022/ngwr-window.mjs.map +1 -1
- package/form/styles/_index.scss +37 -0
- package/graph/styles/_index.scss +1 -9
- package/i18n/ar.json +20 -0
- package/i18n/cs.json +20 -0
- package/i18n/de.json +20 -0
- package/i18n/en.json +20 -0
- package/i18n/es.json +20 -0
- package/i18n/fr.json +20 -0
- package/i18n/he.json +20 -0
- package/i18n/hi.json +20 -0
- package/i18n/id.json +20 -0
- package/i18n/it.json +20 -0
- package/i18n/ja.json +20 -0
- package/i18n/ko.json +20 -0
- package/i18n/nl.json +20 -0
- package/i18n/pl.json +20 -0
- package/i18n/pt.json +20 -0
- package/i18n/ru.json +20 -0
- package/i18n/sv.json +20 -0
- package/i18n/tr.json +20 -0
- package/i18n/uk.json +20 -0
- package/i18n/vi.json +20 -0
- package/i18n/zh-TW.json +20 -0
- package/i18n/zh.json +20 -0
- package/image-cropper/styles/_index.scss +1 -9
- package/input-number/styles/_index.scss +7 -0
- package/layout/styles/_index.scss +13 -1
- package/llms-full.txt +17 -17
- package/llms.txt +7 -3
- package/loading-bar/styles/_rules.scss +6 -0
- package/package.json +2 -2
- package/page-header/styles/_index.scss +18 -0
- package/popconfirm/styles/_index.scss +6 -0
- package/popover/styles/_index.scss +31 -13
- package/schematics/use/symbol-map.json +3 -0
- package/segmented/styles/_index.scss +7 -0
- package/select/styles/_index.scss +7 -0
- package/sidebar/styles/_index.scss +6 -0
- package/skills/ngwr/references/catalog.md +2 -2
- package/sortable-list/styles/_rules.scss +1 -9
- package/speed-dial/styles/_index.scss +6 -0
- package/stepper/styles/_index.scss +1 -9
- package/table/styles/_index.scss +49 -0
- package/theme/_index.scss +12 -1
- package/theme/styles/_colors.scss +11 -0
- package/theme/styles/_contrast.scss +6 -0
- package/theme/styles/_index.scss +1 -0
- package/theme/styles/_mixins.scss +45 -0
- package/theme/styles/_print.scss +17 -0
- package/toast/styles/_index.scss +7 -0
- package/tour/styles/_index.scss +14 -0
- package/tree/styles/_index.scss +1 -9
- package/types/ngwr-anchor.d.ts +3 -0
- package/types/ngwr-animations-aurora.d.ts +6 -0
- package/types/ngwr-animations-blur-reveal.d.ts +6 -0
- package/types/ngwr-animations-click-sparks.d.ts +6 -0
- package/types/ngwr-animations-confetti.d.ts +6 -0
- package/types/ngwr-animations-decode.d.ts +6 -0
- package/types/ngwr-animations-destruct.d.ts +6 -0
- package/types/ngwr-animations-dot-grid.d.ts +6 -0
- package/types/ngwr-animations-falling-letters.d.ts +6 -0
- package/types/ngwr-animations-flow-lines.d.ts +6 -0
- package/types/ngwr-animations-fluid-cursor.d.ts +6 -0
- package/types/ngwr-animations-glitch.d.ts +6 -0
- package/types/ngwr-animations-glow-border.d.ts +6 -0
- package/types/ngwr-animations-gradient-flow.d.ts +6 -0
- package/types/ngwr-animations-marquee.d.ts +6 -0
- package/types/ngwr-animations-orbit.d.ts +6 -0
- package/types/ngwr-animations-reveal.d.ts +6 -0
- package/types/ngwr-animations-ripple-grid.d.ts +6 -0
- package/types/ngwr-animations-rotate-reveal.d.ts +6 -0
- package/types/ngwr-animations-shimmer.d.ts +6 -0
- package/types/ngwr-animations-spotlight.d.ts +6 -0
- package/types/ngwr-animations-thread-lines.d.ts +6 -0
- package/types/ngwr-animations-tilt.d.ts +10 -0
- package/types/ngwr-animations-typewriter.d.ts +6 -0
- package/types/ngwr-breadcrumbs.d.ts +25 -0
- package/types/ngwr-button.d.ts +23 -3
- package/types/ngwr-carousel-testing.d.ts +6 -4
- package/types/ngwr-carousel.d.ts +16 -3
- package/types/ngwr-cascader-testing.d.ts +4 -3
- package/types/ngwr-cascader.d.ts +34 -3
- package/types/ngwr-charts-bar-chart-testing.d.ts +15 -13
- package/types/ngwr-charts-bar-chart.d.ts +220 -48
- package/types/ngwr-charts-boxplot-chart-testing.d.ts +9 -2
- package/types/ngwr-charts-boxplot-chart.d.ts +110 -19
- package/types/ngwr-charts-bullet-chart.d.ts +72 -12
- package/types/ngwr-charts-calendar-heatmap.d.ts +119 -15
- package/types/ngwr-charts-candlestick-chart-testing.d.ts +19 -9
- package/types/ngwr-charts-candlestick-chart.d.ts +195 -62
- package/types/ngwr-charts-chart-legend.d.ts +142 -5
- package/types/ngwr-charts-core.d.ts +275 -21
- package/types/ngwr-charts-donut-chart-testing.d.ts +11 -5
- package/types/ngwr-charts-donut-chart.d.ts +124 -16
- package/types/ngwr-charts-funnel-chart.d.ts +62 -6
- package/types/ngwr-charts-gauge-testing.d.ts +5 -1
- package/types/ngwr-charts-gauge.d.ts +72 -10
- package/types/ngwr-charts-heatmap-chart.d.ts +103 -20
- package/types/ngwr-charts-line-chart-testing.d.ts +16 -2
- package/types/ngwr-charts-line-chart.d.ts +215 -86
- package/types/ngwr-charts-meter-group.d.ts +98 -7
- package/types/ngwr-charts-radar-chart-testing.d.ts +14 -3
- package/types/ngwr-charts-radar-chart.d.ts +148 -28
- package/types/ngwr-charts-scatter-chart-testing.d.ts +22 -10
- package/types/ngwr-charts-scatter-chart.d.ts +188 -18
- package/types/ngwr-charts-sparkline.d.ts +26 -4
- package/types/ngwr-charts-treemap-chart.d.ts +121 -23
- package/types/ngwr-charts-waterfall-chart-testing.d.ts +8 -1
- package/types/ngwr-charts-waterfall-chart.d.ts +108 -21
- package/types/ngwr-checkbox.d.ts +1 -0
- package/types/ngwr-color-picker.d.ts +28 -0
- package/types/ngwr-context-menu-testing.d.ts +10 -9
- package/types/ngwr-context-menu.d.ts +18 -1
- package/types/ngwr-copy-value.d.ts +8 -0
- package/types/ngwr-date-picker.d.ts +53 -2
- package/types/ngwr-dialog.d.ts +64 -13
- package/types/ngwr-directives.d.ts +12 -4
- package/types/ngwr-drawer.d.ts +33 -2
- package/types/ngwr-dropdown-testing.d.ts +8 -5
- package/types/ngwr-dropdown.d.ts +29 -6
- package/types/ngwr-event-calendar.d.ts +4 -0
- package/types/ngwr-form.d.ts +85 -1
- package/types/ngwr-graph.d.ts +22 -6
- package/types/ngwr-i18n.d.ts +65 -5
- package/types/ngwr-input-number.d.ts +8 -0
- package/types/ngwr-input.d.ts +7 -0
- package/types/ngwr-layout.d.ts +1 -1
- package/types/ngwr-lightbox.d.ts +15 -0
- package/types/ngwr-loading-bar-router.d.ts +6 -0
- package/types/ngwr-overlay.d.ts +16 -1
- package/types/ngwr-page-header.d.ts +23 -1
- package/types/ngwr-popconfirm-testing.d.ts +11 -2
- package/types/ngwr-popconfirm.d.ts +29 -2
- package/types/ngwr-popover.d.ts +87 -13
- package/types/ngwr-radio.d.ts +47 -5
- package/types/ngwr-segmented.d.ts +7 -0
- package/types/ngwr-select.d.ts +57 -13
- package/types/ngwr-sortable-list.d.ts +20 -7
- package/types/ngwr-table.d.ts +59 -6
- package/types/ngwr-tabs-router.d.ts +6 -0
- package/types/ngwr-toast.d.ts +11 -0
- package/types/ngwr-tour.d.ts +21 -3
- package/types/ngwr-tree-testing.d.ts +1 -2
- package/types/ngwr-tree.d.ts +33 -2
- package/types/ngwr-typography.d.ts +7 -0
- package/types/ngwr-utils-router.d.ts +6 -0
- package/types/ngwr-utils.d.ts +56 -2
- package/types/ngwr-validators.d.ts +49 -1
- package/types/ngwr-version.d.ts +1 -1
- package/types/ngwr-window.d.ts +14 -11
- package/typography/styles/_index.scss +4 -0
- package/window/styles/_index.scss +6 -19
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-animations-fluid-cursor.mjs","names":["DOCUMENT"],"sources":["../../../projects/lib/animations/fluid-cursor/fluid-gl.ts","../../../projects/lib/animations/fluid-cursor/fluid-model.ts","../../../projects/lib/animations/fluid-cursor/fluid-cursor.ts","../../../projects/lib/animations/fluid-cursor/fluid-cursor.html","../../../projects/lib/animations/fluid-cursor/public-api.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\n/**\n * The stable-fluids solver `<wr-fluid-cursor>` runs on the GPU: a velocity\n * field on a small grid and a dye field on a finer one, each a pair of\n * half-float textures drawn into by turns, and one full-screen pass per\n * step of the method. A step is: the curl of the velocity, the vorticity\n * confinement that feeds it back as swirl, the divergence, a damped Jacobi\n * solve for the pressure, the pressure gradient taken off, then the velocity\n * and the dye carried along the flow (semi-Lagrangian: each texel reads\n * where it came from) and decayed. The pointer enters as splats, a Gaussian\n * of momentum and of dye. The display pass maps the dye to colour and\n * coverage and is the only one that draws to the canvas.\n *\n * Every number in here is in grid units: a velocity is in velocity-grid\n * texels per second, so the advection of both fields displaces by `velocity\n * * dt * velocityTexel` in texture space, which is isotropic because both\n * grids keep the region's aspect ratio. A splat's point is in texture\n * space, its radius in CSS px, and the shader measures the distance in CSS px\n * through the region's size, so a splat is round whatever the grid.\n *\n * Written against WebGL2 with `EXT_color_buffer_float`, or WebGL1 with the\n * half-float texture, linear-filtering and half-float render-target\n * extensions; the shaders are GLSL ES 1.00, which both accept. Where neither\n * is there, `createFluidSim` returns `null` and the component draws nothing.\n */\n\ntype FluidGLContext = WebGLRenderingContext | WebGL2RenderingContext;\n\n/** The passes, in the order their programs are compiled. */\nconst FLUID_PASSES = [\n 'advect',\n 'curl',\n 'vorticity',\n 'divergence',\n 'scale',\n 'pressure',\n 'gradient',\n 'splat',\n 'display',\n] as const;\n\ntype FluidPass = (typeof FLUID_PASSES)[number];\n\n/** What one step of the solver needs beyond the time. */\ninterface FluidStepParams {\n /** The dye's and the velocity's decay rates, per second. */\n readonly dyeDecay: number;\n readonly velocityDecay: number;\n /** The vorticity confinement strength. */\n readonly swirl: number;\n /** Jacobi iterations of the pressure solve. */\n readonly iterations: number;\n}\n\n/** How the display pass paints the dye. */\ninterface FluidDisplayParams {\n /** Whether the surface is light, so the dye covers it as ink; on a dark one it is lit a little more. */\n readonly ink: boolean;\n /** Whether the dye is shaded by its own gradient, 0 or 1. */\n readonly shading: number;\n}\n\ninterface FluidSim {\n /** Sizes or resizes the grids; the fields start empty. */\n resize(simWidth: number, simHeight: number, dyeWidth: number, dyeHeight: number): void;\n /** Tells the solver the region's CSS size, which the splat radius is measured in. */\n size(width: number, height: number): void;\n /**\n * Adds a Gaussian of momentum `vx`, `vy` (velocity texels per second) and of\n * dye `r`, `g`, `b` at the point `x`, `y` (texture space, origin bottom\n * left), `radius` CSS px to its 1/e edge.\n */\n splat(x: number, y: number, vx: number, vy: number, r: number, g: number, b: number, radius: number): void;\n /** Moves the fields `dt` seconds on. */\n step(dt: number, params: FluidStepParams): void;\n /** Paints the dye onto the canvas, `width` by `height` device px. */\n render(width: number, height: number, params: FluidDisplayParams): void;\n /** Empties every field and the canvas. */\n clear(): void;\n /** Frees every program, texture and framebuffer. */\n destroy(): void;\n}\n\ninterface Target {\n readonly texture: WebGLTexture;\n readonly framebuffer: WebGLFramebuffer;\n readonly width: number;\n readonly height: number;\n readonly texelX: number;\n readonly texelY: number;\n}\n\ninterface Pair {\n read: Target;\n write: Target;\n}\n\ninterface Program {\n readonly program: WebGLProgram;\n readonly uniforms: Record<string, WebGLUniformLocation | null>;\n}\n\ninterface Formats {\n readonly internalFormat: number;\n readonly format: number;\n readonly type: number;\n}\n\nconst VERTEX = `\nprecision highp float;\nattribute vec2 aPosition;\nvarying vec2 vUv;\nvarying vec2 vL;\nvarying vec2 vR;\nvarying vec2 vT;\nvarying vec2 vB;\nuniform vec2 uTexelSize;\nvoid main () {\n vUv = aPosition * 0.5 + 0.5;\n vL = vUv - vec2(uTexelSize.x, 0.0);\n vR = vUv + vec2(uTexelSize.x, 0.0);\n vT = vUv + vec2(0.0, uTexelSize.y);\n vB = vUv - vec2(0.0, uTexelSize.y);\n gl_Position = vec4(aPosition, 0.0, 1.0);\n}`;\n\nconst HEADER = `\nprecision highp float;\nprecision highp sampler2D;\nvarying vec2 vUv;\nvarying vec2 vL;\nvarying vec2 vR;\nvarying vec2 vT;\nvarying vec2 vB;\n`;\n\n/** Each texel reads the field where it was `dt` ago, and the field decays. */\nconst ADVECT = `${HEADER}\nuniform sampler2D uVelocity;\nuniform sampler2D uSource;\nuniform vec2 uVelocityTexel;\nuniform float uDt;\nuniform float uDecay;\nvoid main () {\n vec2 velocity = texture2D(uVelocity, vUv).xy;\n vec2 from = vUv - uDt * velocity * uVelocityTexel;\n gl_FragColor = texture2D(uSource, from) * exp(-uDecay * uDt);\n}`;\n\n/** The vorticity: the curl of a plane field, one scalar. */\nconst CURL = `${HEADER}\nuniform sampler2D uVelocity;\nvoid main () {\n float L = texture2D(uVelocity, vL).y;\n float R = texture2D(uVelocity, vR).y;\n float T = texture2D(uVelocity, vT).x;\n float B = texture2D(uVelocity, vB).x;\n gl_FragColor = vec4(0.5 * ((R - L) - (T - B)), 0.0, 0.0, 1.0);\n}`;\n\n/**\n * Vorticity confinement: a push along the normalised gradient of the\n * vorticity's magnitude, turned by the vorticity's sign, so the eddies the\n * grid smooths away are fed back instead.\n */\nconst VORTICITY = `${HEADER}\nuniform sampler2D uVelocity;\nuniform sampler2D uCurl;\nuniform float uSwirl;\nuniform float uDt;\nvoid main () {\n float L = texture2D(uCurl, vL).x;\n float R = texture2D(uCurl, vR).x;\n float T = texture2D(uCurl, vT).x;\n float B = texture2D(uCurl, vB).x;\n float C = texture2D(uCurl, vUv).x;\n vec2 force = 0.5 * vec2(abs(T) - abs(B), abs(L) - abs(R));\n force /= length(force) + 0.0001;\n force *= uSwirl * C;\n vec2 velocity = texture2D(uVelocity, vUv).xy + force * uDt;\n gl_FragColor = vec4(velocity, 0.0, 1.0);\n}`;\n\n/** The divergence, with the region's edge as a wall: the velocity beyond it is the mirror of the one inside. */\nconst DIVERGENCE = `${HEADER}\nuniform sampler2D uVelocity;\nvoid main () {\n float L = texture2D(uVelocity, vL).x;\n float R = texture2D(uVelocity, vR).x;\n float T = texture2D(uVelocity, vT).y;\n float B = texture2D(uVelocity, vB).y;\n vec2 C = texture2D(uVelocity, vUv).xy;\n if (vL.x < 0.0) { L = -C.x; }\n if (vR.x > 1.0) { R = -C.x; }\n if (vT.y > 1.0) { T = -C.y; }\n if (vB.y < 0.0) { B = -C.y; }\n gl_FragColor = vec4(0.5 * (R - L + T - B), 0.0, 0.0, 1.0);\n}`;\n\n/** A field scaled: the pressure is damped between frames, so the solve starts warm but not stale. */\nconst SCALE = `${HEADER}\nuniform sampler2D uSource;\nuniform float uScale;\nvoid main () {\n gl_FragColor = uScale * texture2D(uSource, vUv);\n}`;\n\n/** One Jacobi iteration of the pressure Poisson equation. */\nconst PRESSURE = `${HEADER}\nuniform sampler2D uPressure;\nuniform sampler2D uDivergence;\nvoid main () {\n float L = texture2D(uPressure, vL).x;\n float R = texture2D(uPressure, vR).x;\n float T = texture2D(uPressure, vT).x;\n float B = texture2D(uPressure, vB).x;\n float divergence = texture2D(uDivergence, vUv).x;\n gl_FragColor = vec4((L + R + B + T - divergence) * 0.25, 0.0, 0.0, 1.0);\n}`;\n\n/** The pressure gradient taken off the velocity, which leaves it divergence-free. */\nconst GRADIENT = `${HEADER}\nuniform sampler2D uPressure;\nuniform sampler2D uVelocity;\nvoid main () {\n float L = texture2D(uPressure, vL).x;\n float R = texture2D(uPressure, vR).x;\n float T = texture2D(uPressure, vT).x;\n float B = texture2D(uPressure, vB).x;\n vec2 velocity = texture2D(uVelocity, vUv).xy - 0.5 * vec2(R - L, T - B);\n gl_FragColor = vec4(velocity, 0.0, 1.0);\n}`;\n\n/** A Gaussian of `uColor` added at `uPoint`, its radius in CSS px, so it is round on any grid. */\nconst SPLAT = `${HEADER}\nuniform sampler2D uTarget;\nuniform vec2 uPoint;\nuniform vec3 uColor;\nuniform float uRadius;\nuniform vec2 uSize;\nvoid main () {\n vec2 p = (vUv - uPoint) * uSize;\n float g = exp(-dot(p, p) / (uRadius * uRadius));\n vec3 base = texture2D(uTarget, vUv).xyz;\n gl_FragColor = vec4(base + uColor * g, 1.0);\n}`;\n\n/**\n * The dye to the canvas. The densest channel is the ink's density: its\n * coverage is a soft saturation of that, and its colour the dye's channels\n * normalised, so a thick ink is the full colour and a thin one a tint of it,\n * never a darker or a lighter one. On a dark surface the coverage rises\n * faster, so a thin strand still shows. Shading lights the density's\n * gradient from the top left, a slight relief.\n */\nconst DISPLAY = `${HEADER}\nuniform sampler2D uDye;\nuniform float uInk;\nuniform float uShading;\nfloat density (vec2 uv) {\n vec3 c = texture2D(uDye, uv).rgb;\n return max(c.r, max(c.g, c.b));\n}\nvoid main () {\n vec3 c = texture2D(uDye, vUv).rgb;\n float d = max(c.r, max(c.g, c.b));\n vec3 chroma = c / max(d, 0.0001);\n // Ink on a light ground covers at most most of it, so the text over it reads; on a dark ground the\n // thin end is pulled down, so a trail goes out crisply instead of hanging as haze.\n float alpha = mix(0.95 * pow(1.0 - exp(-d * 4.5), 2.0), 0.85 * (1.0 - exp(-d * 2.2)), uInk);\n if (uShading > 0.0) {\n float dx = density(vR) - density(vL);\n float dy = density(vT) - density(vB);\n vec3 n = normalize(vec3(-dx, -dy, 0.35));\n float light = clamp(dot(n, normalize(vec3(-0.6, 0.8, 0.9))), 0.0, 1.0);\n chroma *= mix(1.0, mix(0.86 + 0.28 * light, 0.72 + 0.5 * light, uInk), uShading);\n }\n gl_FragColor = vec4(chroma, alpha);\n}`;\n\nconst SOURCES: Readonly<Record<FluidPass, string>> = {\n advect: ADVECT,\n curl: CURL,\n vorticity: VORTICITY,\n divergence: DIVERGENCE,\n scale: SCALE,\n pressure: PRESSURE,\n gradient: GRADIENT,\n splat: SPLAT,\n display: DISPLAY,\n};\n\n/** How much of the pressure survives into the next frame's solve. */\nconst PRESSURE_KEEP = 0.8;\n\nconst UNIFORM = /uniform\\s+\\w+\\s+(\\w+)\\s*;/g;\n\nclass Sim implements FluidSim {\n private readonly programs: Readonly<Record<FluidPass, Program>>;\n private readonly quad: WebGLBuffer;\n private velocity: Pair | null = null;\n private dye: Pair | null = null;\n private pressure: Pair | null = null;\n private curl: Target | null = null;\n private divergence: Target | null = null;\n private cssWidth = 1;\n private cssHeight = 1;\n\n constructor(\n private readonly gl: FluidGLContext,\n private readonly formats: Formats\n ) {\n const quad = gl.createBuffer();\n if (!quad) throw new Error('fluid: no buffer');\n this.quad = quad;\n gl.bindBuffer(gl.ARRAY_BUFFER, quad);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]), gl.STATIC_DRAW);\n gl.disable(gl.BLEND);\n gl.disable(gl.DEPTH_TEST);\n\n const vertex = this.shader(gl.VERTEX_SHADER, VERTEX);\n const programs = {} as Record<FluidPass, Program>;\n for (const pass of FLUID_PASSES) programs[pass] = this.program(vertex, SOURCES[pass]);\n gl.deleteShader(vertex);\n this.programs = programs;\n }\n\n resize(simWidth: number, simHeight: number, dyeWidth: number, dyeHeight: number): void {\n this.release();\n this.velocity = this.pair(simWidth, simHeight);\n this.pressure = this.pair(simWidth, simHeight);\n this.curl = this.target(simWidth, simHeight);\n this.divergence = this.target(simWidth, simHeight);\n this.dye = this.pair(dyeWidth, dyeHeight);\n }\n\n size(width: number, height: number): void {\n this.cssWidth = Math.max(1, width);\n this.cssHeight = Math.max(1, height);\n }\n\n splat(x: number, y: number, vx: number, vy: number, r: number, g: number, b: number, radius: number): void {\n const { gl, velocity, dye } = this;\n if (!velocity || !dye) return;\n const { program, uniforms } = this.programs.splat;\n gl.useProgram(program);\n gl.uniform2f(uniforms['uPoint'], x, y);\n gl.uniform1f(uniforms['uRadius'], radius);\n gl.uniform2f(uniforms['uSize'], this.cssWidth, this.cssHeight);\n\n gl.uniform2f(uniforms['uTexelSize'], velocity.read.texelX, velocity.read.texelY);\n gl.uniform3f(uniforms['uColor'], vx, vy, 0);\n this.bind(uniforms['uTarget'], velocity.read, 0);\n this.blit(velocity.write);\n swap(velocity);\n\n gl.uniform2f(uniforms['uTexelSize'], dye.read.texelX, dye.read.texelY);\n gl.uniform3f(uniforms['uColor'], r, g, b);\n this.bind(uniforms['uTarget'], dye.read, 0);\n this.blit(dye.write);\n swap(dye);\n }\n\n step(dt: number, params: FluidStepParams): void {\n const { gl, velocity, dye, pressure, curl, divergence } = this;\n if (!velocity || !dye || !pressure || !curl || !divergence) return;\n const texel = (loc: WebGLUniformLocation | null): void =>\n gl.uniform2f(loc, velocity.read.texelX, velocity.read.texelY);\n\n let p = this.programs.curl;\n gl.useProgram(p.program);\n texel(p.uniforms['uTexelSize']);\n this.bind(p.uniforms['uVelocity'], velocity.read, 0);\n this.blit(curl);\n\n p = this.programs.vorticity;\n gl.useProgram(p.program);\n texel(p.uniforms['uTexelSize']);\n gl.uniform1f(p.uniforms['uSwirl'], params.swirl);\n gl.uniform1f(p.uniforms['uDt'], dt);\n this.bind(p.uniforms['uVelocity'], velocity.read, 0);\n this.bind(p.uniforms['uCurl'], curl, 1);\n this.blit(velocity.write);\n swap(velocity);\n\n p = this.programs.divergence;\n gl.useProgram(p.program);\n texel(p.uniforms['uTexelSize']);\n this.bind(p.uniforms['uVelocity'], velocity.read, 0);\n this.blit(divergence);\n\n p = this.programs.scale;\n gl.useProgram(p.program);\n texel(p.uniforms['uTexelSize']);\n gl.uniform1f(p.uniforms['uScale'], PRESSURE_KEEP);\n this.bind(p.uniforms['uSource'], pressure.read, 0);\n this.blit(pressure.write);\n swap(pressure);\n\n p = this.programs.pressure;\n gl.useProgram(p.program);\n texel(p.uniforms['uTexelSize']);\n this.bind(p.uniforms['uDivergence'], divergence, 1);\n for (let i = 0; i < params.iterations; i++) {\n this.bind(p.uniforms['uPressure'], pressure.read, 0);\n this.blit(pressure.write);\n swap(pressure);\n }\n\n p = this.programs.gradient;\n gl.useProgram(p.program);\n texel(p.uniforms['uTexelSize']);\n this.bind(p.uniforms['uPressure'], pressure.read, 0);\n this.bind(p.uniforms['uVelocity'], velocity.read, 1);\n this.blit(velocity.write);\n swap(velocity);\n\n p = this.programs.advect;\n gl.useProgram(p.program);\n texel(p.uniforms['uTexelSize']);\n texel(p.uniforms['uVelocityTexel']);\n gl.uniform1f(p.uniforms['uDt'], dt);\n gl.uniform1f(p.uniforms['uDecay'], params.velocityDecay);\n this.bind(p.uniforms['uVelocity'], velocity.read, 0);\n this.bind(p.uniforms['uSource'], velocity.read, 1);\n this.blit(velocity.write);\n swap(velocity);\n\n gl.uniform2f(p.uniforms['uTexelSize'], dye.read.texelX, dye.read.texelY);\n gl.uniform1f(p.uniforms['uDecay'], params.dyeDecay);\n this.bind(p.uniforms['uVelocity'], velocity.read, 0);\n this.bind(p.uniforms['uSource'], dye.read, 1);\n this.blit(dye.write);\n swap(dye);\n }\n\n render(width: number, height: number, params: FluidDisplayParams): void {\n const { gl, dye } = this;\n if (!dye) return;\n const { program, uniforms } = this.programs.display;\n gl.useProgram(program);\n gl.uniform2f(uniforms['uTexelSize'], dye.read.texelX, dye.read.texelY);\n gl.uniform1f(uniforms['uInk'], params.ink ? 1 : 0);\n gl.uniform1f(uniforms['uShading'], params.shading);\n this.bind(uniforms['uDye'], dye.read, 0);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.viewport(0, 0, width, height);\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n this.draw();\n }\n\n clear(): void {\n const { gl } = this;\n gl.clearColor(0, 0, 0, 0);\n for (const target of this.targets()) {\n gl.bindFramebuffer(gl.FRAMEBUFFER, target.framebuffer);\n gl.clear(gl.COLOR_BUFFER_BIT);\n }\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.clear(gl.COLOR_BUFFER_BIT);\n }\n\n destroy(): void {\n const { gl } = this;\n this.release();\n for (const pass of FLUID_PASSES) gl.deleteProgram(this.programs[pass].program);\n gl.deleteBuffer(this.quad);\n }\n\n // Resources\n\n private release(): void {\n const { gl } = this;\n for (const target of this.targets()) {\n gl.deleteFramebuffer(target.framebuffer);\n gl.deleteTexture(target.texture);\n }\n this.velocity = this.dye = this.pressure = null;\n this.curl = this.divergence = null;\n }\n\n private targets(): Target[] {\n const out: Target[] = [];\n for (const pair of [this.velocity, this.dye, this.pressure]) if (pair) out.push(pair.read, pair.write);\n for (const one of [this.curl, this.divergence]) if (one) out.push(one);\n return out;\n }\n\n private pair(width: number, height: number): Pair {\n return { read: this.target(width, height), write: this.target(width, height) };\n }\n\n private target(width: number, height: number): Target {\n const { gl, formats } = this;\n const texture = gl.createTexture();\n const framebuffer = gl.createFramebuffer();\n if (!texture || !framebuffer) throw new Error('fluid: no texture');\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texImage2D(gl.TEXTURE_2D, 0, formats.internalFormat, width, height, 0, formats.format, formats.type, null);\n gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);\n gl.viewport(0, 0, width, height);\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n return { texture, framebuffer, width, height, texelX: 1 / width, texelY: 1 / height };\n }\n\n // Drawing\n\n private bind(location: WebGLUniformLocation | null, target: Target, unit: number): void {\n const { gl } = this;\n gl.activeTexture(gl.TEXTURE0 + unit);\n gl.bindTexture(gl.TEXTURE_2D, target.texture);\n gl.uniform1i(location, unit);\n }\n\n private blit(target: Target): void {\n const { gl } = this;\n gl.bindFramebuffer(gl.FRAMEBUFFER, target.framebuffer);\n gl.viewport(0, 0, target.width, target.height);\n this.draw();\n }\n\n private draw(): void {\n const { gl } = this;\n gl.bindBuffer(gl.ARRAY_BUFFER, this.quad);\n gl.enableVertexAttribArray(0);\n gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);\n gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n }\n\n // Programs\n\n private shader(kind: number, source: string): WebGLShader {\n const { gl } = this;\n const shader = gl.createShader(kind);\n if (!shader) throw new Error('fluid: no shader');\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n const log = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error(`fluid: shader failed: ${log ?? ''}`);\n }\n return shader;\n }\n\n private program(vertex: WebGLShader, source: string): Program {\n const { gl } = this;\n const fragment = this.shader(gl.FRAGMENT_SHADER, source);\n const program = gl.createProgram();\n if (!program) throw new Error('fluid: no program');\n gl.attachShader(program, vertex);\n gl.attachShader(program, fragment);\n gl.bindAttribLocation(program, 0, 'aPosition');\n gl.linkProgram(program);\n gl.deleteShader(fragment);\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n const log = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n throw new Error(`fluid: program failed: ${log ?? ''}`);\n }\n const uniforms: Record<string, WebGLUniformLocation | null> = {};\n for (const text of [VERTEX, source]) {\n for (const match of text.matchAll(UNIFORM)) uniforms[match[1]] = gl.getUniformLocation(program, match[1]);\n }\n return { program, uniforms };\n }\n}\n\nfunction swap(pair: Pair): void {\n const read = pair.read;\n pair.read = pair.write;\n pair.write = read;\n}\n\n/** The half-float render-target formats the context offers, or `null` where it offers none. */\nfunction formats(gl: FluidGLContext): Formats | null {\n const gl2 = typeof WebGL2RenderingContext !== 'undefined' && gl instanceof WebGL2RenderingContext;\n if (gl2) {\n if (!gl.getExtension('EXT_color_buffer_float') && !gl.getExtension('EXT_color_buffer_half_float')) return null;\n return { internalFormat: gl.RGBA16F, format: gl.RGBA, type: gl.HALF_FLOAT };\n }\n const half = gl.getExtension('OES_texture_half_float');\n if (!half || !gl.getExtension('OES_texture_half_float_linear')) return null;\n gl.getExtension('EXT_color_buffer_half_float');\n return { internalFormat: gl.RGBA, format: gl.RGBA, type: half.HALF_FLOAT_OES };\n}\n\n/**\n * The attributes the canvas's context is asked for: straight alpha, so the\n * display pass writes a colour and a coverage and the page composites them,\n * and no buffer the solver does not use.\n */\nconst FLUID_CONTEXT_ATTRIBUTES: WebGLContextAttributes = {\n alpha: true,\n premultipliedAlpha: false,\n antialias: false,\n depth: false,\n stencil: false,\n preserveDrawingBuffer: false,\n powerPreference: 'low-power',\n};\n\n/**\n * A solver on `gl`, or `null` where the context cannot render into half-float\n * textures: the formats are probed first, then a trial target is checked for\n * completeness, since an extension listed is not a target that works.\n */\nfunction createFluidSim(gl: FluidGLContext): FluidSim | null {\n const found = formats(gl);\n if (!found) return null;\n let sim: Sim;\n try {\n sim = new Sim(gl, found);\n sim.resize(2, 2, 2, 2);\n } catch {\n return null;\n }\n const complete = gl.checkFramebufferStatus(gl.FRAMEBUFFER) === gl.FRAMEBUFFER_COMPLETE;\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n if (!complete) {\n sim.destroy();\n return null;\n }\n return sim;\n}\n\nexport { FLUID_PASSES, FLUID_CONTEXT_ATTRIBUTES, createFluidSim };\nexport type { FluidGLContext, FluidPass, FluidStepParams, FluidDisplayParams, FluidSim };\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { WrFluidCursorQuality } from './types';\n\n/**\n * The density under which a dye is not seen: the display pass maps it to an\n * alpha of about two percent. `trail` is the time a fresh splat takes to get\n * here, and the loop stops once the last splat is this far behind.\n */\nconst FLOOR = 0.012;\n\n/** A splat lands denser than one where strokes overlap; the rest time allows for this much. */\nconst PEAK = 2.5;\n\n/** The pointer is never read faster than this, in CSS px per second: a jump across the region is not a stroke. */\nconst SPEED_MAX = 4000;\n\n/** How far the pointer travels for the palette to run one full cycle, in CSS px. */\nconst CYCLE_PX = 900;\n\n/**\n * A fresh splat is laid every this many radii along a stroke, so a fast move\n * leaves a continuous line, and no more than this many per event.\n */\nconst SPLAT_GAP = 0.6;\nconst SPLATS_MAX = 12;\n\n/** A click's splash: this many rays around the point, each this many splats long, at this speed in CSS px per second, leaning this far sideways. */\nconst SPLASH_RAYS = 7;\nconst SPLASH_STEPS = 3;\nconst SPLASH_SPEED = 900;\nconst SPLASH_SPIN = 0.6;\n\n/** A grid never shrinks under this on a side. */\nconst SIDE_MIN = 2;\n\n/** One quality step: the short side of the velocity grid and of the dye grid, in texels, and the pressure solve's Jacobi iterations. */\ninterface FluidQuality {\n readonly sim: number;\n readonly dye: number;\n readonly iterations: number;\n}\n\n/** The grids and the pressure solve per quality. */\nconst QUALITY: Readonly<Record<WrFluidCursorQuality, FluidQuality>> = {\n low: { sim: 96, dye: 384, iterations: 12 },\n medium: { sim: 128, dye: 640, iterations: 20 },\n high: { sim: 192, dye: 1024, iterations: 28 },\n};\n\n/** A grid's size in texels. */\ninterface FluidGrid {\n readonly width: number;\n readonly height: number;\n}\n\n/**\n * A grid over a `width` by `height` region with `short` texels on its short\n * side and the region's aspect ratio, held under `maxPixels` texels in all,\n * never under two a side.\n */\nfunction fluidGrid(width: number, height: number, short: number, maxPixels: number): FluidGrid {\n if (!(width > 0) || !(height > 0)) return { width: SIDE_MIN, height: SIDE_MIN };\n const aspect = width / height;\n let w = aspect >= 1 ? short * aspect : short;\n let h = aspect >= 1 ? short : short / aspect;\n const over = (w * h) / maxPixels;\n if (over > 1) {\n const scale = 1 / Math.sqrt(over);\n w *= scale;\n h *= scale;\n }\n return { width: Math.max(SIDE_MIN, Math.round(w)), height: Math.max(SIDE_MIN, Math.round(h)) };\n}\n\n/**\n * The rate, per second, at which a field decays so that a unit of it reaches\n * {@link FLOOR} in `seconds`; a non-positive time means no decay at all.\n */\nfunction fluidDecay(seconds: number): number {\n return seconds > 0 ? Math.log(1 / FLOOR) / seconds : 0;\n}\n\n/**\n * How long after the last input the dye is sure to be under {@link FLOOR}, in\n * ms: `trail` seconds for a unit splat, longer for the {@link PEAK} that\n * overlapping strokes reach.\n */\nfunction fluidRestMs(trail: number): number {\n if (!(trail > 0)) return 0;\n return Math.round(trail * 1000 * (1 + Math.log(PEAK) / Math.log(1 / FLOOR)));\n}\n\n/**\n * The pointer's velocity in CSS px per second, from a move of `dx`, `dy` in\n * `dtMs`, the speed clamped at {@link SPEED_MAX}; a move with no time in it is\n * read as one ms. Written into `out`.\n */\nfunction fluidVelocity(dx: number, dy: number, dtMs: number, out: Float32Array): void {\n const dt = Math.max(dtMs, 1) / 1000;\n let vx = dx / dt;\n let vy = dy / dt;\n const speed = Math.hypot(vx, vy);\n if (speed > SPEED_MAX) {\n vx *= SPEED_MAX / speed;\n vy *= SPEED_MAX / speed;\n }\n out[0] = vx;\n out[1] = vy;\n}\n\n/** How many splats a move of `distance` CSS px takes, at `radius`: one when still, one per {@link SPLAT_GAP} radii, at most {@link SPLATS_MAX}. */\nfunction fluidSplats(distance: number, radius: number): number {\n if (!(distance > 0) || !(radius > 0)) return 1;\n return Math.min(SPLATS_MAX, Math.max(1, Math.ceil(distance / (radius * SPLAT_GAP))));\n}\n\n/**\n * How much of its dye each of the `splats` a move of `distance` is laid as\n * carries: the share of a full gap it covers, so a stroke lays the same ink\n * per px travelled whether the pointer crawls or sweeps, and a still pointer\n * lays none.\n */\nfunction fluidDyeScale(distance: number, splats: number, radius: number): number {\n if (!(radius > 0) || !(splats > 0)) return 1;\n return Math.min(1, Math.max(0, distance / splats / (radius * SPLAT_GAP)));\n}\n\n/** A colour as three channels in 0..1. */\ntype FluidColor = readonly [number, number, number];\n\n/**\n * The palette's colour at `phase`, the cycle position with a period of one:\n * a blend of two neighbours, with the brightness of a blend held between\n * theirs, so a cool and a warm ink do not meet in grey. Written into `out`.\n */\nfunction fluidPaletteColor(phase: number, palette: readonly FluidColor[], out: Float32Array): void {\n const n = palette.length;\n if (n === 0) {\n out[0] = out[1] = out[2] = 0;\n return;\n }\n const t = ((phase % 1) + 1) % 1;\n const slot = t * n;\n const i = Math.floor(slot) % n;\n const j = (i + 1) % n;\n const f = slot - Math.floor(slot);\n const a = palette[i];\n const b = palette[j];\n const peak = Math.max(a[0], a[1], a[2]) * (1 - f) + Math.max(b[0], b[1], b[2]) * f;\n let r = a[0] * (1 - f) + b[0] * f;\n let g = a[1] * (1 - f) + b[1] * f;\n let bl = a[2] * (1 - f) + b[2] * f;\n const max = Math.max(r, g, bl);\n if (max > 0) {\n const k = peak / max;\n r *= k;\n g *= k;\n bl *= k;\n }\n out[0] = r;\n out[1] = g;\n out[2] = bl;\n}\n\n/** A saturated hue at `phase`, the hue circle with a period of one, written into `out`. */\nfunction fluidRainbowColor(phase: number, out: Float32Array): void {\n const h = (((phase % 1) + 1) % 1) * 6;\n const x = 1 - Math.abs((h % 2) - 1);\n let r = 0;\n let g = 0;\n let b = 0;\n if (h < 1) [r, g] = [1, x];\n else if (h < 2) [r, g] = [x, 1];\n else if (h < 3) [g, b] = [1, x];\n else if (h < 4) [g, b] = [x, 1];\n else if (h < 5) [r, b] = [x, 1];\n else [r, b] = [1, x];\n // Pulled a little toward white, so the pure corners of the hue circle sit with the theme inks.\n const s = 0.9;\n out[0] = r * s + (1 - s);\n out[1] = g * s + (1 - s);\n out[2] = b * s + (1 - s);\n}\n\n/** Whether a surface is light, so the dye is laid as ink over it rather than lit on it. */\nfunction fluidInk(surface: FluidColor): boolean {\n return 0.2126 * surface[0] + 0.7152 * surface[1] + 0.0722 * surface[2] > 0.5;\n}\n\n/**\n * The rays of a click's splash: {@link SPLASH_RAYS} directions around the\n * point, each as a velocity of {@link SPLASH_SPEED} CSS px per second scaled\n * by `force`, leaning {@link SPLASH_SPIN} of that sideways, so the splash\n * turns as it spreads and the vorticity curls each ray; written into `out`\n * two numbers a ray. `seed` turns the fan so two splashes do not match.\n */\nfunction fluidSplash(force: number, seed: number, out: Float32Array): number {\n for (let i = 0; i < SPLASH_RAYS; i++) {\n const angle = ((i + seed) / SPLASH_RAYS) * Math.PI * 2;\n const c = Math.cos(angle);\n const sn = Math.sin(angle);\n out[i * 2] = (c - sn * SPLASH_SPIN) * SPLASH_SPEED * force;\n out[i * 2 + 1] = (sn + c * SPLASH_SPIN) * SPLASH_SPEED * force;\n }\n return SPLASH_RAYS;\n}\n\nexport {\n FLOOR,\n PEAK,\n SPEED_MAX,\n CYCLE_PX,\n SPLAT_GAP,\n SPLATS_MAX,\n SPLASH_RAYS,\n SPLASH_STEPS,\n SPLASH_SPEED,\n SPLASH_SPIN,\n QUALITY,\n fluidGrid,\n fluidDecay,\n fluidRestMs,\n fluidVelocity,\n fluidSplats,\n fluidDyeScale,\n fluidPaletteColor,\n fluidRainbowColor,\n fluidInk,\n fluidSplash,\n};\nexport type { FluidQuality, FluidGrid, FluidColor };\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n PLATFORM_ID,\n ViewEncapsulation,\n afterNextRender,\n booleanAttribute,\n effect,\n inject,\n input,\n untracked,\n viewChild,\n} from '@angular/core';\n\nimport { WrPlatform } from 'ngwr/platform';\nimport { wrNumAttr, wrResolveCssColorChannels, wrWatchColorScheme, wrCheckStyles } from 'ngwr/utils';\n\nimport { MAX_FRAME_MS, MAX_PIXELS, canvasBackdropRatio } from '../internal';\n\nimport { FLUID_CONTEXT_ATTRIBUTES, type FluidGLContext, type FluidSim, createFluidSim } from './fluid-gl';\nimport {\n CYCLE_PX,\n type FluidColor,\n QUALITY,\n SPLASH_RAYS,\n SPLASH_SPIN,\n SPLASH_STEPS,\n fluidDecay,\n fluidDyeScale,\n fluidGrid,\n fluidInk,\n fluidPaletteColor,\n fluidRainbowColor,\n fluidRestMs,\n fluidSplash,\n fluidSplats,\n fluidVelocity,\n} from './fluid-model';\nimport type { WrFluidCursorQuality } from './types';\n\n/** The palette hooks, in stroke order, each with what it is read as where the sheet is missing. */\nconst PALETTE_HOOKS: readonly (readonly [string, string])[] = [\n ['var(--wr-fluid-cursor-color-1)', '#3969e2'],\n ['var(--wr-fluid-cursor-color-2)', '#dc3137'],\n ['var(--wr-fluid-cursor-color-3)', '#ffba00'],\n ['var(--wr-fluid-cursor-color-4)', '#008800'],\n ['var(--wr-fluid-cursor-color-5)', '#3472d9'],\n];\n\n/** How much of the pointer's speed a unit `force` hands the fluid. */\nconst FORCE_BASE = 0.55;\n/** The density a unit `intensity` lays per splat. */\nconst DYE_BASE = 0.3;\n/** The vorticity confinement a unit `swirl` applies. */\nconst SWIRL_BASE = 24;\n/**\n * A click's splash: each ray is {@link SPLASH_STEPS} splats out along its\n * direction, this many radii apart, each this fraction of the radius and\n * narrower than the last, with this much of a stroke's dye. The arm is laid\n * as dye, not left to the push: an outward push alone is divergence, and the\n * pressure solve takes it straight back out.\n */\nconst SPLASH_OFFSET = 0.7;\nconst SPLASH_RAY = 0.55;\nconst SPLASH_DYE = 1.5;\n/** A click turns the palette this far, so the splash is not the stroke's colour. */\nconst SPLASH_PHASE = 0.17;\n\n/**\n * Coloured ink behind a region's content, stirred by the pointer: a move lays\n * dye and momentum into a fluid, and the dye swirls into curling eddies,\n * folds over itself, drifts on with the motion the pointer gave it and fades\n * out over a few seconds. A fast stroke leaves a long sweeping trail with\n * vortices peeling off; a slow one soft billows; a click a radial splash.\n * The fluid is `fluid-gl.ts`, a stable-fluids solver as WebGL passes; the\n * pure pieces (grids, decay, splat spacing, palette) are `fluid-model.ts`.\n *\n * Fills its positioned parent, which isolates itself, so the host's negative\n * z-index lands under the content and over the page background. The parent\n * takes the pointer, passively: the host and its canvas never do. A mouse,\n * a pen and a finger all draw; a finger is never stopped from scrolling. The\n * context and the fields are created at the first input, not at mount, so a\n * region nobody hovers costs nothing; the frame loop runs only while the\n * host is on screen, the document is visible and the last input is nearer\n * than the time the dye takes to fade (`trail`, from the model, no\n * read-back), and stops on its own after that, the fields cleared.\n *\n * Colours come from the `--wr-fluid-cursor-color-*` hooks through\n * `wrResolveCssColorChannels`, re-read when the scheme changes; a stroke\n * cycles through them as it goes, or through the hue circle under `rainbow`.\n * The display pass reads the surface too: on a light one the dye is laid as\n * ink, its colour at full saturation under a coverage that rises with its\n * density, so it reads as ink on white and not as a glow; on a dark one the\n * coverage rises faster, so a thin strand still shows. Under\n * `prefers-reduced-motion: reduce` nothing is drawn; under `forced-colors:\n * active` nothing is; on the server the empty canvas is rendered, absolutely\n * positioned, so the browser's first draw shifts no layout. A lost context\n * is let go and rebuilt when it comes back. Decorative: `aria-hidden`, no\n * pointer events. Styles: `@use 'ngwr/animations/fluid-cursor'`, which also\n * lists the hooks.\n */\n@Component({\n selector: 'wr-fluid-cursor',\n templateUrl: './fluid-cursor.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-fluid-cursor', 'aria-hidden': 'true' },\n})\nexport class WrFluidCursor {\n /** How much dye a move lays, a multiplier. @default 1 */\n readonly intensity = input(1, { transform: wrNumAttr(1) });\n /** The radius of a splat, in CSS px: how wide the ink the pointer lays is. @default 24 */\n readonly size = input(24, { transform: wrNumAttr(24) });\n /** How much of the pointer's speed the fluid takes, a multiplier. @default 1 */\n readonly force = input(1, { transform: wrNumAttr(1) });\n /** How strongly the eddies are fed back, a multiplier: more curls the trail tighter, none lets it smooth out. @default 1 */\n readonly swirl = input(1, { transform: wrNumAttr(1) });\n /** How long the dye lasts, in seconds, from a fresh splat to gone. @default 3 */\n readonly trail = input(3, { transform: wrNumAttr(3) });\n /** How long the motion the pointer gave lasts, in seconds. @default 6 */\n readonly momentum = input(6, { transform: wrNumAttr(6) });\n /** Whether the dye is shaded by its own relief, a slight lighting from the top left. @default true */\n readonly shading = input(true, { transform: booleanAttribute });\n /** Whether a stroke cycles the hue circle instead of the theme's palette. @default false */\n readonly rainbow = input(false, { transform: booleanAttribute });\n /** Whether a click or a tap splashes the ink outward from the point. @default true */\n readonly clickSplash = input(true, { transform: booleanAttribute });\n /** How finely the fluid is simulated: the grids and the pressure solve. @default 'medium' */\n readonly quality = input<WrFluidCursorQuality>('medium');\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly platform = inject(WrPlatform);\n private readonly doc = inject(DOCUMENT);\n private readonly canvasRef = viewChild.required<ElementRef<HTMLCanvasElement>>('canvas');\n\n private gl: FluidGLContext | null = null;\n private sim: FluidSim | null = null;\n /** Set once the browser was asked for a context, so a refusal is not asked again. */\n private contextTried = false;\n\n /** The host's CSS size, zero until the first layout. */\n private width = 0;\n private height = 0;\n private simWidth = 1;\n private ink = false;\n private readonly palette: FluidColor[] = [];\n private readonly color = new Float32Array(3);\n private readonly velocity = new Float32Array(2);\n private readonly rays = new Float32Array(SPLASH_RAYS * 2);\n private phase = 0;\n\n /** The scene's clock, in ms: moves only while a frame runs, so a hidden tab holds the ink. */\n private time = 0;\n /** When, on that clock, the last input's dye is gone. */\n private restAt = 0;\n private running = false;\n private rafId: number | null = null;\n private lastFrame = 0;\n private resizeRafId: number | null = null;\n private pendingWidth = 0;\n private pendingHeight = 0;\n private inView = false;\n private mounted = false;\n\n /** Where and when the pointer last was over the parent, in CSS px; NaN between strokes. */\n private lastX = NaN;\n private lastY = NaN;\n private lastTime = 0;\n\n private resizeObserver: ResizeObserver | null = null;\n private viewObserver: IntersectionObserver | null = null;\n private pointerTarget: HTMLElement | null = null;\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('animations/fluid-cursor');\n if (!isPlatformBrowser(inject(PLATFORM_ID))) return;\n\n effect(() => {\n this.platform.pageVisible();\n this.platform.prefersReducedMotion();\n untracked(() => this.sync());\n });\n effect(() => {\n this.quality();\n untracked(() => this.relayout());\n });\n wrWatchColorScheme(() => this.resolveColors());\n\n afterNextRender(() => this.mount());\n inject(DestroyRef).onDestroy(() => this.unmount());\n }\n\n // Lifecycle\n\n private mount(): void {\n // Nothing drawn under forced colours: the stylesheet hides the host too.\n if (this.doc.defaultView?.matchMedia?.('(forced-colors: active)').matches) return;\n const host = this.host.nativeElement;\n this.mounted = true;\n\n if (typeof ResizeObserver !== 'undefined') {\n this.resizeObserver = new ResizeObserver(entries => {\n const rect = entries[entries.length - 1]?.contentRect;\n this.scheduleResize(rect?.width ?? host.clientWidth, rect?.height ?? host.clientHeight);\n });\n this.resizeObserver.observe(host);\n } else {\n this.layout(host.clientWidth, host.clientHeight);\n }\n\n if (typeof IntersectionObserver !== 'undefined') {\n this.viewObserver = new IntersectionObserver(entries => {\n this.inView = entries[entries.length - 1]?.isIntersecting ?? false;\n this.sync();\n });\n this.viewObserver.observe(host);\n } else {\n this.inView = true;\n }\n\n const canvas = this.canvasRef().nativeElement;\n canvas.addEventListener('webglcontextlost', this.onContextLost);\n canvas.addEventListener('webglcontextrestored', this.onContextRestored);\n\n const target = host.parentElement;\n this.pointerTarget = target;\n target?.addEventListener('pointermove', this.onPointerMove, { passive: true });\n target?.addEventListener('pointerdown', this.onPointerDown, { passive: true });\n target?.addEventListener('pointerleave', this.onPointerLeave, { passive: true });\n }\n\n private unmount(): void {\n this.running = false;\n this.stopLoop();\n if (this.resizeRafId !== null) cancelAnimationFrame(this.resizeRafId);\n this.resizeRafId = null;\n this.resizeObserver?.disconnect();\n this.resizeObserver = null;\n this.viewObserver?.disconnect();\n this.viewObserver = null;\n this.pointerTarget?.removeEventListener('pointermove', this.onPointerMove);\n this.pointerTarget?.removeEventListener('pointerdown', this.onPointerDown);\n this.pointerTarget?.removeEventListener('pointerleave', this.onPointerLeave);\n this.pointerTarget = null;\n if (this.mounted) {\n const canvas = this.canvasRef().nativeElement;\n canvas.removeEventListener('webglcontextlost', this.onContextLost);\n canvas.removeEventListener('webglcontextrestored', this.onContextRestored);\n }\n this.sim?.destroy();\n this.sim = null;\n // The context itself is let go now rather than when the canvas is collected.\n this.gl?.getExtension('WEBGL_lose_context')?.loseContext();\n this.gl = null;\n this.mounted = false;\n }\n\n // Context\n\n /** The context and the solver, made at the first input; `null` under reduced motion and where the browser has neither WebGL. */\n private ensure(): FluidSim | null {\n if (this.platform.prefersReducedMotion()) return null;\n if (this.sim) return this.sim;\n if (this.contextTried || !this.mounted) return null;\n this.contextTried = true;\n const canvas = this.canvasRef().nativeElement;\n const gl =\n canvas.getContext('webgl2', FLUID_CONTEXT_ATTRIBUTES) ?? canvas.getContext('webgl', FLUID_CONTEXT_ATTRIBUTES);\n if (!gl) return null;\n this.gl = gl;\n this.sim = createFluidSim(gl);\n if (!this.sim) return null;\n this.resolveColors();\n this.relayout();\n return this.sim;\n }\n\n private readonly onContextLost = (event: Event): void => {\n // Not prevented, the browser never restores it.\n event.preventDefault();\n this.sim = null;\n this.running = false;\n this.stopLoop();\n };\n\n private readonly onContextRestored = (): void => {\n if (!this.gl) return;\n this.sim = createFluidSim(this.gl);\n this.relayout();\n this.sync();\n };\n\n // Layout\n\n private scheduleResize(width: number, height: number): void {\n this.pendingWidth = width;\n this.pendingHeight = height;\n if (this.resizeRafId !== null) return;\n this.resizeRafId = requestAnimationFrame(() => {\n this.resizeRafId = null;\n this.layout(this.pendingWidth, this.pendingHeight);\n });\n }\n\n private layout(width: number, height: number): void {\n if (width <= 0 || height <= 0) return;\n this.width = width;\n this.height = height;\n this.relayout();\n }\n\n /** Sizes the canvas and the grids for the current size and quality; the fields start over. */\n private relayout(): void {\n if (!this.sim || this.width === 0) return;\n const canvas = this.canvasRef().nativeElement;\n const dpr = canvasBackdropRatio(this.width, this.height, this.doc.defaultView?.devicePixelRatio ?? 1);\n canvas.width = Math.round(this.width * dpr);\n canvas.height = Math.round(this.height * dpr);\n const quality = QUALITY[untracked(this.quality)];\n const sim = fluidGrid(this.width, this.height, quality.sim, MAX_PIXELS);\n const dye = fluidGrid(this.width, this.height, Math.min(quality.dye, canvas.width, canvas.height), MAX_PIXELS);\n this.simWidth = sim.width;\n this.sim.resize(sim.width, sim.height, dye.width, dye.height);\n this.sim.size(this.width, this.height);\n this.sim.render(canvas.width, canvas.height, { ink: this.ink, shading: 0 });\n this.sync();\n }\n\n // Colours\n\n private resolveColors(): void {\n if (!this.sim) return;\n const canvas = this.canvasRef().nativeElement;\n this.palette.length = 0;\n for (const [hook, fallback] of PALETTE_HOOKS) this.palette.push(wrResolveCssColorChannels(canvas, hook, fallback));\n this.ink = fluidInk(wrResolveCssColorChannels(canvas, 'var(--wr-color-surface)', '#ffffff'));\n }\n\n /** The stroke's colour at its phase, into `color`. */\n private tint(): void {\n if (untracked(this.rainbow)) fluidRainbowColor(this.phase, this.color);\n else fluidPaletteColor(this.phase, this.palette, this.color);\n }\n\n // Pointer\n\n private readonly onPointerMove = (event: PointerEvent): void => {\n const sim = this.ensure();\n if (!sim || this.width === 0) return;\n const rect = this.canvasRef().nativeElement.getBoundingClientRect();\n const x = event.clientX - rect.left;\n const y = event.clientY - rect.top;\n const now = event.timeStamp;\n if (!Number.isNaN(this.lastX)) {\n const dx = x - this.lastX;\n const dy = y - this.lastY;\n const distance = Math.hypot(dx, dy);\n if (distance > 0) {\n const radius = untracked(this.size);\n const force = untracked(this.force) * FORCE_BASE * (this.simWidth / this.width);\n const n = fluidSplats(distance, radius);\n const dye = untracked(this.intensity) * DYE_BASE * fluidDyeScale(distance, n, radius);\n fluidVelocity(dx, dy, now - this.lastTime, this.velocity);\n const vx = this.velocity[0] * force;\n const vy = -this.velocity[1] * force;\n for (let k = 1; k <= n; k++) {\n const t = k / n;\n this.phase += distance / n / CYCLE_PX;\n this.tint();\n sim.splat(\n (this.lastX + dx * t) / this.width,\n 1 - (this.lastY + dy * t) / this.height,\n vx,\n vy,\n this.color[0] * dye,\n this.color[1] * dye,\n this.color[2] * dye,\n radius\n );\n }\n this.touch();\n }\n }\n this.lastX = x;\n this.lastY = y;\n this.lastTime = now;\n };\n\n private readonly onPointerDown = (event: PointerEvent): void => {\n const sim = this.ensure();\n if (!sim || this.width === 0) return;\n const rect = this.canvasRef().nativeElement.getBoundingClientRect();\n const x = event.clientX - rect.left;\n const y = event.clientY - rect.top;\n this.lastX = x;\n this.lastY = y;\n this.lastTime = event.timeStamp;\n if (!untracked(this.clickSplash) || event.button !== 0) return;\n\n const radius = untracked(this.size);\n const force = untracked(this.force);\n const dye = untracked(this.intensity) * DYE_BASE * SPLASH_DYE;\n const scale = this.simWidth / this.width;\n this.phase += SPLASH_PHASE;\n this.tint();\n const n = fluidSplash(force, this.phase * SPLASH_RAYS, this.rays);\n for (let i = 0; i < n; i++) {\n const rx = this.rays[i * 2];\n const ry = this.rays[i * 2 + 1];\n // The arm lies along the ray's own direction, before the spin is added.\n const angle = Math.atan2(ry, rx) - Math.atan(SPLASH_SPIN);\n for (let k = 1; k <= SPLASH_STEPS; k++) {\n const px = x + Math.cos(angle) * radius * SPLASH_OFFSET * k;\n const py = y + Math.sin(angle) * radius * SPLASH_OFFSET * k;\n const taper = 1 - (k - 1) / (SPLASH_STEPS + 1);\n sim.splat(\n px / this.width,\n 1 - py / this.height,\n rx * scale,\n -ry * scale,\n this.color[0] * dye,\n this.color[1] * dye,\n this.color[2] * dye,\n radius * SPLASH_RAY * taper\n );\n }\n }\n this.touch();\n };\n\n private readonly onPointerLeave = (): void => {\n this.lastX = NaN;\n this.lastY = NaN;\n };\n\n /** An input landed: the dye is live for `trail` from now. */\n private touch(): void {\n this.restAt = this.time + fluidRestMs(untracked(this.trail));\n this.sync();\n }\n\n // Loop\n\n private active(): boolean {\n return this.sim !== null && this.time < this.restAt;\n }\n\n private sync(): void {\n const reduced = this.platform.prefersReducedMotion();\n const allowed = this.mounted && this.width > 0 && this.inView && this.platform.pageVisible() && !reduced;\n if (reduced && this.active()) this.rest();\n const run = allowed && this.active();\n if (run === this.running) return;\n this.running = run;\n if (run) {\n this.lastFrame = performance.now();\n this.rafId = requestAnimationFrame(this.frame);\n return;\n }\n this.stopLoop();\n }\n\n /** The fields and the canvas emptied, and nothing left to move. */\n private rest(): void {\n this.restAt = this.time;\n this.sim?.clear();\n }\n\n private stopLoop(): void {\n if (this.rafId !== null) cancelAnimationFrame(this.rafId);\n this.rafId = null;\n }\n\n private readonly frame = (now: number): void => {\n this.rafId = null;\n if (!this.running) return;\n const sim = this.sim;\n if (!sim) {\n this.running = false;\n return;\n }\n const dt = Math.min(Math.max(now - this.lastFrame, 0), MAX_FRAME_MS);\n this.lastFrame = now;\n this.time += dt;\n const quality = QUALITY[untracked(this.quality)];\n sim.step(dt / 1000, {\n dyeDecay: fluidDecay(untracked(this.trail)),\n velocityDecay: fluidDecay(untracked(this.momentum)),\n swirl: untracked(this.swirl) * SWIRL_BASE,\n iterations: quality.iterations,\n });\n const canvas = this.canvasRef().nativeElement;\n sim.render(canvas.width, canvas.height, { ink: this.ink, shading: untracked(this.shading) ? 1 : 0 });\n if (!this.active()) {\n // The dye is under the floor: the fields are emptied, so nothing faint lingers, and the loop ends.\n this.rest();\n this.running = false;\n return;\n }\n this.rafId = requestAnimationFrame(this.frame);\n };\n}\n","<canvas #canvas class=\"wr-fluid-cursor__canvas\"></canvas>\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nexport { WrFluidCursor } from './fluid-cursor';\nexport type { WrFluidCursorQuality } from './types';\n"],"mappings":";;;;;;;;;;;;AAmCA,MAAM,eAAe;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACQ;AAqEV,MAAM,SAAS;;;;;;;;;;;;;;;;;AAkBf,MAAM,SAAS;;;;;;;;;AA0Jf,MAAM,UAA+C;CACnD,QAAQ,GAhJQ,OAAM;;;;;;;;;;;CAiJtB,MAAM,GApIQ,OAAM;;;;;;;;;CAqIpB,WAAW,GAtHQ,OAAM;;;;;;;;;;;;;;;;;CAuHzB,YAAY,GApGQ,OAAM;;;;;;;;;;;;;;CAqG1B,OAAO,GArFQ,OAAM;;;;;;CAsFrB,UAAU,GA9EQ,OAAM;;;;;;;;;;;CA+ExB,UAAU,GAlEQ,OAAM;;;;;;;;;;;CAmExB,OAAO,GAtDQ,OAAM;;;;;;;;;;;;CAuDrB,SAAS,GAlCQ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AAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,UAAQ,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"ngwr-animations-fluid-cursor.mjs","names":["DOCUMENT"],"sources":["../../../projects/lib/animations/fluid-cursor/fluid-gl.ts","../../../projects/lib/animations/fluid-cursor/fluid-model.ts","../../../projects/lib/animations/fluid-cursor/fluid-cursor.ts","../../../projects/lib/animations/fluid-cursor/fluid-cursor.html"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\n/**\n * The stable-fluids solver `<wr-fluid-cursor>` runs on the GPU: a velocity\n * field on a small grid and a dye field on a finer one, each a pair of\n * half-float textures drawn into by turns, and one full-screen pass per\n * step of the method. A step is: the curl of the velocity, the vorticity\n * confinement that feeds it back as swirl, the divergence, a damped Jacobi\n * solve for the pressure, the pressure gradient taken off, then the velocity\n * and the dye carried along the flow (semi-Lagrangian: each texel reads\n * where it came from) and decayed. The pointer enters as splats, a Gaussian\n * of momentum and of dye. The display pass maps the dye to colour and\n * coverage and is the only one that draws to the canvas.\n *\n * Every number in here is in grid units: a velocity is in velocity-grid\n * texels per second, so the advection of both fields displaces by `velocity\n * * dt * velocityTexel` in texture space, which is isotropic because both\n * grids keep the region's aspect ratio. A splat's point is in texture\n * space, its radius in CSS px, and the shader measures the distance in CSS px\n * through the region's size, so a splat is round whatever the grid.\n *\n * Written against WebGL2 with `EXT_color_buffer_float`, or WebGL1 with the\n * half-float texture, linear-filtering and half-float render-target\n * extensions; the shaders are GLSL ES 1.00, which both accept. Where neither\n * is there, `createFluidSim` returns `null` and the component draws nothing.\n */\n\ntype FluidGLContext = WebGLRenderingContext | WebGL2RenderingContext;\n\n/** The passes, in the order their programs are compiled. */\nconst FLUID_PASSES = [\n 'advect',\n 'curl',\n 'vorticity',\n 'divergence',\n 'scale',\n 'pressure',\n 'gradient',\n 'splat',\n 'display',\n] as const;\n\ntype FluidPass = (typeof FLUID_PASSES)[number];\n\n/** What one step of the solver needs beyond the time. */\ninterface FluidStepParams {\n /** The dye's and the velocity's decay rates, per second. */\n readonly dyeDecay: number;\n readonly velocityDecay: number;\n /** The vorticity confinement strength. */\n readonly swirl: number;\n /** Jacobi iterations of the pressure solve. */\n readonly iterations: number;\n}\n\n/** How the display pass paints the dye. */\ninterface FluidDisplayParams {\n /** Whether the surface is light, so the dye covers it as ink; on a dark one it is lit a little more. */\n readonly ink: boolean;\n /** Whether the dye is shaded by its own gradient, 0 or 1. */\n readonly shading: number;\n}\n\ninterface FluidSim {\n /** Sizes or resizes the grids; the fields start empty. */\n resize(simWidth: number, simHeight: number, dyeWidth: number, dyeHeight: number): void;\n /** Tells the solver the region's CSS size, which the splat radius is measured in. */\n size(width: number, height: number): void;\n /**\n * Adds a Gaussian of momentum `vx`, `vy` (velocity texels per second) and of\n * dye `r`, `g`, `b` at the point `x`, `y` (texture space, origin bottom\n * left), `radius` CSS px to its 1/e edge.\n */\n splat(x: number, y: number, vx: number, vy: number, r: number, g: number, b: number, radius: number): void;\n /** Moves the fields `dt` seconds on. */\n step(dt: number, params: FluidStepParams): void;\n /** Paints the dye onto the canvas, `width` by `height` device px. */\n render(width: number, height: number, params: FluidDisplayParams): void;\n /** Empties every field and the canvas. */\n clear(): void;\n /** Frees every program, texture and framebuffer. */\n destroy(): void;\n}\n\ninterface Target {\n readonly texture: WebGLTexture;\n readonly framebuffer: WebGLFramebuffer;\n readonly width: number;\n readonly height: number;\n readonly texelX: number;\n readonly texelY: number;\n}\n\ninterface Pair {\n read: Target;\n write: Target;\n}\n\ninterface Program {\n readonly program: WebGLProgram;\n readonly uniforms: Record<string, WebGLUniformLocation | null>;\n}\n\ninterface Formats {\n readonly internalFormat: number;\n readonly format: number;\n readonly type: number;\n}\n\nconst VERTEX = `\nprecision highp float;\nattribute vec2 aPosition;\nvarying vec2 vUv;\nvarying vec2 vL;\nvarying vec2 vR;\nvarying vec2 vT;\nvarying vec2 vB;\nuniform vec2 uTexelSize;\nvoid main () {\n vUv = aPosition * 0.5 + 0.5;\n vL = vUv - vec2(uTexelSize.x, 0.0);\n vR = vUv + vec2(uTexelSize.x, 0.0);\n vT = vUv + vec2(0.0, uTexelSize.y);\n vB = vUv - vec2(0.0, uTexelSize.y);\n gl_Position = vec4(aPosition, 0.0, 1.0);\n}`;\n\nconst HEADER = `\nprecision highp float;\nprecision highp sampler2D;\nvarying vec2 vUv;\nvarying vec2 vL;\nvarying vec2 vR;\nvarying vec2 vT;\nvarying vec2 vB;\n`;\n\n/** Each texel reads the field where it was `dt` ago, and the field decays. */\nconst ADVECT = `${HEADER}\nuniform sampler2D uVelocity;\nuniform sampler2D uSource;\nuniform vec2 uVelocityTexel;\nuniform float uDt;\nuniform float uDecay;\nvoid main () {\n vec2 velocity = texture2D(uVelocity, vUv).xy;\n vec2 from = vUv - uDt * velocity * uVelocityTexel;\n gl_FragColor = texture2D(uSource, from) * exp(-uDecay * uDt);\n}`;\n\n/** The vorticity: the curl of a plane field, one scalar. */\nconst CURL = `${HEADER}\nuniform sampler2D uVelocity;\nvoid main () {\n float L = texture2D(uVelocity, vL).y;\n float R = texture2D(uVelocity, vR).y;\n float T = texture2D(uVelocity, vT).x;\n float B = texture2D(uVelocity, vB).x;\n gl_FragColor = vec4(0.5 * ((R - L) - (T - B)), 0.0, 0.0, 1.0);\n}`;\n\n/**\n * Vorticity confinement: a push along the normalised gradient of the\n * vorticity's magnitude, turned by the vorticity's sign, so the eddies the\n * grid smooths away are fed back instead.\n */\nconst VORTICITY = `${HEADER}\nuniform sampler2D uVelocity;\nuniform sampler2D uCurl;\nuniform float uSwirl;\nuniform float uDt;\nvoid main () {\n float L = texture2D(uCurl, vL).x;\n float R = texture2D(uCurl, vR).x;\n float T = texture2D(uCurl, vT).x;\n float B = texture2D(uCurl, vB).x;\n float C = texture2D(uCurl, vUv).x;\n vec2 force = 0.5 * vec2(abs(T) - abs(B), abs(L) - abs(R));\n force /= length(force) + 0.0001;\n force *= uSwirl * C;\n vec2 velocity = texture2D(uVelocity, vUv).xy + force * uDt;\n gl_FragColor = vec4(velocity, 0.0, 1.0);\n}`;\n\n/** The divergence, with the region's edge as a wall: the velocity beyond it is the mirror of the one inside. */\nconst DIVERGENCE = `${HEADER}\nuniform sampler2D uVelocity;\nvoid main () {\n float L = texture2D(uVelocity, vL).x;\n float R = texture2D(uVelocity, vR).x;\n float T = texture2D(uVelocity, vT).y;\n float B = texture2D(uVelocity, vB).y;\n vec2 C = texture2D(uVelocity, vUv).xy;\n if (vL.x < 0.0) { L = -C.x; }\n if (vR.x > 1.0) { R = -C.x; }\n if (vT.y > 1.0) { T = -C.y; }\n if (vB.y < 0.0) { B = -C.y; }\n gl_FragColor = vec4(0.5 * (R - L + T - B), 0.0, 0.0, 1.0);\n}`;\n\n/** A field scaled: the pressure is damped between frames, so the solve starts warm but not stale. */\nconst SCALE = `${HEADER}\nuniform sampler2D uSource;\nuniform float uScale;\nvoid main () {\n gl_FragColor = uScale * texture2D(uSource, vUv);\n}`;\n\n/** One Jacobi iteration of the pressure Poisson equation. */\nconst PRESSURE = `${HEADER}\nuniform sampler2D uPressure;\nuniform sampler2D uDivergence;\nvoid main () {\n float L = texture2D(uPressure, vL).x;\n float R = texture2D(uPressure, vR).x;\n float T = texture2D(uPressure, vT).x;\n float B = texture2D(uPressure, vB).x;\n float divergence = texture2D(uDivergence, vUv).x;\n gl_FragColor = vec4((L + R + B + T - divergence) * 0.25, 0.0, 0.0, 1.0);\n}`;\n\n/** The pressure gradient taken off the velocity, which leaves it divergence-free. */\nconst GRADIENT = `${HEADER}\nuniform sampler2D uPressure;\nuniform sampler2D uVelocity;\nvoid main () {\n float L = texture2D(uPressure, vL).x;\n float R = texture2D(uPressure, vR).x;\n float T = texture2D(uPressure, vT).x;\n float B = texture2D(uPressure, vB).x;\n vec2 velocity = texture2D(uVelocity, vUv).xy - 0.5 * vec2(R - L, T - B);\n gl_FragColor = vec4(velocity, 0.0, 1.0);\n}`;\n\n/** A Gaussian of `uColor` added at `uPoint`, its radius in CSS px, so it is round on any grid. */\nconst SPLAT = `${HEADER}\nuniform sampler2D uTarget;\nuniform vec2 uPoint;\nuniform vec3 uColor;\nuniform float uRadius;\nuniform vec2 uSize;\nvoid main () {\n vec2 p = (vUv - uPoint) * uSize;\n float g = exp(-dot(p, p) / (uRadius * uRadius));\n vec3 base = texture2D(uTarget, vUv).xyz;\n gl_FragColor = vec4(base + uColor * g, 1.0);\n}`;\n\n/**\n * The dye to the canvas. The densest channel is the ink's density: its\n * coverage is a soft saturation of that, and its colour the dye's channels\n * normalised, so a thick ink is the full colour and a thin one a tint of it,\n * never a darker or a lighter one. On a dark surface the coverage rises\n * faster, so a thin strand still shows. Shading lights the density's\n * gradient from the top left, a slight relief.\n */\nconst DISPLAY = `${HEADER}\nuniform sampler2D uDye;\nuniform float uInk;\nuniform float uShading;\nfloat density (vec2 uv) {\n vec3 c = texture2D(uDye, uv).rgb;\n return max(c.r, max(c.g, c.b));\n}\nvoid main () {\n vec3 c = texture2D(uDye, vUv).rgb;\n float d = max(c.r, max(c.g, c.b));\n vec3 chroma = c / max(d, 0.0001);\n // Ink on a light ground covers at most most of it, so the text over it reads; on a dark ground the\n // thin end is pulled down, so a trail goes out crisply instead of hanging as haze.\n float alpha = mix(0.95 * pow(1.0 - exp(-d * 4.5), 2.0), 0.85 * (1.0 - exp(-d * 2.2)), uInk);\n if (uShading > 0.0) {\n float dx = density(vR) - density(vL);\n float dy = density(vT) - density(vB);\n vec3 n = normalize(vec3(-dx, -dy, 0.35));\n float light = clamp(dot(n, normalize(vec3(-0.6, 0.8, 0.9))), 0.0, 1.0);\n chroma *= mix(1.0, mix(0.86 + 0.28 * light, 0.72 + 0.5 * light, uInk), uShading);\n }\n gl_FragColor = vec4(chroma, alpha);\n}`;\n\nconst SOURCES: Readonly<Record<FluidPass, string>> = {\n advect: ADVECT,\n curl: CURL,\n vorticity: VORTICITY,\n divergence: DIVERGENCE,\n scale: SCALE,\n pressure: PRESSURE,\n gradient: GRADIENT,\n splat: SPLAT,\n display: DISPLAY,\n};\n\n/** How much of the pressure survives into the next frame's solve. */\nconst PRESSURE_KEEP = 0.8;\n\nconst UNIFORM = /uniform\\s+\\w+\\s+(\\w+)\\s*;/g;\n\nclass Sim implements FluidSim {\n private readonly programs: Readonly<Record<FluidPass, Program>>;\n private readonly quad: WebGLBuffer;\n private velocity: Pair | null = null;\n private dye: Pair | null = null;\n private pressure: Pair | null = null;\n private curl: Target | null = null;\n private divergence: Target | null = null;\n private cssWidth = 1;\n private cssHeight = 1;\n\n constructor(\n private readonly gl: FluidGLContext,\n private readonly formats: Formats\n ) {\n const quad = gl.createBuffer();\n if (!quad) throw new Error('fluid: no buffer');\n this.quad = quad;\n gl.bindBuffer(gl.ARRAY_BUFFER, quad);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]), gl.STATIC_DRAW);\n gl.disable(gl.BLEND);\n gl.disable(gl.DEPTH_TEST);\n\n const vertex = this.shader(gl.VERTEX_SHADER, VERTEX);\n const programs = {} as Record<FluidPass, Program>;\n for (const pass of FLUID_PASSES) programs[pass] = this.program(vertex, SOURCES[pass]);\n gl.deleteShader(vertex);\n this.programs = programs;\n }\n\n resize(simWidth: number, simHeight: number, dyeWidth: number, dyeHeight: number): void {\n this.release();\n this.velocity = this.pair(simWidth, simHeight);\n this.pressure = this.pair(simWidth, simHeight);\n this.curl = this.target(simWidth, simHeight);\n this.divergence = this.target(simWidth, simHeight);\n this.dye = this.pair(dyeWidth, dyeHeight);\n }\n\n size(width: number, height: number): void {\n this.cssWidth = Math.max(1, width);\n this.cssHeight = Math.max(1, height);\n }\n\n splat(x: number, y: number, vx: number, vy: number, r: number, g: number, b: number, radius: number): void {\n const { gl, velocity, dye } = this;\n if (!velocity || !dye) return;\n const { program, uniforms } = this.programs.splat;\n gl.useProgram(program);\n gl.uniform2f(uniforms['uPoint'], x, y);\n gl.uniform1f(uniforms['uRadius'], radius);\n gl.uniform2f(uniforms['uSize'], this.cssWidth, this.cssHeight);\n\n gl.uniform2f(uniforms['uTexelSize'], velocity.read.texelX, velocity.read.texelY);\n gl.uniform3f(uniforms['uColor'], vx, vy, 0);\n this.bind(uniforms['uTarget'], velocity.read, 0);\n this.blit(velocity.write);\n swap(velocity);\n\n gl.uniform2f(uniforms['uTexelSize'], dye.read.texelX, dye.read.texelY);\n gl.uniform3f(uniforms['uColor'], r, g, b);\n this.bind(uniforms['uTarget'], dye.read, 0);\n this.blit(dye.write);\n swap(dye);\n }\n\n step(dt: number, params: FluidStepParams): void {\n const { gl, velocity, dye, pressure, curl, divergence } = this;\n if (!velocity || !dye || !pressure || !curl || !divergence) return;\n const texel = (loc: WebGLUniformLocation | null): void =>\n gl.uniform2f(loc, velocity.read.texelX, velocity.read.texelY);\n\n let p = this.programs.curl;\n gl.useProgram(p.program);\n texel(p.uniforms['uTexelSize']);\n this.bind(p.uniforms['uVelocity'], velocity.read, 0);\n this.blit(curl);\n\n p = this.programs.vorticity;\n gl.useProgram(p.program);\n texel(p.uniforms['uTexelSize']);\n gl.uniform1f(p.uniforms['uSwirl'], params.swirl);\n gl.uniform1f(p.uniforms['uDt'], dt);\n this.bind(p.uniforms['uVelocity'], velocity.read, 0);\n this.bind(p.uniforms['uCurl'], curl, 1);\n this.blit(velocity.write);\n swap(velocity);\n\n p = this.programs.divergence;\n gl.useProgram(p.program);\n texel(p.uniforms['uTexelSize']);\n this.bind(p.uniforms['uVelocity'], velocity.read, 0);\n this.blit(divergence);\n\n p = this.programs.scale;\n gl.useProgram(p.program);\n texel(p.uniforms['uTexelSize']);\n gl.uniform1f(p.uniforms['uScale'], PRESSURE_KEEP);\n this.bind(p.uniforms['uSource'], pressure.read, 0);\n this.blit(pressure.write);\n swap(pressure);\n\n p = this.programs.pressure;\n gl.useProgram(p.program);\n texel(p.uniforms['uTexelSize']);\n this.bind(p.uniforms['uDivergence'], divergence, 1);\n for (let i = 0; i < params.iterations; i++) {\n this.bind(p.uniforms['uPressure'], pressure.read, 0);\n this.blit(pressure.write);\n swap(pressure);\n }\n\n p = this.programs.gradient;\n gl.useProgram(p.program);\n texel(p.uniforms['uTexelSize']);\n this.bind(p.uniforms['uPressure'], pressure.read, 0);\n this.bind(p.uniforms['uVelocity'], velocity.read, 1);\n this.blit(velocity.write);\n swap(velocity);\n\n p = this.programs.advect;\n gl.useProgram(p.program);\n texel(p.uniforms['uTexelSize']);\n texel(p.uniforms['uVelocityTexel']);\n gl.uniform1f(p.uniforms['uDt'], dt);\n gl.uniform1f(p.uniforms['uDecay'], params.velocityDecay);\n this.bind(p.uniforms['uVelocity'], velocity.read, 0);\n this.bind(p.uniforms['uSource'], velocity.read, 1);\n this.blit(velocity.write);\n swap(velocity);\n\n gl.uniform2f(p.uniforms['uTexelSize'], dye.read.texelX, dye.read.texelY);\n gl.uniform1f(p.uniforms['uDecay'], params.dyeDecay);\n this.bind(p.uniforms['uVelocity'], velocity.read, 0);\n this.bind(p.uniforms['uSource'], dye.read, 1);\n this.blit(dye.write);\n swap(dye);\n }\n\n render(width: number, height: number, params: FluidDisplayParams): void {\n const { gl, dye } = this;\n if (!dye) return;\n const { program, uniforms } = this.programs.display;\n gl.useProgram(program);\n gl.uniform2f(uniforms['uTexelSize'], dye.read.texelX, dye.read.texelY);\n gl.uniform1f(uniforms['uInk'], params.ink ? 1 : 0);\n gl.uniform1f(uniforms['uShading'], params.shading);\n this.bind(uniforms['uDye'], dye.read, 0);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.viewport(0, 0, width, height);\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n this.draw();\n }\n\n clear(): void {\n const { gl } = this;\n gl.clearColor(0, 0, 0, 0);\n for (const target of this.targets()) {\n gl.bindFramebuffer(gl.FRAMEBUFFER, target.framebuffer);\n gl.clear(gl.COLOR_BUFFER_BIT);\n }\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.clear(gl.COLOR_BUFFER_BIT);\n }\n\n destroy(): void {\n const { gl } = this;\n this.release();\n for (const pass of FLUID_PASSES) gl.deleteProgram(this.programs[pass].program);\n gl.deleteBuffer(this.quad);\n }\n\n // Resources\n\n private release(): void {\n const { gl } = this;\n for (const target of this.targets()) {\n gl.deleteFramebuffer(target.framebuffer);\n gl.deleteTexture(target.texture);\n }\n this.velocity = this.dye = this.pressure = null;\n this.curl = this.divergence = null;\n }\n\n private targets(): Target[] {\n const out: Target[] = [];\n for (const pair of [this.velocity, this.dye, this.pressure]) if (pair) out.push(pair.read, pair.write);\n for (const one of [this.curl, this.divergence]) if (one) out.push(one);\n return out;\n }\n\n private pair(width: number, height: number): Pair {\n return { read: this.target(width, height), write: this.target(width, height) };\n }\n\n private target(width: number, height: number): Target {\n const { gl, formats } = this;\n const texture = gl.createTexture();\n const framebuffer = gl.createFramebuffer();\n if (!texture || !framebuffer) throw new Error('fluid: no texture');\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texImage2D(gl.TEXTURE_2D, 0, formats.internalFormat, width, height, 0, formats.format, formats.type, null);\n gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);\n gl.viewport(0, 0, width, height);\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n return { texture, framebuffer, width, height, texelX: 1 / width, texelY: 1 / height };\n }\n\n // Drawing\n\n private bind(location: WebGLUniformLocation | null, target: Target, unit: number): void {\n const { gl } = this;\n gl.activeTexture(gl.TEXTURE0 + unit);\n gl.bindTexture(gl.TEXTURE_2D, target.texture);\n gl.uniform1i(location, unit);\n }\n\n private blit(target: Target): void {\n const { gl } = this;\n gl.bindFramebuffer(gl.FRAMEBUFFER, target.framebuffer);\n gl.viewport(0, 0, target.width, target.height);\n this.draw();\n }\n\n private draw(): void {\n const { gl } = this;\n gl.bindBuffer(gl.ARRAY_BUFFER, this.quad);\n gl.enableVertexAttribArray(0);\n gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);\n gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n }\n\n // Programs\n\n private shader(kind: number, source: string): WebGLShader {\n const { gl } = this;\n const shader = gl.createShader(kind);\n if (!shader) throw new Error('fluid: no shader');\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n const log = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error(`fluid: shader failed: ${log ?? ''}`);\n }\n return shader;\n }\n\n private program(vertex: WebGLShader, source: string): Program {\n const { gl } = this;\n const fragment = this.shader(gl.FRAGMENT_SHADER, source);\n const program = gl.createProgram();\n if (!program) throw new Error('fluid: no program');\n gl.attachShader(program, vertex);\n gl.attachShader(program, fragment);\n gl.bindAttribLocation(program, 0, 'aPosition');\n gl.linkProgram(program);\n gl.deleteShader(fragment);\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n const log = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n throw new Error(`fluid: program failed: ${log ?? ''}`);\n }\n const uniforms: Record<string, WebGLUniformLocation | null> = {};\n for (const text of [VERTEX, source]) {\n for (const match of text.matchAll(UNIFORM)) uniforms[match[1]] = gl.getUniformLocation(program, match[1]);\n }\n return { program, uniforms };\n }\n}\n\nfunction swap(pair: Pair): void {\n const read = pair.read;\n pair.read = pair.write;\n pair.write = read;\n}\n\n/** The half-float render-target formats the context offers, or `null` where it offers none. */\nfunction formats(gl: FluidGLContext): Formats | null {\n const gl2 = typeof WebGL2RenderingContext !== 'undefined' && gl instanceof WebGL2RenderingContext;\n if (gl2) {\n if (!gl.getExtension('EXT_color_buffer_float') && !gl.getExtension('EXT_color_buffer_half_float')) return null;\n return { internalFormat: gl.RGBA16F, format: gl.RGBA, type: gl.HALF_FLOAT };\n }\n const half = gl.getExtension('OES_texture_half_float');\n if (!half || !gl.getExtension('OES_texture_half_float_linear')) return null;\n gl.getExtension('EXT_color_buffer_half_float');\n return { internalFormat: gl.RGBA, format: gl.RGBA, type: half.HALF_FLOAT_OES };\n}\n\n/**\n * The attributes the canvas's context is asked for: straight alpha, so the\n * display pass writes a colour and a coverage and the page composites them,\n * and no buffer the solver does not use.\n */\nconst FLUID_CONTEXT_ATTRIBUTES: WebGLContextAttributes = {\n alpha: true,\n premultipliedAlpha: false,\n antialias: false,\n depth: false,\n stencil: false,\n preserveDrawingBuffer: false,\n powerPreference: 'low-power',\n};\n\n/**\n * A solver on `gl`, or `null` where the context cannot render into half-float\n * textures: the formats are probed first, then a trial target is checked for\n * completeness, since an extension listed is not a target that works.\n */\nfunction createFluidSim(gl: FluidGLContext): FluidSim | null {\n const found = formats(gl);\n if (!found) return null;\n let sim: Sim;\n try {\n sim = new Sim(gl, found);\n sim.resize(2, 2, 2, 2);\n } catch {\n return null;\n }\n const complete = gl.checkFramebufferStatus(gl.FRAMEBUFFER) === gl.FRAMEBUFFER_COMPLETE;\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n if (!complete) {\n sim.destroy();\n return null;\n }\n return sim;\n}\n\nexport { FLUID_PASSES, FLUID_CONTEXT_ATTRIBUTES, createFluidSim };\nexport type { FluidGLContext, FluidPass, FluidStepParams, FluidDisplayParams, FluidSim };\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { WrFluidCursorQuality } from './types';\n\n/**\n * The density under which a dye is not seen: the display pass maps it to an\n * alpha of about two percent. `trail` is the time a fresh splat takes to get\n * here, and the loop stops once the last splat is this far behind.\n */\nconst FLOOR = 0.012;\n\n/** A splat lands denser than one where strokes overlap; the rest time allows for this much. */\nconst PEAK = 2.5;\n\n/** The pointer is never read faster than this, in CSS px per second: a jump across the region is not a stroke. */\nconst SPEED_MAX = 4000;\n\n/** How far the pointer travels for the palette to run one full cycle, in CSS px. */\nconst CYCLE_PX = 900;\n\n/**\n * A fresh splat is laid every this many radii along a stroke, so a fast move\n * leaves a continuous line, and no more than this many per event.\n */\nconst SPLAT_GAP = 0.6;\nconst SPLATS_MAX = 12;\n\n/** A click's splash: this many rays around the point, each this many splats long, at this speed in CSS px per second, leaning this far sideways. */\nconst SPLASH_RAYS = 7;\nconst SPLASH_STEPS = 3;\nconst SPLASH_SPEED = 900;\nconst SPLASH_SPIN = 0.6;\n\n/** A grid never shrinks under this on a side. */\nconst SIDE_MIN = 2;\n\n/** One quality step: the short side of the velocity grid and of the dye grid, in texels, and the pressure solve's Jacobi iterations. */\ninterface FluidQuality {\n readonly sim: number;\n readonly dye: number;\n readonly iterations: number;\n}\n\n/** The grids and the pressure solve per quality. */\nconst QUALITY: Readonly<Record<WrFluidCursorQuality, FluidQuality>> = {\n low: { sim: 96, dye: 384, iterations: 12 },\n medium: { sim: 128, dye: 640, iterations: 20 },\n high: { sim: 192, dye: 1024, iterations: 28 },\n};\n\n/** A grid's size in texels. */\ninterface FluidGrid {\n readonly width: number;\n readonly height: number;\n}\n\n/**\n * A grid over a `width` by `height` region with `short` texels on its short\n * side and the region's aspect ratio, held under `maxPixels` texels in all,\n * never under two a side.\n */\nfunction fluidGrid(width: number, height: number, short: number, maxPixels: number): FluidGrid {\n if (!(width > 0) || !(height > 0)) return { width: SIDE_MIN, height: SIDE_MIN };\n const aspect = width / height;\n let w = aspect >= 1 ? short * aspect : short;\n let h = aspect >= 1 ? short : short / aspect;\n const over = (w * h) / maxPixels;\n if (over > 1) {\n const scale = 1 / Math.sqrt(over);\n w *= scale;\n h *= scale;\n }\n return { width: Math.max(SIDE_MIN, Math.round(w)), height: Math.max(SIDE_MIN, Math.round(h)) };\n}\n\n/**\n * The rate, per second, at which a field decays so that a unit of it reaches\n * {@link FLOOR} in `seconds`; a non-positive time means no decay at all.\n */\nfunction fluidDecay(seconds: number): number {\n return seconds > 0 ? Math.log(1 / FLOOR) / seconds : 0;\n}\n\n/**\n * How long after the last input the dye is sure to be under {@link FLOOR}, in\n * ms: `trail` seconds for a unit splat, longer for the {@link PEAK} that\n * overlapping strokes reach.\n */\nfunction fluidRestMs(trail: number): number {\n if (!(trail > 0)) return 0;\n return Math.round(trail * 1000 * (1 + Math.log(PEAK) / Math.log(1 / FLOOR)));\n}\n\n/**\n * The pointer's velocity in CSS px per second, from a move of `dx`, `dy` in\n * `dtMs`, the speed clamped at {@link SPEED_MAX}; a move with no time in it is\n * read as one ms. Written into `out`.\n */\nfunction fluidVelocity(dx: number, dy: number, dtMs: number, out: Float32Array): void {\n const dt = Math.max(dtMs, 1) / 1000;\n let vx = dx / dt;\n let vy = dy / dt;\n const speed = Math.hypot(vx, vy);\n if (speed > SPEED_MAX) {\n vx *= SPEED_MAX / speed;\n vy *= SPEED_MAX / speed;\n }\n out[0] = vx;\n out[1] = vy;\n}\n\n/** How many splats a move of `distance` CSS px takes, at `radius`: one when still, one per {@link SPLAT_GAP} radii, at most {@link SPLATS_MAX}. */\nfunction fluidSplats(distance: number, radius: number): number {\n if (!(distance > 0) || !(radius > 0)) return 1;\n return Math.min(SPLATS_MAX, Math.max(1, Math.ceil(distance / (radius * SPLAT_GAP))));\n}\n\n/**\n * How much of its dye each of the `splats` a move of `distance` is laid as\n * carries: the share of a full gap it covers, so a stroke lays the same ink\n * per px travelled whether the pointer crawls or sweeps, and a still pointer\n * lays none.\n */\nfunction fluidDyeScale(distance: number, splats: number, radius: number): number {\n if (!(radius > 0) || !(splats > 0)) return 1;\n return Math.min(1, Math.max(0, distance / splats / (radius * SPLAT_GAP)));\n}\n\n/** A colour as three channels in 0..1. */\ntype FluidColor = readonly [number, number, number];\n\n/**\n * The palette's colour at `phase`, the cycle position with a period of one:\n * a blend of two neighbours, with the brightness of a blend held between\n * theirs, so a cool and a warm ink do not meet in grey. Written into `out`.\n */\nfunction fluidPaletteColor(phase: number, palette: readonly FluidColor[], out: Float32Array): void {\n const n = palette.length;\n if (n === 0) {\n out[0] = out[1] = out[2] = 0;\n return;\n }\n const t = ((phase % 1) + 1) % 1;\n const slot = t * n;\n const i = Math.floor(slot) % n;\n const j = (i + 1) % n;\n const f = slot - Math.floor(slot);\n const a = palette[i];\n const b = palette[j];\n const peak = Math.max(a[0], a[1], a[2]) * (1 - f) + Math.max(b[0], b[1], b[2]) * f;\n let r = a[0] * (1 - f) + b[0] * f;\n let g = a[1] * (1 - f) + b[1] * f;\n let bl = a[2] * (1 - f) + b[2] * f;\n const max = Math.max(r, g, bl);\n if (max > 0) {\n const k = peak / max;\n r *= k;\n g *= k;\n bl *= k;\n }\n out[0] = r;\n out[1] = g;\n out[2] = bl;\n}\n\n/** A saturated hue at `phase`, the hue circle with a period of one, written into `out`. */\nfunction fluidRainbowColor(phase: number, out: Float32Array): void {\n const h = (((phase % 1) + 1) % 1) * 6;\n const x = 1 - Math.abs((h % 2) - 1);\n let r = 0;\n let g = 0;\n let b = 0;\n if (h < 1) [r, g] = [1, x];\n else if (h < 2) [r, g] = [x, 1];\n else if (h < 3) [g, b] = [1, x];\n else if (h < 4) [g, b] = [x, 1];\n else if (h < 5) [r, b] = [x, 1];\n else [r, b] = [1, x];\n // Pulled a little toward white, so the pure corners of the hue circle sit with the theme inks.\n const s = 0.9;\n out[0] = r * s + (1 - s);\n out[1] = g * s + (1 - s);\n out[2] = b * s + (1 - s);\n}\n\n/** Whether a surface is light, so the dye is laid as ink over it rather than lit on it. */\nfunction fluidInk(surface: FluidColor): boolean {\n return 0.2126 * surface[0] + 0.7152 * surface[1] + 0.0722 * surface[2] > 0.5;\n}\n\n/**\n * The rays of a click's splash: {@link SPLASH_RAYS} directions around the\n * point, each as a velocity of {@link SPLASH_SPEED} CSS px per second scaled\n * by `force`, leaning {@link SPLASH_SPIN} of that sideways, so the splash\n * turns as it spreads and the vorticity curls each ray; written into `out`\n * two numbers a ray. `seed` turns the fan so two splashes do not match.\n */\nfunction fluidSplash(force: number, seed: number, out: Float32Array): number {\n for (let i = 0; i < SPLASH_RAYS; i++) {\n const angle = ((i + seed) / SPLASH_RAYS) * Math.PI * 2;\n const c = Math.cos(angle);\n const sn = Math.sin(angle);\n out[i * 2] = (c - sn * SPLASH_SPIN) * SPLASH_SPEED * force;\n out[i * 2 + 1] = (sn + c * SPLASH_SPIN) * SPLASH_SPEED * force;\n }\n return SPLASH_RAYS;\n}\n\nexport {\n FLOOR,\n PEAK,\n SPEED_MAX,\n CYCLE_PX,\n SPLAT_GAP,\n SPLATS_MAX,\n SPLASH_RAYS,\n SPLASH_STEPS,\n SPLASH_SPEED,\n SPLASH_SPIN,\n QUALITY,\n fluidGrid,\n fluidDecay,\n fluidRestMs,\n fluidVelocity,\n fluidSplats,\n fluidDyeScale,\n fluidPaletteColor,\n fluidRainbowColor,\n fluidInk,\n fluidSplash,\n};\nexport type { FluidQuality, FluidGrid, FluidColor };\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n PLATFORM_ID,\n ViewEncapsulation,\n afterNextRender,\n booleanAttribute,\n effect,\n inject,\n input,\n untracked,\n viewChild,\n} from '@angular/core';\n\nimport { WrPlatform } from 'ngwr/platform';\nimport { wrNumAttr, wrResolveCssColorChannels, wrWatchColorScheme, wrCheckStyles } from 'ngwr/utils';\n\nimport { MAX_FRAME_MS, MAX_PIXELS, canvasBackdropRatio } from '../internal';\n\nimport { FLUID_CONTEXT_ATTRIBUTES, type FluidGLContext, type FluidSim, createFluidSim } from './fluid-gl';\nimport {\n CYCLE_PX,\n type FluidColor,\n QUALITY,\n SPLASH_RAYS,\n SPLASH_SPIN,\n SPLASH_STEPS,\n fluidDecay,\n fluidDyeScale,\n fluidGrid,\n fluidInk,\n fluidPaletteColor,\n fluidRainbowColor,\n fluidRestMs,\n fluidSplash,\n fluidSplats,\n fluidVelocity,\n} from './fluid-model';\nimport type { WrFluidCursorQuality } from './types';\n\n/** The palette hooks, in stroke order, each with what it is read as where the sheet is missing. */\nconst PALETTE_HOOKS: readonly (readonly [string, string])[] = [\n ['var(--wr-fluid-cursor-color-1)', '#3969e2'],\n ['var(--wr-fluid-cursor-color-2)', '#dc3137'],\n ['var(--wr-fluid-cursor-color-3)', '#ffba00'],\n ['var(--wr-fluid-cursor-color-4)', '#008800'],\n ['var(--wr-fluid-cursor-color-5)', '#3472d9'],\n];\n\n/** How much of the pointer's speed a unit `force` hands the fluid. */\nconst FORCE_BASE = 0.55;\n/** The density a unit `intensity` lays per splat. */\nconst DYE_BASE = 0.3;\n/** The vorticity confinement a unit `swirl` applies. */\nconst SWIRL_BASE = 24;\n/**\n * A click's splash: each ray is {@link SPLASH_STEPS} splats out along its\n * direction, this many radii apart, each this fraction of the radius and\n * narrower than the last, with this much of a stroke's dye. The arm is laid\n * as dye, not left to the push: an outward push alone is divergence, and the\n * pressure solve takes it straight back out.\n */\nconst SPLASH_OFFSET = 0.7;\nconst SPLASH_RAY = 0.55;\nconst SPLASH_DYE = 1.5;\n/** A click turns the palette this far, so the splash is not the stroke's colour. */\nconst SPLASH_PHASE = 0.17;\n\n/**\n * Coloured ink behind a region's content, stirred by the pointer: a move lays\n * dye and momentum into a fluid, and the dye swirls into curling eddies,\n * folds over itself, drifts on with the motion the pointer gave it and fades\n * out over a few seconds. A fast stroke leaves a long sweeping trail with\n * vortices peeling off; a slow one soft billows; a click a radial splash.\n * The fluid is `fluid-gl.ts`, a stable-fluids solver as WebGL passes; the\n * pure pieces (grids, decay, splat spacing, palette) are `fluid-model.ts`.\n *\n * Fills its positioned parent, which isolates itself, so the host's negative\n * z-index lands under the content and over the page background. The parent\n * takes the pointer, passively: the host and its canvas never do. A mouse,\n * a pen and a finger all draw; a finger is never stopped from scrolling. The\n * context and the fields are created at the first input, not at mount, so a\n * region nobody hovers costs nothing; the frame loop runs only while the\n * host is on screen, the document is visible and the last input is nearer\n * than the time the dye takes to fade (`trail`, from the model, no\n * read-back), and stops on its own after that, the fields cleared.\n *\n * Colours come from the `--wr-fluid-cursor-color-*` hooks through\n * `wrResolveCssColorChannels`, re-read when the scheme changes; a stroke\n * cycles through them as it goes, or through the hue circle under `rainbow`.\n * The display pass reads the surface too: on a light one the dye is laid as\n * ink, its colour at full saturation under a coverage that rises with its\n * density, so it reads as ink on white and not as a glow; on a dark one the\n * coverage rises faster, so a thin strand still shows. Under\n * `prefers-reduced-motion: reduce` nothing is drawn; under `forced-colors:\n * active` nothing is; on the server the empty canvas is rendered, absolutely\n * positioned, so the browser's first draw shifts no layout. A lost context\n * is let go and rebuilt when it comes back. Decorative: `aria-hidden`, no\n * pointer events. Styles: `@use 'ngwr/animations/fluid-cursor'`, which also\n * lists the hooks.\n */\n@Component({\n selector: 'wr-fluid-cursor',\n templateUrl: './fluid-cursor.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-fluid-cursor', 'aria-hidden': 'true' },\n})\nexport class WrFluidCursor {\n /** How much dye a move lays, a multiplier. @default 1 */\n readonly intensity = input(1, { transform: wrNumAttr(1) });\n /** The radius of a splat, in CSS px: how wide the ink the pointer lays is. @default 24 */\n readonly size = input(24, { transform: wrNumAttr(24) });\n /** How much of the pointer's speed the fluid takes, a multiplier. @default 1 */\n readonly force = input(1, { transform: wrNumAttr(1) });\n /** How strongly the eddies are fed back, a multiplier: more curls the trail tighter, none lets it smooth out. @default 1 */\n readonly swirl = input(1, { transform: wrNumAttr(1) });\n /** How long the dye lasts, in seconds, from a fresh splat to gone. @default 3 */\n readonly trail = input(3, { transform: wrNumAttr(3) });\n /** How long the motion the pointer gave lasts, in seconds. @default 6 */\n readonly momentum = input(6, { transform: wrNumAttr(6) });\n /** Whether the dye is shaded by its own relief, a slight lighting from the top left. @default true */\n readonly shading = input(true, { transform: booleanAttribute });\n /** Whether a stroke cycles the hue circle instead of the theme's palette. @default false */\n readonly rainbow = input(false, { transform: booleanAttribute });\n /** Whether a click or a tap splashes the ink outward from the point. @default true */\n readonly clickSplash = input(true, { transform: booleanAttribute });\n /** How finely the fluid is simulated: the grids and the pressure solve. @default 'medium' */\n readonly quality = input<WrFluidCursorQuality>('medium');\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly platform = inject(WrPlatform);\n private readonly doc = inject(DOCUMENT);\n private readonly canvasRef = viewChild.required<ElementRef<HTMLCanvasElement>>('canvas');\n\n private gl: FluidGLContext | null = null;\n private sim: FluidSim | null = null;\n /** Set once the browser was asked for a context, so a refusal is not asked again. */\n private contextTried = false;\n\n /** The host's CSS size, zero until the first layout. */\n private width = 0;\n private height = 0;\n private simWidth = 1;\n private ink = false;\n private readonly palette: FluidColor[] = [];\n private readonly color = new Float32Array(3);\n private readonly velocity = new Float32Array(2);\n private readonly rays = new Float32Array(SPLASH_RAYS * 2);\n private phase = 0;\n\n /** The scene's clock, in ms: moves only while a frame runs, so a hidden tab holds the ink. */\n private time = 0;\n /** When, on that clock, the last input's dye is gone. */\n private restAt = 0;\n private running = false;\n private rafId: number | null = null;\n private lastFrame = 0;\n private resizeRafId: number | null = null;\n private pendingWidth = 0;\n private pendingHeight = 0;\n private inView = false;\n private mounted = false;\n\n /** Where and when the pointer last was over the parent, in CSS px; NaN between strokes. */\n private lastX = NaN;\n private lastY = NaN;\n private lastTime = 0;\n\n private resizeObserver: ResizeObserver | null = null;\n private viewObserver: IntersectionObserver | null = null;\n private pointerTarget: HTMLElement | null = null;\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('animations/fluid-cursor');\n if (!isPlatformBrowser(inject(PLATFORM_ID))) return;\n\n effect(() => {\n this.platform.pageVisible();\n this.platform.prefersReducedMotion();\n untracked(() => this.sync());\n });\n effect(() => {\n this.quality();\n untracked(() => this.relayout());\n });\n wrWatchColorScheme(() => this.resolveColors());\n\n afterNextRender(() => this.mount());\n inject(DestroyRef).onDestroy(() => this.unmount());\n }\n\n // Lifecycle\n\n private mount(): void {\n // Nothing drawn under forced colours: the stylesheet hides the host too.\n if (this.doc.defaultView?.matchMedia?.('(forced-colors: active)').matches) return;\n const host = this.host.nativeElement;\n this.mounted = true;\n\n if (typeof ResizeObserver !== 'undefined') {\n this.resizeObserver = new ResizeObserver(entries => {\n const rect = entries[entries.length - 1]?.contentRect;\n this.scheduleResize(rect?.width ?? host.clientWidth, rect?.height ?? host.clientHeight);\n });\n this.resizeObserver.observe(host);\n } else {\n this.layout(host.clientWidth, host.clientHeight);\n }\n\n if (typeof IntersectionObserver !== 'undefined') {\n this.viewObserver = new IntersectionObserver(entries => {\n this.inView = entries[entries.length - 1]?.isIntersecting ?? false;\n this.sync();\n });\n this.viewObserver.observe(host);\n } else {\n this.inView = true;\n }\n\n const canvas = this.canvasRef().nativeElement;\n canvas.addEventListener('webglcontextlost', this.onContextLost);\n canvas.addEventListener('webglcontextrestored', this.onContextRestored);\n\n const target = host.parentElement;\n this.pointerTarget = target;\n target?.addEventListener('pointermove', this.onPointerMove, { passive: true });\n target?.addEventListener('pointerdown', this.onPointerDown, { passive: true });\n target?.addEventListener('pointerleave', this.onPointerLeave, { passive: true });\n }\n\n private unmount(): void {\n this.running = false;\n this.stopLoop();\n if (this.resizeRafId !== null) cancelAnimationFrame(this.resizeRafId);\n this.resizeRafId = null;\n this.resizeObserver?.disconnect();\n this.resizeObserver = null;\n this.viewObserver?.disconnect();\n this.viewObserver = null;\n this.pointerTarget?.removeEventListener('pointermove', this.onPointerMove);\n this.pointerTarget?.removeEventListener('pointerdown', this.onPointerDown);\n this.pointerTarget?.removeEventListener('pointerleave', this.onPointerLeave);\n this.pointerTarget = null;\n if (this.mounted) {\n const canvas = this.canvasRef().nativeElement;\n canvas.removeEventListener('webglcontextlost', this.onContextLost);\n canvas.removeEventListener('webglcontextrestored', this.onContextRestored);\n }\n this.sim?.destroy();\n this.sim = null;\n // The context itself is let go now rather than when the canvas is collected.\n this.gl?.getExtension('WEBGL_lose_context')?.loseContext();\n this.gl = null;\n this.mounted = false;\n }\n\n // Context\n\n /** The context and the solver, made at the first input; `null` under reduced motion and where the browser has neither WebGL. */\n private ensure(): FluidSim | null {\n if (this.platform.prefersReducedMotion()) return null;\n if (this.sim) return this.sim;\n if (this.contextTried || !this.mounted) return null;\n this.contextTried = true;\n const canvas = this.canvasRef().nativeElement;\n const gl =\n canvas.getContext('webgl2', FLUID_CONTEXT_ATTRIBUTES) ?? canvas.getContext('webgl', FLUID_CONTEXT_ATTRIBUTES);\n if (!gl) return null;\n this.gl = gl;\n this.sim = createFluidSim(gl);\n if (!this.sim) return null;\n this.resolveColors();\n this.relayout();\n return this.sim;\n }\n\n private readonly onContextLost = (event: Event): void => {\n // Not prevented, the browser never restores it.\n event.preventDefault();\n this.sim = null;\n this.running = false;\n this.stopLoop();\n };\n\n private readonly onContextRestored = (): void => {\n if (!this.gl) return;\n this.sim = createFluidSim(this.gl);\n this.relayout();\n this.sync();\n };\n\n // Layout\n\n private scheduleResize(width: number, height: number): void {\n this.pendingWidth = width;\n this.pendingHeight = height;\n if (this.resizeRafId !== null) return;\n this.resizeRafId = requestAnimationFrame(() => {\n this.resizeRafId = null;\n this.layout(this.pendingWidth, this.pendingHeight);\n });\n }\n\n private layout(width: number, height: number): void {\n if (width <= 0 || height <= 0) return;\n this.width = width;\n this.height = height;\n this.relayout();\n }\n\n /** Sizes the canvas and the grids for the current size and quality; the fields start over. */\n private relayout(): void {\n if (!this.sim || this.width === 0) return;\n const canvas = this.canvasRef().nativeElement;\n const dpr = canvasBackdropRatio(this.width, this.height, this.doc.defaultView?.devicePixelRatio ?? 1);\n canvas.width = Math.round(this.width * dpr);\n canvas.height = Math.round(this.height * dpr);\n const quality = QUALITY[untracked(this.quality)];\n const sim = fluidGrid(this.width, this.height, quality.sim, MAX_PIXELS);\n const dye = fluidGrid(this.width, this.height, Math.min(quality.dye, canvas.width, canvas.height), MAX_PIXELS);\n this.simWidth = sim.width;\n this.sim.resize(sim.width, sim.height, dye.width, dye.height);\n this.sim.size(this.width, this.height);\n this.sim.render(canvas.width, canvas.height, { ink: this.ink, shading: 0 });\n this.sync();\n }\n\n // Colours\n\n private resolveColors(): void {\n if (!this.sim) return;\n const canvas = this.canvasRef().nativeElement;\n this.palette.length = 0;\n for (const [hook, fallback] of PALETTE_HOOKS) this.palette.push(wrResolveCssColorChannels(canvas, hook, fallback));\n this.ink = fluidInk(wrResolveCssColorChannels(canvas, 'var(--wr-color-surface)', '#ffffff'));\n }\n\n /** The stroke's colour at its phase, into `color`. */\n private tint(): void {\n if (untracked(this.rainbow)) fluidRainbowColor(this.phase, this.color);\n else fluidPaletteColor(this.phase, this.palette, this.color);\n }\n\n // Pointer\n\n private readonly onPointerMove = (event: PointerEvent): void => {\n const sim = this.ensure();\n if (!sim || this.width === 0) return;\n const rect = this.canvasRef().nativeElement.getBoundingClientRect();\n const x = event.clientX - rect.left;\n const y = event.clientY - rect.top;\n const now = event.timeStamp;\n if (!Number.isNaN(this.lastX)) {\n const dx = x - this.lastX;\n const dy = y - this.lastY;\n const distance = Math.hypot(dx, dy);\n if (distance > 0) {\n const radius = untracked(this.size);\n const force = untracked(this.force) * FORCE_BASE * (this.simWidth / this.width);\n const n = fluidSplats(distance, radius);\n const dye = untracked(this.intensity) * DYE_BASE * fluidDyeScale(distance, n, radius);\n fluidVelocity(dx, dy, now - this.lastTime, this.velocity);\n const vx = this.velocity[0] * force;\n const vy = -this.velocity[1] * force;\n for (let k = 1; k <= n; k++) {\n const t = k / n;\n this.phase += distance / n / CYCLE_PX;\n this.tint();\n sim.splat(\n (this.lastX + dx * t) / this.width,\n 1 - (this.lastY + dy * t) / this.height,\n vx,\n vy,\n this.color[0] * dye,\n this.color[1] * dye,\n this.color[2] * dye,\n radius\n );\n }\n this.touch();\n }\n }\n this.lastX = x;\n this.lastY = y;\n this.lastTime = now;\n };\n\n private readonly onPointerDown = (event: PointerEvent): void => {\n const sim = this.ensure();\n if (!sim || this.width === 0) return;\n const rect = this.canvasRef().nativeElement.getBoundingClientRect();\n const x = event.clientX - rect.left;\n const y = event.clientY - rect.top;\n this.lastX = x;\n this.lastY = y;\n this.lastTime = event.timeStamp;\n if (!untracked(this.clickSplash) || event.button !== 0) return;\n\n const radius = untracked(this.size);\n const force = untracked(this.force);\n const dye = untracked(this.intensity) * DYE_BASE * SPLASH_DYE;\n const scale = this.simWidth / this.width;\n this.phase += SPLASH_PHASE;\n this.tint();\n const n = fluidSplash(force, this.phase * SPLASH_RAYS, this.rays);\n for (let i = 0; i < n; i++) {\n const rx = this.rays[i * 2];\n const ry = this.rays[i * 2 + 1];\n // The arm lies along the ray's own direction, before the spin is added.\n const angle = Math.atan2(ry, rx) - Math.atan(SPLASH_SPIN);\n for (let k = 1; k <= SPLASH_STEPS; k++) {\n const px = x + Math.cos(angle) * radius * SPLASH_OFFSET * k;\n const py = y + Math.sin(angle) * radius * SPLASH_OFFSET * k;\n const taper = 1 - (k - 1) / (SPLASH_STEPS + 1);\n sim.splat(\n px / this.width,\n 1 - py / this.height,\n rx * scale,\n -ry * scale,\n this.color[0] * dye,\n this.color[1] * dye,\n this.color[2] * dye,\n radius * SPLASH_RAY * taper\n );\n }\n }\n this.touch();\n };\n\n private readonly onPointerLeave = (): void => {\n this.lastX = NaN;\n this.lastY = NaN;\n };\n\n /** An input landed: the dye is live for `trail` from now. */\n private touch(): void {\n this.restAt = this.time + fluidRestMs(untracked(this.trail));\n this.sync();\n }\n\n // Loop\n\n private active(): boolean {\n return this.sim !== null && this.time < this.restAt;\n }\n\n private sync(): void {\n const reduced = this.platform.prefersReducedMotion();\n const allowed = this.mounted && this.width > 0 && this.inView && this.platform.pageVisible() && !reduced;\n if (reduced && this.active()) this.rest();\n const run = allowed && this.active();\n if (run === this.running) return;\n this.running = run;\n if (run) {\n this.lastFrame = performance.now();\n this.rafId = requestAnimationFrame(this.frame);\n return;\n }\n this.stopLoop();\n }\n\n /** The fields and the canvas emptied, and nothing left to move. */\n private rest(): void {\n this.restAt = this.time;\n this.sim?.clear();\n }\n\n private stopLoop(): void {\n if (this.rafId !== null) cancelAnimationFrame(this.rafId);\n this.rafId = null;\n }\n\n private readonly frame = (now: number): void => {\n this.rafId = null;\n if (!this.running) return;\n const sim = this.sim;\n if (!sim) {\n this.running = false;\n return;\n }\n const dt = Math.min(Math.max(now - this.lastFrame, 0), MAX_FRAME_MS);\n this.lastFrame = now;\n this.time += dt;\n const quality = QUALITY[untracked(this.quality)];\n sim.step(dt / 1000, {\n dyeDecay: fluidDecay(untracked(this.trail)),\n velocityDecay: fluidDecay(untracked(this.momentum)),\n swirl: untracked(this.swirl) * SWIRL_BASE,\n iterations: quality.iterations,\n });\n const canvas = this.canvasRef().nativeElement;\n sim.render(canvas.width, canvas.height, { ink: this.ink, shading: untracked(this.shading) ? 1 : 0 });\n if (!this.active()) {\n // The dye is under the floor: the fields are emptied, so nothing faint lingers, and the loop ends.\n this.rest();\n this.running = false;\n return;\n }\n this.rafId = requestAnimationFrame(this.frame);\n };\n}\n","<canvas #canvas class=\"wr-fluid-cursor__canvas\"></canvas>\n"],"mappings":";;;;;;;;;;;;AAmCA,MAAM,eAAe;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACQ;AAqEV,MAAM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CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,UAAQ,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-animations-glitch.mjs","names":["DOCUMENT"],"sources":["../../../projects/lib/animations/glitch/glitch.ts","../../../projects/lib/animations/glitch/public-api.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport {\n DestroyRef,\n Directive,\n ElementRef,\n PLATFORM_ID,\n afterNextRender,\n booleanAttribute,\n computed,\n effect,\n inject,\n input,\n signal,\n untracked,\n} from '@angular/core';\n\nimport { WrPlatform } from 'ngwr/platform';\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport { FOCUSABLE, optionalSelector } from '../internal';\n\n/**\n * A short piece of text that looks like a broken signal while the pointer is\n * over it: two tinted copies of it are cut into thin horizontal slices that\n * jump sideways by a few pixels while the text itself leans and shifts a\n * little. The moment the pointer leaves, everything snaps back clean.\n *\n * It plays only under a pointer or with keyboard focus, never on its own: a\n * pointer entering the target (or its closest focusable ancestor, which is\n * what a keyboard reaches) starts it, and the matching leave or focusout stops\n * it. While it plays the stylesheet loops one cycle of `--wr-glitch-cycle`,\n * 1.2 s unset, in six held steps; each step shows one thin slice of each\n * copy, and the twelve slices of a cycle are disjoint bands of the line, so no\n * point of the text is lit more than once per cycle by either copy. Any one\n * second therefore holds at most two opposing pairs of luminance changes at\n * any point (the end of one cycle and the start of the next), where WCAG 2.3.1\n * allows three, and each is a faint tint over a thin band of glyphs, never a\n * strobe: the copies are theme inks mixed to about half strength and offset\n * by a few pixels, so the text reads in its own colour at every frame.\n * Nothing runs while the document is hidden, and a pointer still over the\n * target when it is shown again picks the effect back up.\n *\n * The effect usually sits on its host, but a selector as the directive's value\n * points it at one descendant instead, for a heading a library component draws\n * (`<wr-result-404 wrGlitch=\".wr-result__title\">`). The target is looked up\n * once after the first render; if nothing matches, nothing happens.\n *\n * The text is never touched: its node stays where it is, with its bindings.\n * The copies are two `aria-hidden` spans appended to the target while it plays\n * and removed after. They are absolutely positioned over the target's box, so\n * the line never moves, and they sit outside the selection (`user-select:\n * none`), so a copy of the page gives the text once. Nothing plays under\n * `prefers-reduced-motion: reduce`, under `forced-colors: active` or on the\n * server.\n */\n@Directive({\n selector: '[wrGlitch]',\n})\nexport class WrGlitch {\n /**\n * A selector for one descendant of the host to glitch instead of the host\n * itself, written as the directive's own value: `wrGlitch=\".wr-result__title\"`.\n * Resolved once after the first render with `querySelector`; a selector that\n * matches nothing turns the effect off. Unset or empty, the host.\n */\n readonly target = input<string | null, unknown>(null, { alias: 'wrGlitch', transform: optionalSelector });\n\n /**\n * Plays the effect while true, exactly as under a pointer; hover and focus\n * still start it when this is false. Drive it with short bursts to make a\n * tile glitch on its own: keep each burst to one cycle or more and the gaps\n * longer than the burst, so the flash budget above holds.\n */\n readonly active = input(false, { transform: booleanAttribute });\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly platform = inject(WrPlatform);\n private readonly doc = inject(DOCUMENT);\n /** A pointer is over the source, or focus is in it. */\n private readonly engaged = signal(false);\n private readonly playing = computed(() => this.engaged() || this.active());\n private listeners: AbortController | null = null;\n /** The element that glitches, once resolved and armed; `null` before and after. */\n private el: HTMLElement | null = null;\n private copies: HTMLElement[] = [];\n private live = false;\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('animations/glitch');\n if (!isPlatformBrowser(inject(PLATFORM_ID))) return;\n\n afterNextRender(() => {\n if (this.platform.prefersReducedMotion()) return;\n // The stylesheet paints no copy under forced colours: nothing to run.\n if (this.doc.defaultView?.matchMedia?.('(forced-colors: active)').matches) return;\n\n const host = this.host.nativeElement;\n const selector = this.target();\n const el = selector ? host.querySelector<HTMLElement>(selector) : host;\n if (!el) return;\n this.el = el;\n el.classList.add('wr-glitch');\n this.listen();\n });\n\n // One place decides whether it plays: engaged, page visible, motion allowed.\n effect(() => {\n const on = this.playing() && this.platform.pageVisible() && !this.platform.prefersReducedMotion();\n untracked(() => (on ? this.start() : this.stop()));\n });\n\n inject(DestroyRef).onDestroy(() => {\n this.listeners?.abort();\n this.listeners = null;\n this.stop();\n this.el?.classList.remove('wr-glitch');\n this.el = null;\n });\n }\n\n /**\n * Read on the glitching element, or its closest focusable ancestor, which is\n * what a keyboard reaches. Not the host: on a targeted heading the host is a\n * whole component, and a focus on one of its buttons is not about the heading.\n */\n private listen(): void {\n const el = this.el ?? this.host.nativeElement;\n const source = el.closest<HTMLElement>(FOCUSABLE) ?? el;\n this.listeners = new AbortController();\n const options = { signal: this.listeners.signal, passive: true };\n source.addEventListener('pointerenter', () => this.engaged.set(true), options);\n source.addEventListener('pointerleave', () => this.engaged.set(false), options);\n source.addEventListener('focusin', () => this.engaged.set(true), options);\n source.addEventListener('focusout', () => this.engaged.set(false), options);\n }\n\n /** The copies go in and the target gets the modifier; the stylesheet loops from there. Idempotent. */\n private start(): void {\n const el = this.el;\n if (this.live || !el) return;\n this.live = true;\n const text = el.textContent ?? '';\n if (text.trim() !== '') {\n this.copies = ['a', 'b'].map(which => {\n const copy = el.ownerDocument.createElement('span');\n copy.className = `wr-glitch__copy wr-glitch__copy--${which}`;\n copy.setAttribute('aria-hidden', 'true');\n copy.textContent = text;\n return copy;\n });\n el.append(...this.copies);\n }\n el.classList.add('wr-glitch--live');\n }\n\n /** Take the copies and the modifier off the target. Idempotent. */\n private stop(): void {\n this.live = false;\n for (const copy of this.copies) copy.remove();\n this.copies = [];\n this.el?.classList.remove('wr-glitch--live');\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nexport { WrGlitch } from './glitch';\n"],"mappings":";;;;;;;;;;;;AAiEA,IAAa,WAAb,MAAa,SAAQ;CAOV,SAAS,MAA8B,MAAI;EAAA,GAAA,YAAA,EAAA,WAAA,SAAA,+BAAA,CAAA;EAAI,OAAO;EAAY,WAAW;CAAgB,CAAA;CAQ7F,SAAS,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,SAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CAE3C,OAAO,OAAgC,UAAU;CACjD,WAAW,OAAO,UAAU;CAC5B,MAAM,OAAOA,UAAQ;CAErB,UAAU,OAAO,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CACvB,UAAU,eAAe,KAAK,QAAO,KAAM,KAAK,OAAM,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAClE,YAAoC;CAEpC,KAAyB;CACzB,SAAwB,CAAA;CACxB,OAAO;CAEf,cAAA;EACE,IAAI,OAAO,cAAc,eAAe,WAAW,cAAc,mBAAmB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n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport {\n DestroyRef,\n Directive,\n ElementRef,\n PLATFORM_ID,\n afterNextRender,\n booleanAttribute,\n computed,\n effect,\n inject,\n input,\n signal,\n untracked,\n} from '@angular/core';\n\nimport { WrPlatform } from 'ngwr/platform';\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport { FOCUSABLE, optionalSelector } from '../internal';\n\n/**\n * A short piece of text that looks like a broken signal while the pointer is\n * over it: two tinted copies of it are cut into thin horizontal slices that\n * jump sideways by a few pixels while the text itself leans and shifts a\n * little. The moment the pointer leaves, everything snaps back clean.\n *\n * It plays only under a pointer or with keyboard focus, never on its own: a\n * pointer entering the target (or its closest focusable ancestor, which is\n * what a keyboard reaches) starts it, and the matching leave or focusout stops\n * it. While it plays the stylesheet loops one cycle of `--wr-glitch-cycle`,\n * 1.2 s unset, in six held steps; each step shows one thin slice of each\n * copy, and the twelve slices of a cycle are disjoint bands of the line, so no\n * point of the text is lit more than once per cycle by either copy. Any one\n * second therefore holds at most two opposing pairs of luminance changes at\n * any point (the end of one cycle and the start of the next), where WCAG 2.3.1\n * allows three, and each is a faint tint over a thin band of glyphs, never a\n * strobe: the copies are theme inks mixed to about half strength and offset\n * by a few pixels, so the text reads in its own colour at every frame.\n * Nothing runs while the document is hidden, and a pointer still over the\n * target when it is shown again picks the effect back up.\n *\n * The effect usually sits on its host, but a selector as the directive's value\n * points it at one descendant instead, for a heading a library component draws\n * (`<wr-result-404 wrGlitch=\".wr-result__title\">`). The target is looked up\n * once after the first render; if nothing matches, nothing happens.\n *\n * The text is never touched: its node stays where it is, with its bindings.\n * The copies are two `aria-hidden` spans appended to the target while it plays\n * and removed after. They are absolutely positioned over the target's box, so\n * the line never moves, and they sit outside the selection (`user-select:\n * none`), so a copy of the page gives the text once. Nothing plays under\n * `prefers-reduced-motion: reduce`, under `forced-colors: active` or on the\n * server.\n */\n@Directive({\n selector: '[wrGlitch]',\n})\nexport class WrGlitch {\n /**\n * A selector for one descendant of the host to glitch instead of the host\n * itself, written as the directive's own value: `wrGlitch=\".wr-result__title\"`.\n * Resolved once after the first render with `querySelector`; a selector that\n * matches nothing turns the effect off. Unset or empty, the host.\n */\n readonly target = input<string | null, unknown>(null, { alias: 'wrGlitch', transform: optionalSelector });\n\n /**\n * Plays the effect while true, exactly as under a pointer; hover and focus\n * still start it when this is false. Drive it with short bursts to make a\n * tile glitch on its own: keep each burst to one cycle or more and the gaps\n * longer than the burst, so the flash budget above holds.\n */\n readonly active = input(false, { transform: booleanAttribute });\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly platform = inject(WrPlatform);\n private readonly doc = inject(DOCUMENT);\n /** A pointer is over the source, or focus is in it. */\n private readonly engaged = signal(false);\n private readonly playing = computed(() => this.engaged() || this.active());\n private listeners: AbortController | null = null;\n /** The element that glitches, once resolved and armed; `null` before and after. */\n private el: HTMLElement | null = null;\n private copies: HTMLElement[] = [];\n private live = false;\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('animations/glitch');\n if (!isPlatformBrowser(inject(PLATFORM_ID))) return;\n\n afterNextRender(() => {\n if (this.platform.prefersReducedMotion()) return;\n // The stylesheet paints no copy under forced colours: nothing to run.\n if (this.doc.defaultView?.matchMedia?.('(forced-colors: active)').matches) return;\n\n const host = this.host.nativeElement;\n const selector = this.target();\n const el = selector ? host.querySelector<HTMLElement>(selector) : host;\n if (!el) return;\n this.el = el;\n el.classList.add('wr-glitch');\n this.listen();\n });\n\n // One place decides whether it plays: engaged, page visible, motion allowed.\n effect(() => {\n const on = this.playing() && this.platform.pageVisible() && !this.platform.prefersReducedMotion();\n untracked(() => (on ? this.start() : this.stop()));\n });\n\n inject(DestroyRef).onDestroy(() => {\n this.listeners?.abort();\n this.listeners = null;\n this.stop();\n this.el?.classList.remove('wr-glitch');\n this.el = null;\n });\n }\n\n /**\n * Read on the glitching element, or its closest focusable ancestor, which is\n * what a keyboard reaches. Not the host: on a targeted heading the host is a\n * whole component, and a focus on one of its buttons is not about the heading.\n */\n private listen(): void {\n const el = this.el ?? this.host.nativeElement;\n const source = el.closest<HTMLElement>(FOCUSABLE) ?? el;\n this.listeners = new AbortController();\n const options = { signal: this.listeners.signal, passive: true };\n source.addEventListener('pointerenter', () => this.engaged.set(true), options);\n source.addEventListener('pointerleave', () => this.engaged.set(false), options);\n source.addEventListener('focusin', () => this.engaged.set(true), options);\n source.addEventListener('focusout', () => this.engaged.set(false), options);\n }\n\n /** The copies go in and the target gets the modifier; the stylesheet loops from there. Idempotent. */\n private start(): void {\n const el = this.el;\n if (this.live || !el) return;\n this.live = true;\n const text = el.textContent ?? '';\n if (text.trim() !== '') {\n this.copies = ['a', 'b'].map(which => {\n const copy = el.ownerDocument.createElement('span');\n copy.className = `wr-glitch__copy wr-glitch__copy--${which}`;\n copy.setAttribute('aria-hidden', 'true');\n copy.textContent = text;\n return copy;\n });\n el.append(...this.copies);\n }\n el.classList.add('wr-glitch--live');\n }\n\n /** Take the copies and the modifier off the target. Idempotent. */\n private stop(): void {\n this.live = false;\n for (const copy of this.copies) copy.remove();\n this.copies = [];\n this.el?.classList.remove('wr-glitch--live');\n }\n}\n"],"mappings":";;;;;;;;;;;;AAiEA,IAAa,WAAb,MAAa,SAAQ;CAOV,SAAS,MAA8B,MAAI;EAAA,GAAA,YAAA,EAAA,WAAA,SAAA,+BAAA,CAAA;EAAI,OAAO;EAAY,WAAW;CAAgB,CAAA;CAQ7F,SAAS,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,SAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CAE3C,OAAO,OAAgC,UAAU;CACjD,WAAW,OAAO,UAAU;CAC5B,MAAM,OAAOA,UAAQ;CAErB,UAAU,OAAO,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA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AAAR,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAQ,YAAA,CAAA;EAHpB,MAAA;EAAU,MAAA,CAAA,EACT,UAAU,aACX,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-animations-glow-border.mjs","names":[],"sources":["../../../projects/lib/animations/glow-border/glow-border.ts"
|
|
1
|
+
{"version":3,"file":"ngwr-animations-glow-border.mjs","names":[],"sources":["../../../projects/lib/animations/glow-border/glow-border.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { isPlatformBrowser } from '@angular/common';\nimport { Directive, PLATFORM_ID, computed, inject, input } from '@angular/core';\n\nimport { WrPlatform } from 'ngwr/platform';\nimport { wrCheckStyles } from 'ngwr/utils';\n\n/**\n * A short arc of brand light that runs round the host's edge for ever, with a\n * soft glow spilling outward. CSS does all of it: this class only decides\n * whether the arc turns. It stays lit but still under\n * `prefers-reduced-motion: reduce`, while the tab is hidden and on the server.\n * The host needs `position: relative`; `wr-btn` has it. The blurred copy of\n * the arc sits at a negative z-index, so the host's stacking parent isolates\n * itself (`isolation: isolate`) to keep it above the page background. The\n * host's own hover and focus states are untouched, and its focus ring paints\n * above the arc. Styles: `@use 'ngwr/animations/glow-border'`, which also\n * lists the `--wr-glow-border-*` hooks.\n */\n@Directive({\n selector: '[wrGlowBorder]',\n host: {\n class: 'wr-glow-border',\n '[class.wr-glow-border--live]': 'live()',\n },\n})\nexport class WrGlowBorder {\n /** Stops the arc without removing the directive. @default true */\n readonly active = input(true);\n\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n private readonly platform = inject(WrPlatform);\n\n protected readonly live = computed(\n () => this.isBrowser && this.active() && !this.platform.prefersReducedMotion() && this.platform.pageVisible()\n );\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('animations/glow-border');\n }\n}\n"],"mappings":";;;;;;;;;;;AAgCA,IAAa,eAAb,MAAa,aAAY;CAEd,SAAS,MAAM,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAEZ,YAAY,kBAAkB,OAAO,WAAW,CAAC;CACjD,WAAW,OAAO,UAAU;CAE1B,OAAO,eAClB,KAAK,aAAa,KAAK,OAAM,KAAM,CAAC,KAAK,SAAS,qBAAoB,KAAM,KAAK,SAAS,YAAW,GAC5G,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAED,cAAA;EACE,IAAI,OAAO,cAAc,eAAe,WAAW,cAAc,wBAAwB;CAC3F;CAbW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAY,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAZ,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAY,cAAA;EAAA,UAAA;EAAA,QAAA,EAAA,QAAA;GAAA,mBAAA;GAAA,YAAA;GAAA,UAAA;GAAA,YAAA;GAAA,mBAAA;EAAA,EAAA;EAAA,MAAA;GAAA,YAAA,EAAA,8BAAA,SAAA;GAAA,gBAAA;EAAA;EAAA,UAAA;CAAA,CAAA;;AAAZ,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAY,YAAA,CAAA;EAPxB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,MAAM;IACJ,OAAO;IACP,gCAAgC;GACjC;EACF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-animations-gradient-flow.mjs","names":["DOCUMENT"],"sources":["../../../projects/lib/animations/gradient-flow/gradient-flow.ts"
|
|
1
|
+
{"version":3,"file":"ngwr-animations-gradient-flow.mjs","names":["DOCUMENT"],"sources":["../../../projects/lib/animations/gradient-flow/gradient-flow.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport {\n DestroyRef,\n Directive,\n ElementRef,\n PLATFORM_ID,\n afterNextRender,\n computed,\n inject,\n signal,\n} from '@angular/core';\n\nimport { WrPlatform } from 'ngwr/platform';\nimport { wrCheckStyles } from 'ngwr/utils';\n\n/** The modifier under which the stylesheet lets the drift run. */\nconst RUN = 'wr-gradient-flow--run';\n\n/**\n * A short piece of text, a brand name or one word, filled with a gradient of\n * theme inks that drifts slowly along it, forever, as a seamless loop.\n *\n * The stylesheet owns the paint and the loop: the gradient is a background\n * clipped to the glyphs, twice the host wide and ending on the colour it starts\n * with, so sliding it by one image width lands on the exact same picture and\n * the cycle has no seam. That slide is one CSS animation, declared paused and\n * infinite on the host. The directive's whole job is the one modifier that sets\n * it running, and only while the host is on screen and the document is visible.\n * Pausing keeps the phase, so the drift picks up where it stopped instead of\n * jumping back to its start.\n *\n * Without the directive the text already carries the static gradient, so a\n * server render paints the final colours before any script arrives, and so does\n * `prefers-reduced-motion: reduce`, where the gradient stays and nothing moves:\n * it is colour, not motion. Under `forced-colors: active` the text is plain, in\n * the system colour. The text is never touched: no split, no copy, no\n * pseudo-element, so selection, copy and line breaks are what they were.\n *\n * Put it on an element that shrinks to its text (an inline, an inline-block, a\n * flex item): the gradient spans the host's box, so a block stretched wider than\n * its word shows the word only a slice of it. The `--wr-gradient-flow-*` hooks\n * are the colours, the cycle and its steps.\n */\n@Directive({\n selector: '[wrGradientFlow]',\n host: {\n class: 'wr-gradient-flow',\n [`[class.${RUN}]`]: 'running()',\n },\n})\nexport class WrGradientFlow {\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly platform = inject(WrPlatform);\n private readonly doc = inject(DOCUMENT);\n private readonly intersecting = signal(false);\n private observer: IntersectionObserver | null = null;\n\n /** One place decides whether the drift runs: in view, page visible, motion allowed. */\n protected readonly running = computed(\n () => this.intersecting() && this.platform.pageVisible() && !this.platform.prefersReducedMotion()\n );\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('animations/gradient-flow');\n if (!isPlatformBrowser(inject(PLATFORM_ID))) return;\n\n afterNextRender(() => {\n if (this.platform.prefersReducedMotion() || typeof IntersectionObserver === 'undefined') return;\n // The stylesheet paints plain text under forced colours: nothing to run.\n if (this.doc.defaultView?.matchMedia?.('(forced-colors: active)').matches) return;\n\n // Any part of the host on screen counts: this is a loop that should not\n // burn paint off screen, not a reveal that should wait for the whole word.\n this.observer = new IntersectionObserver(entries =>\n this.intersecting.set(entries[entries.length - 1]?.isIntersecting ?? false)\n );\n this.observer.observe(this.host.nativeElement);\n });\n\n inject(DestroyRef).onDestroy(() => {\n this.observer?.disconnect();\n this.observer = null;\n // Change detection does not run on a destroyed view, so the binding\n // cannot take the modifier off: do it by hand.\n this.host.nativeElement.classList.remove(RUN);\n });\n }\n}\n\nexport { RUN as GRADIENT_FLOW_RUN };\n"],"mappings":";;;;;;;;;;;AAuBA,MAAM,MAAM;AAkCZ,IAAa,iBAAb,MAAa,eAAc;CACR,OAAO,OAAgC,UAAU;CACjD,WAAW,OAAO,UAAU;CAC5B,MAAM,OAAOA,UAAQ;CACrB,eAAe,OAAO,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;CACrC,WAAwC;CAG7B,UAAU,eACrB,KAAK,aAAY,KAAM,KAAK,SAAS,YAAW,KAAM,CAAC,KAAK,SAAS,qBAAoB,GAChG,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAED,cAAA;EACE,IAAI,OAAO,cAAc,eAAe,WAAW,cAAc,0BAA0B;EAC3F,IAAI,CAAC,kBAAkB,OAAO,WAAW,CAAC,GAAG;EAE7C,sBAAqB;GACnB,IAAI,KAAK,SAAS,qBAAoB,KAAM,OAAO,yBAAyB,aAAa;GAEzF,IAAI,KAAK,IAAI,aAAa,aAAa,yBAAyB,CAAC,CAAC,SAAS;GAI3E,KAAK,WAAW,IAAI,sBAAqB,YACvC,KAAK,aAAa,IAAI,QAAQ,QAAQ,SAAS,EAAE,EAAE,kBAAkB,KAAK,CAAC;GAE7E,KAAK,SAAS,QAAQ,KAAK,KAAK,aAAa;EAC/C,CAAC;EAED,OAAO,UAAU,CAAC,CAAC,gBAAe;GAChC,KAAK,UAAU,WAAU;GACzB,KAAK,WAAW;GAGhB,KAAK,KAAK,cAAc,UAAU,OAAO,GAAG;EAC9C,CAAC;CACH;CApCW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAc,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAd,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAc,cAAA;EAAA,UAAA;EAAA,MAAA;GAAA,YAAA,EAAA,+BAAA,YAAA;GAAA,gBAAA;EAAA;EAAA,UAAA;CAAA,CAAA;;AAAd,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAc,YAAA,CAAA;EAP1B,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,MAAM;IACJ,OAAO;KACN,UAAU,IAAG,KAAM;GACrB;EACF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-animations-marquee.mjs","names":["DOCUMENT"],"sources":["../../../projects/lib/animations/marquee/marquee.ts","../../../projects/lib/animations/marquee/marquee.html","../../../projects/lib/animations/marquee/public-api.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { DOCUMENT, NgTemplateOutlet, isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n Injector,\n PLATFORM_ID,\n TemplateRef,\n ViewEncapsulation,\n afterNextRender,\n booleanAttribute,\n computed,\n contentChild,\n inject,\n input,\n signal,\n} from '@angular/core';\n\nimport { WrButton } from 'ngwr/button';\nimport { useI18nText } from 'ngwr/i18n';\nimport { WrPlatform } from 'ngwr/platform';\nimport { wrNumAttr, wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrMarqueeItem, WrMarqueeItemContext } from './types';\n\n/** How fast the row travels when `speed` is not set, in px per second. */\nconst MARQUEE_SPEED = 40;\n\n/**\n * A row of links that glides sideways in an endless loop, each item entering\n * under a soft fade at one end and leaving under the other.\n *\n * The loop is one CSS animation on a belt that holds the list twice, moving\n * by exactly the measured width of one copy, so the frame the cycle ends on\n * is the frame it began on and the seam never shows. The width is read once\n * the browser has laid the row out, again when its size changes (a font that\n * finishes loading, a resize) and the duration is that width over `speed`,\n * so the row moves at the same px per second whatever is in it. Nothing but\n * `translate` animates, declared paused and set running by one modifier, so a\n * pause keeps the phase: the row picks up where it stopped. It stops off\n * screen, while the document is hidden, under the pointer, while focus is in\n * it, and on the pause button at its end (WCAG 2.2.2).\n *\n * An item renders as a plain `<a href>` by default. A projected\n * `<ng-template let-item>` renders it instead, with the item as `$implicit`,\n * and its anchor carries the link's class `wr-marquee__link`: that is where a\n * `routerLink` goes, since the library never imports the router itself.\n *\n * A keyboard user who tabs into a link gets a still row: while focus is in\n * the belt the animation is off and the viewport scrolls natively, and the\n * link is brought into view, so what has focus is what can be seen. Leaving\n * resumes the loop. Under `prefers-reduced-motion: reduce` the row never\n * moves: one copy, scrollable, with the fade. The second copy is\n * presentational, `aria-hidden` and `inert`, so a screen reader hears the list\n * once, as a list of links named by `label`. With `pausable`, the pause button's name comes\n * from the i18n catalog (`marquee.pause`, `marquee.play`) unless `pauseLabel`\n * and `playLabel` say otherwise. The server renders the one copy as a still\n * row; the loop starts from the same picture, so nothing shifts. Styles:\n * `@use 'ngwr/animations/marquee'`, which also lists the `--wr-marquee-*` hooks.\n */\n@Component({\n selector: 'wr-marquee',\n templateUrl: './marquee.html',\n encapsulation: ViewEncapsulation.None,\n imports: [NgTemplateOutlet, WrButton],\n host: {\n class: 'wr-marquee',\n '[class.wr-marquee--loop]': 'looping()',\n '[class.wr-marquee--run]': 'running()',\n '[class.wr-marquee--static]': 'still()',\n '(pointerenter)': 'hovered.set(true)',\n '(pointerleave)': 'hovered.set(false)',\n '(focusin)': 'focused.set(true)',\n '(focusout)': 'onFocusOut($event)',\n },\n})\nexport class WrMarquee {\n /** The links, in the order they pass. */\n readonly items = input.required<readonly WrMarqueeItem[]>();\n\n /** How fast the row travels, in px per second. @default 40 */\n readonly speed = input(MARQUEE_SPEED, { transform: wrNumAttr(MARQUEE_SPEED) });\n\n /** The accessible name of the list. */\n readonly label = input<string | null>(null);\n\n /** Renders the pause button at the row's end, the way to stop a row that runs on (WCAG 2.2.2). Hover and focus pause the row with or without it. @default false */\n readonly pausable = input(false, { transform: booleanAttribute });\n\n /** The pause button's name while the row moves. Unset, the `marquee.pause` string of the i18n catalog, \"Pause\" in English. */\n readonly pauseLabel = input<string | null>(null);\n\n /** The pause button's name while the row stands. Unset, the `marquee.play` string of the i18n catalog, \"Play\" in English. */\n readonly playLabel = input<string | null>(null);\n\n /** The projected item template, when there is one; the plain anchor otherwise. */\n protected readonly itemTemplate = contentChild<TemplateRef<WrMarqueeItemContext>>(TemplateRef);\n\n protected readonly pauseText = useI18nText(this.pauseLabel, 'marquee.pause', 'Pause');\n protected readonly playText = useI18nText(this.playLabel, 'marquee.play', 'Play');\n\n /** The reader pressed pause. */\n protected readonly paused = signal(false);\n\n /** Focus is on a link in the belt: the row is still and scrolls natively. */\n protected readonly still = signal(false);\n\n /** The width of one copy of the list, in px, or `null` until measured. */\n protected readonly width = signal<number | null>(null);\n\n /** One copy's width as a length, for the belt's keyframe. */\n protected readonly shift = computed(() => {\n const width = this.width();\n return width === null ? null : `${width}px`;\n });\n\n /** One cycle, so the row moves `speed` px every second. */\n protected readonly duration = computed(() => {\n const width = this.width();\n const speed = this.speed();\n return width === null || speed <= 0 ? null : `${width / speed}s`;\n });\n\n /** The second copy is in the DOM and the animation is declared. */\n protected readonly looping = computed(() => this.ready() && !this.platform.prefersReducedMotion());\n\n /** One place decides whether the belt moves. */\n protected readonly running = computed(\n () =>\n this.looping() &&\n this.intersecting() &&\n this.platform.pageVisible() &&\n !this.hovered() &&\n !this.focused() &&\n !this.paused()\n );\n\n protected readonly hovered = signal(false);\n protected readonly focused = signal(false);\n private readonly intersecting = signal(false);\n /** `afterNextRender` ran in a browser that can loop. */\n private readonly ready = signal(false);\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly platform = inject(WrPlatform);\n private readonly doc = inject(DOCUMENT);\n private readonly injector = inject(Injector);\n private viewObserver: IntersectionObserver | null = null;\n private sizeObserver: ResizeObserver | null = null;\n private listeners: AbortController | null = null;\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('animations/marquee');\n if (!isPlatformBrowser(inject(PLATFORM_ID))) return;\n\n afterNextRender(() => {\n if (this.platform.prefersReducedMotion() || typeof IntersectionObserver === 'undefined') return;\n\n // Any part of the row on screen counts: a loop should not burn paint off\n // screen, and should not wait for the whole row to show either.\n this.viewObserver = new IntersectionObserver(entries =>\n this.intersecting.set(entries[entries.length - 1]?.isIntersecting ?? false)\n );\n this.viewObserver.observe(this.host.nativeElement);\n this.listen();\n this.ready.set(true);\n });\n\n inject(DestroyRef).onDestroy(() => {\n this.viewObserver?.disconnect();\n this.viewObserver = null;\n this.sizeObserver?.disconnect();\n this.sizeObserver = null;\n this.listeners?.abort();\n this.listeners = null;\n });\n }\n\n protected toggle(): void {\n this.paused.update(paused => !paused);\n }\n\n /** Focus left the host altogether: a move from a link to the button keeps the pause. */\n protected onFocusOut(event: FocusEvent): void {\n const next = event.relatedTarget as Node | null;\n if (next && this.host.nativeElement.contains(next)) return;\n this.focused.set(false);\n }\n\n /**\n * A link took focus: the belt stands still and the viewport scrolls, and\n * once that state is painted the link is scrolled into view. The scroll\n * waits for the render, because the viewport is still `overflow: hidden`\n * and the belt still translated when the event fires.\n */\n protected onTrackFocusIn(event: FocusEvent): void {\n const target = event.target as HTMLElement | null;\n this.still.set(true);\n afterNextRender(() => target?.scrollIntoView?.({ block: 'nearest', inline: 'nearest' }), {\n injector: this.injector,\n });\n }\n\n /** Focus left the belt: back to the loop, from the start of the row, not from wherever the viewport was scrolled to. */\n protected onTrackFocusOut(event: FocusEvent): void {\n const next = event.relatedTarget as Node | null;\n if (next && (event.currentTarget as HTMLElement).contains(next)) return;\n this.still.set(false);\n (event.currentTarget as HTMLElement).scrollLeft = 0;\n }\n\n /**\n * The width of one copy, read from the first track, which never moves within\n * the belt. A `ResizeObserver` on it reports the first layout, a font that\n * finishes loading and anything else that changes its size; without one,\n * one read now and another on resize and when the fonts are ready.\n */\n private listen(): void {\n const track = this.host.nativeElement.querySelector<HTMLElement>('.wr-marquee__track');\n if (!track) return;\n this.listeners = new AbortController();\n const options = { signal: this.listeners.signal, passive: true };\n if (typeof ResizeObserver !== 'undefined') {\n this.sizeObserver = new ResizeObserver(() => this.measure(track));\n this.sizeObserver.observe(track);\n } else {\n this.measure(track);\n this.doc.defaultView?.addEventListener('resize', () => this.measure(track), options);\n }\n const fonts = this.doc.fonts;\n if (fonts) {\n fonts.addEventListener('loadingdone', () => this.measure(track), options);\n void fonts.ready.then(() => {\n if (this.listeners) this.measure(track);\n });\n }\n }\n\n private measure(track: HTMLElement): void {\n const width = track.getBoundingClientRect().width;\n this.width.set(width > 0 ? width : null);\n }\n}\n\nexport { MARQUEE_SPEED };\n","<!-- One item when no template is projected: a plain link. -->\n<ng-template #plainItem let-item>\n <a class=\"wr-marquee__link\" [href]=\"item.url\">{{ item.title }}</a>\n</ng-template>\n\n<div class=\"wr-marquee__viewport\" (focusin)=\"onTrackFocusIn($event)\" (focusout)=\"onTrackFocusOut($event)\">\n <div class=\"wr-marquee__belt\" [style.--wr-marquee-shift]=\"shift()\" [style.--wr-marquee-duration]=\"duration()\">\n <ul class=\"wr-marquee__track\" [attr.aria-label]=\"label()\">\n @for (item of items(); track item.url) {\n <li class=\"wr-marquee__item\">\n <ng-container *ngTemplateOutlet=\"itemTemplate() ?? plainItem; context: { $implicit: item }\" />\n </li>\n }\n </ul>\n <!--\n The second copy is the picture only: hidden from readers and inert, so its\n links are out of the tab order, and the list is read once and tabbed once.\n -->\n @if (looping()) {\n <ul class=\"wr-marquee__track wr-marquee__track--copy\" aria-hidden=\"true\" inert>\n @for (item of items(); track item.url) {\n <li class=\"wr-marquee__item\">\n <ng-container *ngTemplateOutlet=\"itemTemplate() ?? plainItem; context: { $implicit: item }\" />\n </li>\n }\n </ul>\n }\n </div>\n</div>\n<!--\n The button is opt-in (`pausable`), and only a row that moves needs it: a still\n row (reduced motion, the server) has none. The glyph is a bare SVG, as the other entry points draw their own\n chrome, so the button needs no icon registered by the app.\n-->\n@if (pausable() && looping()) {\n <button\n wr-btn\n type=\"button\"\n class=\"wr-marquee__toggle\"\n size=\"sm\"\n [attr.aria-label]=\"paused() ? playText() : pauseText()\"\n (click)=\"toggle()\"\n >\n <span class=\"wr-marquee__glyph\" aria-hidden=\"true\">\n @if (paused()) {\n <svg class=\"wr-icon__svg\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M6 4.5a1 1 0 0 1 1.52-.86l12 7.5a1 1 0 0 1 0 1.72l-12 7.5A1 1 0 0 1 6 19.5z\" />\n </svg>\n } @else {\n <svg class=\"wr-icon__svg\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <rect x=\"5\" y=\"4\" width=\"5\" height=\"16\" rx=\"1\" />\n <rect x=\"14\" y=\"4\" width=\"5\" height=\"16\" rx=\"1\" />\n </svg>\n }\n </span>\n </button>\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nexport { WrMarquee } from './marquee';\nexport type { WrMarqueeItem, WrMarqueeItemContext } from './types';\n"],"mappings":";;;;;;;;;;;;;AAmFA,IAAa,YAAb,MAAa,UAAS;CAEX,QAAQ,MAAM,SAAoC,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAGlD,QAAQ,MAAA,IAAmB;EAAA,GAAA,YAAA,EAAA,WAAA,QAAA,+BAAA,CAAA;EAAI,WAAW,UAAA,EAAuB;CAAC,CAAA;CAGlE,QAAQ,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAGlC,WAAW,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CAGrD,aAAa,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;CAGvC,YAAY,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAG5B,eAAe,aAAgD,aAAY,GAAA,YAAA,CAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;CAE3E,YAAY,YAAY,KAAK,YAAY,iBAAiB,OAAO;CACjE,WAAW,YAAY,KAAK,WAAW,gBAAgB,MAAM;CAG7D,SAAS,OAAO,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAGtB,QAAQ,OAAO,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAGrB,QAAQ,OAAsB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,QA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MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,cAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBAAA,WAAW,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"ngwr-animations-marquee.mjs","names":["DOCUMENT"],"sources":["../../../projects/lib/animations/marquee/marquee.ts","../../../projects/lib/animations/marquee/marquee.html"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { DOCUMENT, NgTemplateOutlet, isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n Injector,\n PLATFORM_ID,\n TemplateRef,\n ViewEncapsulation,\n afterNextRender,\n booleanAttribute,\n computed,\n contentChild,\n inject,\n input,\n signal,\n} from '@angular/core';\n\nimport { WrButton } from 'ngwr/button';\nimport { useI18nText } from 'ngwr/i18n';\nimport { WrPlatform } from 'ngwr/platform';\nimport { wrNumAttr, wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrMarqueeItem, WrMarqueeItemContext } from './types';\n\n/** How fast the row travels when `speed` is not set, in px per second. */\nconst MARQUEE_SPEED = 40;\n\n/**\n * A row of links that glides sideways in an endless loop, each item entering\n * under a soft fade at one end and leaving under the other.\n *\n * The loop is one CSS animation on a belt that holds the list twice, moving\n * by exactly the measured width of one copy, so the frame the cycle ends on\n * is the frame it began on and the seam never shows. The width is read once\n * the browser has laid the row out, again when its size changes (a font that\n * finishes loading, a resize) and the duration is that width over `speed`,\n * so the row moves at the same px per second whatever is in it. Nothing but\n * `translate` animates, declared paused and set running by one modifier, so a\n * pause keeps the phase: the row picks up where it stopped. It stops off\n * screen, while the document is hidden, under the pointer, while focus is in\n * it, and on the pause button at its end (WCAG 2.2.2).\n *\n * An item renders as a plain `<a href>` by default. A projected\n * `<ng-template let-item>` renders it instead, with the item as `$implicit`,\n * and its anchor carries the link's class `wr-marquee__link`: that is where a\n * `routerLink` goes, since the library never imports the router itself.\n *\n * A keyboard user who tabs into a link gets a still row: while focus is in\n * the belt the animation is off and the viewport scrolls natively, and the\n * link is brought into view, so what has focus is what can be seen. Leaving\n * resumes the loop. Under `prefers-reduced-motion: reduce` the row never\n * moves: one copy, scrollable, with the fade. The second copy is\n * presentational, `aria-hidden` and `inert`, so a screen reader hears the list\n * once, as a list of links named by `label`. With `pausable`, the pause button's name comes\n * from the i18n catalog (`marquee.pause`, `marquee.play`) unless `pauseLabel`\n * and `playLabel` say otherwise. The server renders the one copy as a still\n * row; the loop starts from the same picture, so nothing shifts. Styles:\n * `@use 'ngwr/animations/marquee'`, which also lists the `--wr-marquee-*` hooks.\n */\n@Component({\n selector: 'wr-marquee',\n templateUrl: './marquee.html',\n encapsulation: ViewEncapsulation.None,\n imports: [NgTemplateOutlet, WrButton],\n host: {\n class: 'wr-marquee',\n '[class.wr-marquee--loop]': 'looping()',\n '[class.wr-marquee--run]': 'running()',\n '[class.wr-marquee--static]': 'still()',\n '(pointerenter)': 'hovered.set(true)',\n '(pointerleave)': 'hovered.set(false)',\n '(focusin)': 'focused.set(true)',\n '(focusout)': 'onFocusOut($event)',\n },\n})\nexport class WrMarquee {\n /** The links, in the order they pass. */\n readonly items = input.required<readonly WrMarqueeItem[]>();\n\n /** How fast the row travels, in px per second. @default 40 */\n readonly speed = input(MARQUEE_SPEED, { transform: wrNumAttr(MARQUEE_SPEED) });\n\n /** The accessible name of the list. */\n readonly label = input<string | null>(null);\n\n /** Renders the pause button at the row's end, the way to stop a row that runs on (WCAG 2.2.2). Hover and focus pause the row with or without it. @default false */\n readonly pausable = input(false, { transform: booleanAttribute });\n\n /** The pause button's name while the row moves. Unset, the `marquee.pause` string of the i18n catalog, \"Pause\" in English. */\n readonly pauseLabel = input<string | null>(null);\n\n /** The pause button's name while the row stands. Unset, the `marquee.play` string of the i18n catalog, \"Play\" in English. */\n readonly playLabel = input<string | null>(null);\n\n /** The projected item template, when there is one; the plain anchor otherwise. */\n protected readonly itemTemplate = contentChild<TemplateRef<WrMarqueeItemContext>>(TemplateRef);\n\n protected readonly pauseText = useI18nText(this.pauseLabel, 'marquee.pause', 'Pause');\n protected readonly playText = useI18nText(this.playLabel, 'marquee.play', 'Play');\n\n /** The reader pressed pause. */\n protected readonly paused = signal(false);\n\n /** Focus is on a link in the belt: the row is still and scrolls natively. */\n protected readonly still = signal(false);\n\n /** The width of one copy of the list, in px, or `null` until measured. */\n protected readonly width = signal<number | null>(null);\n\n /** One copy's width as a length, for the belt's keyframe. */\n protected readonly shift = computed(() => {\n const width = this.width();\n return width === null ? null : `${width}px`;\n });\n\n /** One cycle, so the row moves `speed` px every second. */\n protected readonly duration = computed(() => {\n const width = this.width();\n const speed = this.speed();\n return width === null || speed <= 0 ? null : `${width / speed}s`;\n });\n\n /** The second copy is in the DOM and the animation is declared. */\n protected readonly looping = computed(() => this.ready() && !this.platform.prefersReducedMotion());\n\n /** One place decides whether the belt moves. */\n protected readonly running = computed(\n () =>\n this.looping() &&\n this.intersecting() &&\n this.platform.pageVisible() &&\n !this.hovered() &&\n !this.focused() &&\n !this.paused()\n );\n\n protected readonly hovered = signal(false);\n protected readonly focused = signal(false);\n private readonly intersecting = signal(false);\n /** `afterNextRender` ran in a browser that can loop. */\n private readonly ready = signal(false);\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly platform = inject(WrPlatform);\n private readonly doc = inject(DOCUMENT);\n private readonly injector = inject(Injector);\n private viewObserver: IntersectionObserver | null = null;\n private sizeObserver: ResizeObserver | null = null;\n private listeners: AbortController | null = null;\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('animations/marquee');\n if (!isPlatformBrowser(inject(PLATFORM_ID))) return;\n\n afterNextRender(() => {\n if (this.platform.prefersReducedMotion() || typeof IntersectionObserver === 'undefined') return;\n\n // Any part of the row on screen counts: a loop should not burn paint off\n // screen, and should not wait for the whole row to show either.\n this.viewObserver = new IntersectionObserver(entries =>\n this.intersecting.set(entries[entries.length - 1]?.isIntersecting ?? false)\n );\n this.viewObserver.observe(this.host.nativeElement);\n this.listen();\n this.ready.set(true);\n });\n\n inject(DestroyRef).onDestroy(() => {\n this.viewObserver?.disconnect();\n this.viewObserver = null;\n this.sizeObserver?.disconnect();\n this.sizeObserver = null;\n this.listeners?.abort();\n this.listeners = null;\n });\n }\n\n protected toggle(): void {\n this.paused.update(paused => !paused);\n }\n\n /** Focus left the host altogether: a move from a link to the button keeps the pause. */\n protected onFocusOut(event: FocusEvent): void {\n const next = event.relatedTarget as Node | null;\n if (next && this.host.nativeElement.contains(next)) return;\n this.focused.set(false);\n }\n\n /**\n * A link took focus: the belt stands still and the viewport scrolls, and\n * once that state is painted the link is scrolled into view. The scroll\n * waits for the render, because the viewport is still `overflow: hidden`\n * and the belt still translated when the event fires.\n */\n protected onTrackFocusIn(event: FocusEvent): void {\n const target = event.target as HTMLElement | null;\n this.still.set(true);\n afterNextRender(() => target?.scrollIntoView?.({ block: 'nearest', inline: 'nearest' }), {\n injector: this.injector,\n });\n }\n\n /** Focus left the belt: back to the loop, from the start of the row, not from wherever the viewport was scrolled to. */\n protected onTrackFocusOut(event: FocusEvent): void {\n const next = event.relatedTarget as Node | null;\n if (next && (event.currentTarget as HTMLElement).contains(next)) return;\n this.still.set(false);\n (event.currentTarget as HTMLElement).scrollLeft = 0;\n }\n\n /**\n * The width of one copy, read from the first track, which never moves within\n * the belt. A `ResizeObserver` on it reports the first layout, a font that\n * finishes loading and anything else that changes its size; without one,\n * one read now and another on resize and when the fonts are ready.\n */\n private listen(): void {\n const track = this.host.nativeElement.querySelector<HTMLElement>('.wr-marquee__track');\n if (!track) return;\n this.listeners = new AbortController();\n const options = { signal: this.listeners.signal, passive: true };\n if (typeof ResizeObserver !== 'undefined') {\n this.sizeObserver = new ResizeObserver(() => this.measure(track));\n this.sizeObserver.observe(track);\n } else {\n this.measure(track);\n this.doc.defaultView?.addEventListener('resize', () => this.measure(track), options);\n }\n const fonts = this.doc.fonts;\n if (fonts) {\n fonts.addEventListener('loadingdone', () => this.measure(track), options);\n void fonts.ready.then(() => {\n if (this.listeners) this.measure(track);\n });\n }\n }\n\n private measure(track: HTMLElement): void {\n const width = track.getBoundingClientRect().width;\n this.width.set(width > 0 ? width : null);\n }\n}\n\nexport { MARQUEE_SPEED };\n","<!-- One item when no template is projected: a plain link. -->\n<ng-template #plainItem let-item>\n <a class=\"wr-marquee__link\" [href]=\"item.url\">{{ item.title }}</a>\n</ng-template>\n\n<div class=\"wr-marquee__viewport\" (focusin)=\"onTrackFocusIn($event)\" (focusout)=\"onTrackFocusOut($event)\">\n <div class=\"wr-marquee__belt\" [style.--wr-marquee-shift]=\"shift()\" [style.--wr-marquee-duration]=\"duration()\">\n <ul class=\"wr-marquee__track\" [attr.aria-label]=\"label()\">\n @for (item of items(); track item.url) {\n <li class=\"wr-marquee__item\">\n <ng-container *ngTemplateOutlet=\"itemTemplate() ?? plainItem; context: { $implicit: item }\" />\n </li>\n }\n </ul>\n <!--\n The second copy is the picture only: hidden from readers and inert, so its\n links are out of the tab order, and the list is read once and tabbed once.\n -->\n @if (looping()) {\n <ul class=\"wr-marquee__track wr-marquee__track--copy\" aria-hidden=\"true\" inert>\n @for (item of items(); track item.url) {\n <li class=\"wr-marquee__item\">\n <ng-container *ngTemplateOutlet=\"itemTemplate() ?? plainItem; context: { $implicit: item }\" />\n </li>\n }\n </ul>\n }\n </div>\n</div>\n<!--\n The button is opt-in (`pausable`), and only a row that moves needs it: a still\n row (reduced motion, the server) has none. The glyph is a bare SVG, as the other entry points draw their own\n chrome, so the button needs no icon registered by the app.\n-->\n@if (pausable() && looping()) {\n <button\n wr-btn\n type=\"button\"\n class=\"wr-marquee__toggle\"\n size=\"sm\"\n [attr.aria-label]=\"paused() ? playText() : pauseText()\"\n (click)=\"toggle()\"\n >\n <span class=\"wr-marquee__glyph\" aria-hidden=\"true\">\n @if (paused()) {\n <svg class=\"wr-icon__svg\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M6 4.5a1 1 0 0 1 1.52-.86l12 7.5a1 1 0 0 1 0 1.72l-12 7.5A1 1 0 0 1 6 19.5z\" />\n </svg>\n } @else {\n <svg class=\"wr-icon__svg\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <rect x=\"5\" y=\"4\" width=\"5\" height=\"16\" rx=\"1\" />\n <rect x=\"14\" y=\"4\" width=\"5\" height=\"16\" rx=\"1\" />\n </svg>\n }\n </span>\n </button>\n}\n"],"mappings":";;;;;;;;;;;;;AAmFA,IAAa,YAAb,MAAa,UAAS;CAEX,QAAQ,MAAM,SAAoC,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAGlD,QAAQ,MAAA,IAAmB;EAAA,GAAA,YAAA,EAAA,WAAA,QAAA,+BAAA,CAAA;EAAI,WAAW,UAAA,EAAuB;CAAC,CAAA;CAGlE,QAAQ,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,QAA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