ngwr 15.8.0 → 16.0.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/animations/aurora/styles/_index.scss +1 -1
- package/animations/blur-reveal/styles/_index.scss +1 -1
- package/animations/decode/styles/_index.scss +1 -1
- package/animations/dot-grid/styles/_index.scss +1 -1
- package/animations/flow-lines/styles/_index.scss +1 -1
- package/animations/fluid-cursor/styles/_index.scss +1 -1
- package/animations/{core → internal}/styles/_mixins.scss +1 -1
- package/animations/reveal/styles/_index.scss +1 -1
- package/animations/ripple-grid/styles/_index.scss +1 -1
- package/animations/rotate-reveal/styles/_index.scss +1 -1
- package/animations/thread-lines/styles/_index.scss +1 -1
- package/animations/typewriter/styles/_index.scss +1 -1
- package/copy-value/styles/_index.scss +104 -0
- package/date-picker/styles/_index.scss +117 -0
- package/fesm2022/{ngwr-animations-core.mjs → internal-BaQU4t_0.mjs} +6 -49
- package/fesm2022/internal-BaQU4t_0.mjs.map +1 -0
- package/fesm2022/ngwr-alert.mjs +2 -2
- package/fesm2022/ngwr-alert.mjs.map +1 -1
- package/fesm2022/ngwr-animations-aurora.mjs +21 -21
- package/fesm2022/ngwr-animations-aurora.mjs.map +1 -1
- package/fesm2022/ngwr-animations-blur-reveal.mjs +3 -3
- package/fesm2022/ngwr-animations-blur-reveal.mjs.map +1 -1
- package/fesm2022/ngwr-animations-click-sparks.mjs +2 -2
- package/fesm2022/ngwr-animations-click-sparks.mjs.map +1 -1
- package/fesm2022/ngwr-animations-confetti.mjs +5 -5
- package/fesm2022/ngwr-animations-confetti.mjs.map +1 -1
- package/fesm2022/ngwr-animations-decode.mjs +4 -4
- package/fesm2022/ngwr-animations-decode.mjs.map +1 -1
- package/fesm2022/ngwr-animations-destruct.mjs +5 -5
- package/fesm2022/ngwr-animations-destruct.mjs.map +1 -1
- package/fesm2022/ngwr-animations-dot-grid.mjs +7 -7
- package/fesm2022/ngwr-animations-dot-grid.mjs.map +1 -1
- package/fesm2022/ngwr-animations-falling-letters.mjs +3 -3
- package/fesm2022/ngwr-animations-falling-letters.mjs.map +1 -1
- package/fesm2022/ngwr-animations-flow-lines.mjs +17 -17
- package/fesm2022/ngwr-animations-flow-lines.mjs.map +1 -1
- package/fesm2022/ngwr-animations-fluid-cursor.mjs +12 -12
- package/fesm2022/ngwr-animations-fluid-cursor.mjs.map +1 -1
- package/fesm2022/ngwr-animations-glitch.mjs +2 -2
- package/fesm2022/ngwr-animations-glitch.mjs.map +1 -1
- package/fesm2022/ngwr-animations-marquee.mjs +2 -2
- package/fesm2022/ngwr-animations-marquee.mjs.map +1 -1
- package/fesm2022/ngwr-animations-orbit.mjs +7 -7
- package/fesm2022/ngwr-animations-orbit.mjs.map +1 -1
- package/fesm2022/ngwr-animations-reveal.mjs +4 -4
- package/fesm2022/ngwr-animations-reveal.mjs.map +1 -1
- package/fesm2022/ngwr-animations-ripple-grid.mjs +5 -5
- package/fesm2022/ngwr-animations-ripple-grid.mjs.map +1 -1
- package/fesm2022/ngwr-animations-rotate-reveal.mjs +4 -4
- package/fesm2022/ngwr-animations-rotate-reveal.mjs.map +1 -1
- package/fesm2022/ngwr-animations-shimmer.mjs +2 -2
- package/fesm2022/ngwr-animations-shimmer.mjs.map +1 -1
- package/fesm2022/ngwr-animations-spotlight.mjs +1 -1
- package/fesm2022/ngwr-animations-spotlight.mjs.map +1 -1
- package/fesm2022/ngwr-animations-thread-lines.mjs +16 -16
- package/fesm2022/ngwr-animations-thread-lines.mjs.map +1 -1
- package/fesm2022/ngwr-animations-tilt.mjs +3 -3
- package/fesm2022/ngwr-animations-tilt.mjs.map +1 -1
- package/fesm2022/ngwr-animations-typewriter.mjs +4 -4
- package/fesm2022/ngwr-animations-typewriter.mjs.map +1 -1
- package/fesm2022/ngwr-avatar.mjs +3 -3
- package/fesm2022/ngwr-avatar.mjs.map +1 -1
- package/fesm2022/ngwr-badge.mjs.map +1 -1
- package/fesm2022/ngwr-cascader.mjs +43 -20
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-charts-bar-chart.mjs +13 -13
- package/fesm2022/ngwr-charts-bar-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-boxplot-chart.mjs +9 -9
- package/fesm2022/ngwr-charts-boxplot-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-bullet-chart.mjs +8 -8
- package/fesm2022/ngwr-charts-bullet-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-candlestick-chart.mjs +11 -11
- package/fesm2022/ngwr-charts-candlestick-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-chart-legend.mjs +2 -2
- package/fesm2022/ngwr-charts-chart-legend.mjs.map +1 -1
- package/fesm2022/ngwr-charts-core.mjs +20 -20
- package/fesm2022/ngwr-charts-core.mjs.map +1 -1
- package/fesm2022/ngwr-charts-donut-chart.mjs +2 -2
- package/fesm2022/ngwr-charts-donut-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-funnel-chart.mjs +6 -6
- package/fesm2022/ngwr-charts-funnel-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-gauge.mjs +3 -3
- package/fesm2022/ngwr-charts-gauge.mjs.map +1 -1
- package/fesm2022/ngwr-charts-heatmap-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-heatmap-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-line-chart.mjs +10 -10
- package/fesm2022/ngwr-charts-line-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-meter-group.mjs +2 -2
- package/fesm2022/ngwr-charts-meter-group.mjs.map +1 -1
- package/fesm2022/ngwr-charts-radar-chart.mjs +11 -11
- package/fesm2022/ngwr-charts-radar-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-scatter-chart.mjs +10 -10
- package/fesm2022/ngwr-charts-scatter-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-treemap-chart.mjs +4 -4
- package/fesm2022/ngwr-charts-treemap-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-waterfall-chart.mjs +7 -7
- package/fesm2022/ngwr-charts-waterfall-chart.mjs.map +1 -1
- package/fesm2022/ngwr-checkbox.mjs +2 -2
- package/fesm2022/ngwr-checkbox.mjs.map +1 -1
- package/fesm2022/ngwr-collapse.mjs +2 -2
- package/fesm2022/ngwr-collapse.mjs.map +1 -1
- package/fesm2022/ngwr-color-picker.mjs +52 -52
- package/fesm2022/ngwr-color-picker.mjs.map +1 -1
- package/fesm2022/ngwr-command-palette.mjs +4 -4
- package/fesm2022/ngwr-command-palette.mjs.map +1 -1
- package/fesm2022/ngwr-comment.mjs +2 -2
- package/fesm2022/ngwr-comment.mjs.map +1 -1
- package/fesm2022/ngwr-compare.mjs +6 -6
- package/fesm2022/ngwr-compare.mjs.map +1 -1
- package/fesm2022/ngwr-context-menu.mjs +4 -4
- package/fesm2022/ngwr-context-menu.mjs.map +1 -1
- package/fesm2022/ngwr-copy-value-testing.mjs +58 -0
- package/fesm2022/ngwr-copy-value-testing.mjs.map +1 -0
- package/fesm2022/ngwr-copy-value.mjs +196 -0
- package/fesm2022/ngwr-copy-value.mjs.map +1 -0
- package/fesm2022/ngwr-counter.mjs +3 -3
- package/fesm2022/ngwr-counter.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker.mjs +217 -40
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-date.mjs +27 -5
- package/fesm2022/ngwr-date.mjs.map +1 -1
- package/fesm2022/ngwr-dialog.mjs +32 -3
- package/fesm2022/ngwr-dialog.mjs.map +1 -1
- package/fesm2022/ngwr-directives.mjs +116 -1
- package/fesm2022/ngwr-directives.mjs.map +1 -1
- package/fesm2022/ngwr-drawer.mjs +3 -3
- package/fesm2022/ngwr-drawer.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +13 -12
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-editor.mjs +28 -28
- package/fesm2022/ngwr-editor.mjs.map +1 -1
- package/fesm2022/ngwr-event-calendar.mjs +5 -5
- package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload.mjs +8 -8
- package/fesm2022/ngwr-file-upload.mjs.map +1 -1
- package/fesm2022/ngwr-graph.mjs +3 -3
- package/fesm2022/ngwr-graph.mjs.map +1 -1
- package/fesm2022/ngwr-hotkey.mjs +22 -22
- package/fesm2022/ngwr-hotkey.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ar.mjs +5 -0
- package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-cs.mjs +5 -0
- package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-de.mjs +5 -0
- package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +5 -0
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-es.mjs +5 -0
- package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-fr.mjs +5 -0
- package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-he.mjs +5 -0
- package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-hi.mjs +5 -0
- package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-id.mjs +5 -0
- package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-it.mjs +5 -0
- package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ja.mjs +5 -0
- package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ko.mjs +5 -0
- package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-nl.mjs +5 -0
- package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pl.mjs +5 -0
- package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pt.mjs +5 -0
- package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +5 -0
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-sv.mjs +5 -0
- package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-tr.mjs +5 -0
- package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-uk.mjs +5 -0
- package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-vi.mjs +5 -0
- package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh-tw.mjs +5 -0
- package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh.mjs +5 -0
- package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
- package/fesm2022/ngwr-i18n.mjs +2 -2
- package/fesm2022/ngwr-i18n.mjs.map +1 -1
- package/fesm2022/ngwr-icon.mjs +5 -5
- package/fesm2022/ngwr-icon.mjs.map +1 -1
- package/fesm2022/ngwr-image-cropper.mjs +11 -11
- package/fesm2022/ngwr-image-cropper.mjs.map +1 -1
- package/fesm2022/ngwr-input-number.mjs +4 -4
- 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 +15 -15
- package/fesm2022/ngwr-input.mjs.map +1 -1
- package/fesm2022/ngwr-keyboard.mjs +28 -28
- package/fesm2022/ngwr-keyboard.mjs.map +1 -1
- package/fesm2022/ngwr-knob.mjs +4 -4
- package/fesm2022/ngwr-knob.mjs.map +1 -1
- package/fesm2022/ngwr-lightbox.mjs +2 -2
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-load-state.mjs +2 -2
- package/fesm2022/ngwr-load-state.mjs.map +1 -1
- package/fesm2022/ngwr-mention.mjs +6 -6
- package/fesm2022/ngwr-mention.mjs.map +1 -1
- package/fesm2022/ngwr-meta.mjs +19 -3
- package/fesm2022/ngwr-meta.mjs.map +1 -1
- package/fesm2022/ngwr-overlay.mjs +3 -3
- package/fesm2022/ngwr-overlay.mjs.map +1 -1
- package/fesm2022/ngwr-pagination.mjs +7 -5
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-pipes.mjs +3 -5
- package/fesm2022/ngwr-pipes.mjs.map +1 -1
- package/fesm2022/ngwr-platform.mjs +4 -1
- package/fesm2022/ngwr-platform.mjs.map +1 -1
- package/fesm2022/ngwr-popconfirm.mjs +6 -5
- package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
- package/fesm2022/ngwr-popover.mjs +31 -30
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-pull-to-refresh.mjs +2 -2
- package/fesm2022/ngwr-pull-to-refresh.mjs.map +1 -1
- package/fesm2022/ngwr-qr.mjs +6 -6
- package/fesm2022/ngwr-qr.mjs.map +1 -1
- package/fesm2022/ngwr-radio.mjs +3 -3
- package/fesm2022/ngwr-radio.mjs.map +1 -1
- package/fesm2022/ngwr-rating.mjs +10 -10
- package/fesm2022/ngwr-rating.mjs.map +1 -1
- package/fesm2022/ngwr-schema-form.mjs +15 -5
- package/fesm2022/ngwr-schema-form.mjs.map +1 -1
- package/fesm2022/ngwr-select.mjs +57 -34
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-sidebar.mjs +3 -3
- package/fesm2022/ngwr-sidebar.mjs.map +1 -1
- package/fesm2022/ngwr-skeleton.mjs +2 -2
- package/fesm2022/ngwr-skeleton.mjs.map +1 -1
- package/fesm2022/ngwr-slider-testing.mjs.map +1 -1
- package/fesm2022/ngwr-slider.mjs +13 -13
- package/fesm2022/ngwr-slider.mjs.map +1 -1
- package/fesm2022/ngwr-sortable-list.mjs +3 -3
- package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
- package/fesm2022/ngwr-splitter.mjs +5 -5
- package/fesm2022/ngwr-splitter.mjs.map +1 -1
- package/fesm2022/ngwr-statistic.mjs +5 -3
- package/fesm2022/ngwr-statistic.mjs.map +1 -1
- package/fesm2022/ngwr-storage.mjs +6 -4
- 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-testing.mjs.map +1 -1
- package/fesm2022/ngwr-table.mjs +263 -32
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tabs.mjs +2 -2
- package/fesm2022/ngwr-tabs.mjs.map +1 -1
- package/fesm2022/ngwr-toast-testing.mjs +8 -1
- package/fesm2022/ngwr-toast-testing.mjs.map +1 -1
- package/fesm2022/ngwr-toast.mjs +63 -20
- package/fesm2022/ngwr-toast.mjs.map +1 -1
- package/fesm2022/ngwr-tour.mjs +7 -7
- package/fesm2022/ngwr-tour.mjs.map +1 -1
- package/fesm2022/ngwr-transfer.mjs +20 -9
- package/fesm2022/ngwr-transfer.mjs.map +1 -1
- package/fesm2022/ngwr-tree.mjs +64 -24
- package/fesm2022/ngwr-tree.mjs.map +1 -1
- package/fesm2022/ngwr-utils.mjs +98 -55
- package/fesm2022/ngwr-utils.mjs.map +1 -1
- package/fesm2022/ngwr-validators.mjs +2 -2
- 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 +26 -26
- package/fesm2022/ngwr-window.mjs.map +1 -1
- package/fesm2022/ngwr.mjs.map +1 -1
- package/i18n/ar.json +5 -0
- package/i18n/cs.json +5 -0
- package/i18n/de.json +5 -0
- package/i18n/en.json +5 -0
- package/i18n/es.json +5 -0
- package/i18n/fr.json +5 -0
- package/i18n/he.json +5 -0
- package/i18n/hi.json +5 -0
- package/i18n/id.json +5 -0
- package/i18n/it.json +5 -0
- package/i18n/ja.json +5 -0
- package/i18n/ko.json +5 -0
- package/i18n/nl.json +5 -0
- package/i18n/pl.json +5 -0
- package/i18n/pt.json +5 -0
- package/i18n/ru.json +5 -0
- package/i18n/sv.json +5 -0
- package/i18n/tr.json +5 -0
- package/i18n/uk.json +5 -0
- package/i18n/vi.json +5 -0
- package/i18n/zh-TW.json +5 -0
- package/i18n/zh.json +5 -0
- package/input-number/styles/_index.scss +6 -0
- package/llms-full.txt +31 -19
- package/llms.txt +37 -19
- package/mcp/providers.js +1 -1
- package/package.json +15 -10
- package/pagination/styles/_index.scss +8 -0
- package/schematics/icon-set/index.js +3 -3
- package/schematics/migrations/v16/index.js +742 -0
- package/schematics/migrations.json +5 -0
- package/schematics/ng-add/index.js +4 -4
- package/schematics/provider/index.js +4 -4
- package/schematics/use/symbol-map.json +2 -0
- package/select/styles/_index.scss +1 -1
- package/skills/ngwr/SKILL.md +6 -4
- package/skills/ngwr/references/catalog.md +4 -2
- package/skills/ngwr/references/setup.md +10 -9
- package/table/styles/_index.scss +92 -30
- package/toast/styles/_index.scss +30 -0
- package/tree/styles/_index.scss +17 -0
- package/types/index-CXbgza47.d.ts +13 -0
- package/types/ngwr-animations-aurora.d.ts +1 -1
- package/types/ngwr-animations-blur-reveal.d.ts +2 -2
- package/types/ngwr-animations-dot-grid.d.ts +1 -2
- package/types/ngwr-animations-flow-lines.d.ts +1 -1
- package/types/ngwr-animations-fluid-cursor.d.ts +1 -1
- package/types/ngwr-animations-reveal.d.ts +4 -8
- package/types/ngwr-animations-ripple-grid.d.ts +1 -1
- package/types/ngwr-animations-spotlight.d.ts +1 -1
- package/types/ngwr-animations-thread-lines.d.ts +1 -1
- package/types/ngwr-animations-tilt.d.ts +1 -1
- package/types/ngwr-avatar.d.ts +2 -2
- package/types/ngwr-badge.d.ts +1 -1
- package/types/ngwr-cascader.d.ts +12 -1
- package/types/ngwr-charts-boxplot-chart.d.ts +1 -1
- package/types/ngwr-charts-bullet-chart.d.ts +2 -2
- package/types/ngwr-charts-candlestick-chart.d.ts +1 -1
- package/types/ngwr-charts-core.d.ts +12 -12
- package/types/ngwr-charts-line-chart.d.ts +2 -2
- package/types/ngwr-charts-radar-chart.d.ts +1 -1
- package/types/ngwr-charts-scatter-chart.d.ts +2 -2
- package/types/ngwr-charts-waterfall-chart.d.ts +1 -1
- package/types/ngwr-color-picker.d.ts +12 -12
- package/types/ngwr-copy-value-testing.d.ts +87 -0
- package/types/ngwr-copy-value.d.ts +95 -0
- package/types/ngwr-date-picker-testing.d.ts +3 -3
- package/types/ngwr-date-picker.d.ts +97 -1
- package/types/ngwr-date.d.ts +44 -3
- package/types/ngwr-dialog.d.ts +50 -3
- package/types/ngwr-directives.d.ts +40 -0
- package/types/ngwr-drawer.d.ts +1 -1
- package/types/ngwr-dropdown.d.ts +3 -2
- package/types/ngwr-hotkey.d.ts +5 -5
- package/types/ngwr-i18n.d.ts +3 -3
- package/types/ngwr-icon.d.ts +26 -26
- package/types/ngwr-input-number.d.ts +2 -2
- package/types/ngwr-input.d.ts +8 -8
- package/types/ngwr-load-state.d.ts +6 -6
- package/types/ngwr-meta.d.ts +18 -0
- package/types/ngwr-pipes.d.ts +6 -4
- package/types/ngwr-platform.d.ts +2 -1
- package/types/ngwr-popconfirm.d.ts +3 -2
- package/types/ngwr-popover.d.ts +4 -3
- package/types/ngwr-select.d.ts +33 -18
- package/types/ngwr-slider-testing.d.ts +2 -2
- package/types/ngwr-slider.d.ts +3 -3
- package/types/ngwr-statistic.d.ts +5 -1
- package/types/ngwr-storage.d.ts +1 -1
- package/types/ngwr-table-testing.d.ts +2 -1
- package/types/ngwr-table.d.ts +155 -18
- package/types/ngwr-tabs.d.ts +10 -2
- package/types/ngwr-toast-testing.d.ts +6 -2
- package/types/ngwr-toast.d.ts +33 -5
- package/types/ngwr-transfer.d.ts +5 -0
- package/types/ngwr-tree.d.ts +22 -2
- package/types/ngwr-utils.d.ts +157 -82
- package/types/ngwr-validators.d.ts +4 -2
- package/types/ngwr-version.d.ts +1 -1
- package/types/ngwr.d.ts +1 -0
- package/types/pointer-tracker-D7fXxLQL.d.ts +24 -0
- package/fesm2022/ngwr-animations-core.mjs.map +0 -1
- package/types/ngwr-animations-core.d.ts +0 -294
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-animations-flow-lines.mjs","names":["DOCUMENT"],"sources":["../../../projects/lib/animations/flow-lines/flow-model.ts","../../../projects/lib/animations/flow-lines/flow-gl.ts","../../../projects/lib/animations/flow-lines/flow-lines.ts","../../../projects/lib/animations/flow-lines/flow-lines.html","../../../projects/lib/animations/flow-lines/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 { MAX_DPR } from 'ngwr/animations/core';\n\n/**\n * The pure side of `<wr-flow-lines>`: the spring every pushed point follows,\n * the wake the pointer leaves as a list of weighted segments, the ripples a\n * click sends out, the intro's head, the canvas size and the frame cap. The\n * shader in `flow-gl.ts` reads the numbers from here as uniforms; it owns\n * only what has to be per pixel.\n *\n * The wake is the one idea worth a note. A pushed point follows a damped\n * spring toward where the pointer wants it, and a spring is linear, so the\n * field under a moving pointer is the sum of the field under every place\n * the pointer has been, each weighted by the spring's response to a push\n * that began when the pointer arrived there and ended when it moved on.\n * That response is the step response, which has a closed form, so no state\n * is integrated frame by frame: the frame computes one weight per segment\n * from the clock alone, which makes a slow or jumpy frame rate harmless.\n */\n\n/** A line is never closer to its neighbour than this, in CSS px. */\nconst SPACING_MIN = 4;\n/** The shader's loop bound over the wake's segments: the oldest fall off beyond it. */\nconst WAKE_MAX = 32;\n/** The shader's loop bound over live ripples: a fourth click drops the oldest. */\nconst RIPPLE_MAX = 3;\n/** A new wake segment opens no more often than this, in seconds, and only once the pointer moved {@link SEGMENT_MOVE}. */\nconst SEGMENT_S = 0.032;\nconst SEGMENT_MOVE = 2;\n/** The spring's natural rate in rad/s: a swing is about two thirds of a second, settled in about one and a half. */\nconst SPRING_RATE = 10;\n/** The spring's damping ratio under a unit `bounce`, and its floor and ceiling. */\nconst DAMPING_UNIT = 0.26;\nconst DAMPING_MIN = 0.08;\n/** A segment laid at speed pushes harder, by one for every this many CSS px/s, up to the cap: a sweep leaves a wake a crawl does not. */\nconst BOOST_PER_SPEED = 1 / 1200;\nconst BOOST_MAX = 1.6;\n/** A closed segment is dropped once its envelope falls under this share of a unit push. */\nconst SETTLE = 0.01;\n/** How far a unit `push` moves a line at most, as a share of `reach`, and the most any push may, so the lines never fold. */\nconst PUSH = 0.14;\nconst PUSH_MAX = 0.18;\n/** The lens the push makes: `(1 - q)^2 * sqrt(q)` of the reach peaks at this inverse, so the peak is the push itself. */\nconst LENS = 1 / (0.64 * Math.sqrt(0.2));\n/** The step response overshoots by this much at most at the unit damping: the spring's own peak. */\nconst OVERSHOOT = 1 + Math.exp((-DAMPING_UNIT * Math.PI) / Math.sqrt(1 - DAMPING_UNIT * DAMPING_UNIT));\n/** A ripple's ring: how fast it travels in CSS px/s, its half width in CSS px, how long it lives in seconds and how far it pushes at its crest. */\nconst RIPPLE_SPEED = 380;\nconst RIPPLE_WIDTH = 70;\nconst RIPPLE_LIFE = 2.2;\nconst RIPPLE_PUSH = 34;\n/** The intro's length in seconds, the stagger between lines in CSS px of head and the head's softness. */\nconst INTRO_S = 1.6;\nconst INTRO_STAGGER = 180;\nconst INTRO_SOFT = 120;\n/** How many frames a second at rest, and the gap between them, in ms: the drift needs no more. */\nconst REST_FPS = 30;\nconst REST_FRAME_MS = 1000 / REST_FPS;\n/** The most device pixels the canvas may hold: a wide hero at a high device ratio renders at a lower one. */\nconst PIXELS = 2_500_000;\n/** The field fades out over this share of the shorter side at the top and the bottom, within these bounds, in CSS px. */\nconst FADE_SHARE = 0.12;\nconst FADE_MIN = 24;\nconst FADE_MAX = 96;\n\n/** `spacing` as the shader takes it: a finite number, {@link SPACING_MIN} at least. */\nfunction flowSpacing(spacing: number): number {\n return Math.max(SPACING_MIN, Number.isFinite(spacing) ? spacing : SPACING_MIN);\n}\n\n/** The spring's damping ratio under `bounce`: none is critically damped, one is the unit, more swings further. */\nfunction flowDamping(bounce: number): number {\n const b = Number.isFinite(bounce) ? Math.max(0, bounce) : 1;\n return Math.min(1, Math.max(DAMPING_MIN, 1 - (1 - DAMPING_UNIT) * b));\n}\n\n/**\n * The unit step response of the spring at `t` seconds: how far a point has\n * gone toward where a push that began at zero wants it. Zero before the push,\n * climbing through one and settling back on it; at the critical damping it\n * never crosses one.\n */\nfunction flowStep(t: number, rate: number, damping: number): number {\n if (t <= 0) return 0;\n const a = damping * rate;\n if (damping >= 1) {\n // Critically damped: the oscillating form divides by zero here.\n return 1 - Math.exp(-a * t) * (1 + a * t);\n }\n const b = rate * Math.sqrt(1 - damping * damping);\n return 1 - Math.exp(-a * t) * (Math.cos(b * t) + (a / b) * Math.sin(b * t));\n}\n\n/** How long after a push ends its response is under {@link SETTLE}, in seconds. */\nfunction flowSettle(rate: number, damping: number): number {\n return Math.log(1 / SETTLE) / (damping * rate);\n}\n\n/** How far a unit `push` moves a line at most under `reach`, in CSS px, within the fold bound. */\nfunction flowPush(push: number, reach: number): number {\n const p = Number.isFinite(push) ? Math.max(0, push) : 1;\n return Math.min(PUSH * p, PUSH_MAX) * Math.max(0, reach);\n}\n\n/**\n * How far a push moves a line `distance` from its centre, as a share of the\n * push: nothing at the centre, so the field never folds there, the whole\n * push at about 0.45 of `reach`, and nothing again at the reach. The\n * shader's own lens, kept here so a spec can read it.\n */\nfunction flowLensAt(distance: number, reach: number): number {\n if (reach <= 0 || distance >= reach) return 0;\n const q = (distance * distance) / (reach * reach);\n return LENS * (1 - q) * (1 - q) * (distance / reach);\n}\n\n/** One stretch of the pointer's path: where it was and when, `end` infinite while it is still there, and how much harder it pushes for the speed it was laid at. */\ninterface FlowSegment {\n x: number;\n y: number;\n start: number;\n end: number;\n boost: number;\n}\n\n/** How much harder a segment pushes when the pointer came `distance` CSS px in `seconds` to lay it. */\nfunction flowBoost(distance: number, seconds: number): number {\n if (!(seconds > 0)) return 1;\n return Math.min(BOOST_MAX, 1 + (distance / seconds) * BOOST_PER_SPEED);\n}\n\n/**\n * The pointer's wake: the segments of its path still pushing on the field,\n * and the weights the shader reads for them. `move` and `release` record the\n * pointer; `update` turns the clock into weights, drops the settled and\n * returns how many are live. Every time is in seconds.\n */\nclass FlowWake {\n readonly segments: FlowSegment[] = [];\n /** `x`, `y`, weight and nothing, per segment, in the order of {@link segments}; the shader's uniform. */\n readonly data = new Float32Array(WAKE_MAX * 4);\n /** How many of {@link data}'s entries are live after the last `update`. */\n count = 0;\n /** The box the live segments reach, min x, min y, max x, max y, in CSS px, after the last `update`. */\n readonly box = new Float32Array(4);\n\n /** The pointer is at `x`, `y` now. */\n move(x: number, y: number, now: number): void {\n const live = this.segments[this.segments.length - 1];\n if (live?.end === Infinity) {\n const moved = Math.hypot(x - live.x, y - live.y);\n if (moved < SEGMENT_MOVE) return;\n // A young segment has next to no weight yet: it slides rather than splits.\n if (now - live.start < SEGMENT_S) {\n live.x = x;\n live.y = y;\n return;\n }\n live.end = now;\n }\n const boost = live ? flowBoost(Math.hypot(x - live.x, y - live.y), now - live.start) : 1;\n if (this.segments.length === WAKE_MAX) this.segments.shift();\n this.segments.push({ x, y, start: now, end: Infinity, boost });\n }\n\n /** The pointer has left. */\n release(now: number): void {\n const live = this.segments[this.segments.length - 1];\n if (live?.end === Infinity) live.end = now;\n }\n\n /** Whether a segment is still open under the pointer. */\n pressed(): boolean {\n const live = this.segments[this.segments.length - 1];\n return live?.end === Infinity;\n }\n\n /** Forgets every segment at once: the still frame and a resize. */\n clear(): void {\n this.segments.length = 0;\n this.count = 0;\n }\n\n /**\n * The weights at `now` for a push of `push` CSS px at the heart, reaching\n * `reach` px, on a spring of `rate` and `damping`; the settled segments are\n * dropped first. Returns the live count, which is also {@link count}.\n */\n update(now: number, push: number, reach: number, rate: number, damping: number): number {\n const settle = flowSettle(rate, damping);\n const segments = this.segments;\n let kept = 0;\n for (const segment of segments) {\n if (now - segment.end > settle) continue;\n segments[kept++] = segment;\n }\n segments.length = kept;\n\n const data = this.data;\n const box = this.box;\n box[0] = box[1] = Infinity;\n box[2] = box[3] = -Infinity;\n for (let i = 0; i < kept; i++) {\n const segment = segments[i];\n const weight =\n push *\n segment.boost *\n (flowStep(now - segment.start, rate, damping) - flowStep(now - segment.end, rate, damping));\n const at = i * 4;\n data[at] = segment.x;\n data[at + 1] = segment.y;\n data[at + 2] = weight;\n data[at + 3] = 0;\n if (segment.x - reach < box[0]) box[0] = segment.x - reach;\n if (segment.y - reach < box[1]) box[1] = segment.y - reach;\n if (segment.x + reach > box[2]) box[2] = segment.x + reach;\n if (segment.y + reach > box[3]) box[3] = segment.y + reach;\n }\n if (kept === 0) box[0] = box[1] = box[2] = box[3] = 0;\n this.count = kept;\n return kept;\n }\n}\n\n/** One ripple: where the click was and when. */\ninterface FlowRipple {\n x: number;\n y: number;\n start: number;\n}\n\n/**\n * The ripples live from clicks: {@link RIPPLE_MAX} at most, the oldest giving\n * way. `update` drops the spent and lays `x`, `y`, age and crest push per\n * ripple into `data`.\n */\nclass FlowRipples {\n readonly ripples: FlowRipple[] = [];\n readonly data = new Float32Array(RIPPLE_MAX * 4);\n count = 0;\n\n add(x: number, y: number, now: number): void {\n if (this.ripples.length === RIPPLE_MAX) this.ripples.shift();\n this.ripples.push({ x, y, start: now });\n }\n\n clear(): void {\n this.ripples.length = 0;\n this.count = 0;\n }\n\n update(now: number): number {\n const ripples = this.ripples;\n let kept = 0;\n for (const ripple of ripples) {\n if (now - ripple.start >= RIPPLE_LIFE) continue;\n ripples[kept++] = ripple;\n }\n ripples.length = kept;\n for (let i = 0; i < kept; i++) {\n const ripple = ripples[i];\n const at = i * 4;\n this.data[at] = ripple.x;\n this.data[at + 1] = ripple.y;\n this.data[at + 2] = now - ripple.start;\n this.data[at + 3] = RIPPLE_PUSH;\n }\n this.count = kept;\n return kept;\n }\n}\n\n/**\n * How far a ripple's ring pushes at `distance` from its centre, `age`\n * seconds in, as a share of its crest push: a bell riding out at\n * {@link RIPPLE_SPEED}, fading as it goes and gone at {@link RIPPLE_LIFE},\n * softened by its own width at the centre so the field never folds there.\n * The shader's own formula, kept here so a spec can read it.\n */\nfunction flowRippleAt(distance: number, age: number): number {\n if (age <= 0 || age >= RIPPLE_LIFE) return 0;\n const life = 1 - age / RIPPLE_LIFE;\n const s = (distance - age * RIPPLE_SPEED) / RIPPLE_WIDTH;\n return life * Math.exp(-s * s) * (distance / Math.hypot(distance, RIPPLE_WIDTH));\n}\n\n/**\n * Where the intro's head is `elapsed` seconds in, in CSS px along the lines\n * from the edge it draws from, for a field `length` px long: eased out, past\n * the far edge by the stagger and the softness once done, so the slowest line\n * is whole too. Infinity once the intro is over or when there is none.\n */\nfunction flowIntroHead(elapsed: number, length: number): number {\n if (elapsed >= INTRO_S) return Infinity;\n const t = Math.max(0, elapsed) / INTRO_S;\n const eased = 1 - (1 - t) ** 3;\n return eased * (length + INTRO_STAGGER + INTRO_SOFT);\n}\n\n/** The render ratio: the device ratio, {@link MAX_DPR} at most, lowered to keep the canvas under {@link PIXELS}, never under one. */\nfunction flowRatio(width: number, height: number, devicePixelRatio: number): number {\n const area = Math.max(1, width * height);\n return Math.max(1, Math.min(MAX_DPR, devicePixelRatio, Math.sqrt(PIXELS / area)));\n}\n\n/** The shortest frame, in ms: none while anything beyond the drift moves, {@link REST_FRAME_MS} otherwise. */\nfunction flowFrameMs(live: boolean): number {\n return live ? 0 : REST_FRAME_MS;\n}\n\n/** How far in from the top and the bottom the field is faded, in CSS px, for a region of this size. */\nfunction flowFade(width: number, height: number): number {\n return Math.min(FADE_MAX, Math.max(FADE_MIN, FADE_SHARE * Math.min(width, height)));\n}\n\n/** Whether `surface` is light, so the lines are laid as ink on it rather than lit over it. */\nfunction flowInk(surface: ArrayLike<number>): boolean {\n return 0.2126 * surface[0] + 0.7152 * surface[1] + 0.0722 * surface[2] > 0.5;\n}\n\nexport {\n BOOST_MAX,\n BOOST_PER_SPEED,\n DAMPING_MIN,\n DAMPING_UNIT,\n FADE_MAX,\n FADE_MIN,\n FADE_SHARE,\n FlowRipples,\n FlowWake,\n INTRO_S,\n INTRO_SOFT,\n INTRO_STAGGER,\n LENS,\n OVERSHOOT,\n PIXELS,\n PUSH,\n PUSH_MAX,\n REST_FRAME_MS,\n RIPPLE_LIFE,\n RIPPLE_MAX,\n RIPPLE_PUSH,\n RIPPLE_SPEED,\n RIPPLE_WIDTH,\n SEGMENT_MOVE,\n SEGMENT_S,\n SETTLE,\n SPACING_MIN,\n SPRING_RATE,\n WAKE_MAX,\n flowBoost,\n flowDamping,\n flowFade,\n flowFrameMs,\n flowInk,\n flowIntroHead,\n flowLensAt,\n flowPush,\n flowRatio,\n flowRippleAt,\n flowSettle,\n flowSpacing,\n flowStep,\n};\nexport type { FlowRipple, FlowSegment };\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 { LENS, RIPPLE_MAX, WAKE_MAX } from './flow-model';\n\n/**\n * The one pass `<wr-flow-lines>` draws: a full-screen quad whose fragment\n * shader finds, for its pixel, the nearest line of the field and how far\n * away it is. The field is a family of level sets: a pixel is first carried\n * back through the pointer's wake and the ripples (each a radial push with a\n * smooth falloff, summed), then read in the lines' own frame, along and\n * across, and the drift, two octaves of smooth noise across the lines, is\n * taken off its across coordinate. What is left, divided by the spacing,\n * says which line is nearest and how far it is in the field's units; the\n * gradient of that coordinate, carried analytically through the noise and\n * through the pushes' Jacobians, turns it into a distance in device px, so\n * the line is a crisp anti-aliased hairline whatever bends it, and a curve\n * through the pushed region is as smooth as one at rest. Dashes, the intro's\n * head and the edge fade multiply the coverage; the accent is mixed in where\n * the push is strongest; the output is premultiplied.\n *\n * The wake's segments and the ripples come in as uniform arrays, so a frame\n * uploads a few hundred floats and nothing else. GLSL ES 1.00, which WebGL1\n * and WebGL2 both accept; the loop bounds are the model's `WAKE_MAX` and\n * `RIPPLE_MAX`, with a break at the live counts.\n */\n\ntype FlowGLContext = WebGLRenderingContext | WebGL2RenderingContext;\n\n/** What one frame needs, every length in CSS px unless said otherwise. */\ninterface FlowFrame {\n /** The canvas, in device px. */\n width: number;\n height: number;\n /** CSS px per device px: the inverse of the render ratio. */\n scale: number;\n /** The region's CSS size. */\n regionWidth: number;\n regionHeight: number;\n /** The lines' direction, as its cos and sin, and -1 under RTL so the intro draws from the inline start; 1 otherwise. */\n cos: number;\n sin: number;\n mirror: number;\n /** Between two lines; a line's half thickness in device px; how much of its colour a line lays. */\n spacing: number;\n halfWidth: number;\n ink: number;\n /** The drift: how far it bends a line, its frequency along a line in cycles per px, how much slower it varies across, and the clock. */\n amplitude: number;\n frequency: number;\n across: number;\n time: number;\n /** The line and the accent colour, 0..1 sRGB. */\n color: Float32Array;\n accent: Float32Array;\n /** The wake: `x`, `y`, weight, nothing per segment, how many are live, and the box they reach. */\n wake: Float32Array;\n wakeCount: number;\n wakeBox: Float32Array;\n /** How far from a segment it still pushes, and the push at its heart, which the accent is measured against. */\n reach: number;\n push: number;\n /** The ripples: `x`, `y`, age in seconds, crest push per ripple, and how many are live. */\n ripples: Float32Array;\n rippleCount: number;\n /** A ripple's speed in px/s, its ring's half width and its life in seconds. */\n rippleSpeed: number;\n rippleWidth: number;\n rippleLife: number;\n /** The dashes: their period, the dash's share of it, their offset along the lines now, and whether they are on. */\n dashPeriod: number;\n dashDuty: number;\n dashOffset: number;\n dashed: boolean;\n /** The intro's head from the start edge, how far the lines are staggered behind it and how soft it is; a head past everything is no intro. */\n introHead: number;\n introStagger: number;\n introSoft: number;\n /** How far in from the top and the bottom the field fades; the sides run on to the edge. */\n fade: number;\n}\n\ninterface FlowRenderer {\n /** Draws the frame onto the canvas. */\n render(frame: FlowFrame): void;\n /** Frees the program and the quad. */\n destroy(): void;\n}\n\nconst VERTEX = `\nattribute vec2 aPosition;\nvoid main () {\n gl_Position = vec4(aPosition, 0.0, 1.0);\n}`;\n\nconst FRAGMENT = `\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nprecision highp float;\n#else\nprecision mediump float;\n#endif\nconst int WAKE_MAX = ${WAKE_MAX};\nconst int RIPPLE_MAX = ${RIPPLE_MAX};\nconst float LENS = ${LENS.toFixed(4)};\nuniform vec2 uSize;\nuniform float uScale;\nuniform vec3 uAxis;\nuniform vec3 uLine;\nuniform vec4 uNoise;\nuniform vec3 uColor;\nuniform vec3 uAccent;\nuniform vec4 uWake[WAKE_MAX];\nuniform float uWakeCount;\nuniform vec4 uWakeBox;\nuniform vec2 uReach;\nuniform vec4 uRipple[RIPPLE_MAX];\nuniform float uRippleCount;\nuniform vec3 uRippleShape;\nuniform vec4 uDash;\nuniform vec4 uIntro;\nuniform float uFade;\n\nfloat hash (vec3 p) {\n p = fract(p * vec3(0.1031, 0.1030, 0.0973));\n p += dot(p, p.yxz + 33.33);\n return fract((p.x + p.y) * p.z);\n}\n\n// Value noise in -1..1 with its gradient, quintic-smoothed, so the slope is continuous too.\nvec4 noised (vec3 x) {\n vec3 p = floor(x);\n vec3 w = fract(x);\n vec3 u = w * w * w * (w * (w * 6.0 - 15.0) + 10.0);\n vec3 du = 30.0 * w * w * (w * (w - 2.0) + 1.0);\n float a = hash(p);\n float b = hash(p + vec3(1.0, 0.0, 0.0));\n float c = hash(p + vec3(0.0, 1.0, 0.0));\n float d = hash(p + vec3(1.0, 1.0, 0.0));\n float e = hash(p + vec3(0.0, 0.0, 1.0));\n float f = hash(p + vec3(1.0, 0.0, 1.0));\n float g = hash(p + vec3(0.0, 1.0, 1.0));\n float h = hash(p + vec3(1.0, 1.0, 1.0));\n float k1 = b - a;\n float k2 = c - a;\n float k3 = e - a;\n float k4 = a - b - c + d;\n float k5 = a - c - e + g;\n float k6 = a - b - e + f;\n float k7 = -a + b + c - d + e - f - g + h;\n float v = a + k1 * u.x + k2 * u.y + k3 * u.z + k4 * u.x * u.y + k5 * u.y * u.z + k6 * u.z * u.x\n + k7 * u.x * u.y * u.z;\n vec3 grad = du * vec3(\n k1 + k4 * u.y + k6 * u.z + k7 * u.y * u.z,\n k2 + k5 * u.z + k4 * u.x + k7 * u.z * u.x,\n k3 + k6 * u.x + k5 * u.y + k7 * u.x * u.y);\n return vec4(v * 2.0 - 1.0, grad * 2.0);\n}\n\nvoid main () {\n // The pixel in CSS px from the region's top left, y down.\n vec2 p = vec2(gl_FragCoord.x * uScale, uSize.y - gl_FragCoord.y * uScale);\n float fade = smoothstep(0.0, uFade, min(p.y, uSize.y - p.y));\n if (fade <= 0.0) {\n gl_FragColor = vec4(0.0);\n return;\n }\n\n // Where the pixel is carried from: the wake's and the ripples' pushes, each\n // f(r) times the offset from its centre, nothing at the centre itself so the\n // field never folds, and the Jacobian of the sum (symmetric: xx, xy, yy),\n // f on the diagonal plus 2 df/d(r^2) d d^T.\n vec2 W = vec2(0.0);\n vec3 J = vec3(0.0);\n if (uWakeCount > 0.0 && all(greaterThan(p, uWakeBox.xy)) && all(lessThan(p, uWakeBox.zw))) {\n float R2 = uReach.x * uReach.x;\n // A lens: the push grows from the centre and falls off to the reach, peaking at the push itself.\n float gain = LENS / uReach.x;\n for (int i = 0; i < WAKE_MAX; i++) {\n if (float(i) >= uWakeCount) break;\n vec4 s = uWake[i];\n vec2 d = p - s.xy;\n float r2 = dot(d, d);\n if (r2 >= R2) continue;\n float q = r2 / R2;\n float f = s.z * gain * (1.0 - q) * (1.0 - q);\n float dfdr2 = s.z * gain * -2.0 * (1.0 - q) / R2;\n W += f * d;\n J += vec3(f + 2.0 * dfdr2 * d.x * d.x, 2.0 * dfdr2 * d.x * d.y, f + 2.0 * dfdr2 * d.y * d.y);\n }\n }\n float ring = 0.0;\n for (int i = 0; i < RIPPLE_MAX; i++) {\n if (float(i) >= uRippleCount) break;\n vec4 rp = uRipple[i];\n vec2 d = p - rp.xy;\n float r2 = dot(d, d);\n float r = sqrt(r2);\n float w = uRippleShape.y;\n float s = (r - rp.z * uRippleShape.x) / w;\n if (abs(s) > 3.0) continue;\n float life = 1.0 - rp.z / uRippleShape.z;\n float g = life * exp(-s * s);\n float amp = rp.w * g;\n // Softened by the ring's width, so the crest pushes its whole amount and the centre nothing.\n float inv = inversesqrt(r2 + w * w);\n float f = amp * inv;\n float dfdr2 = -amp * s / (w * max(r, 0.001)) * inv - 0.5 * amp * inv * inv * inv;\n W += f * d;\n J += vec3(f + 2.0 * dfdr2 * d.x * d.x, 2.0 * dfdr2 * d.x * d.y, f + 2.0 * dfdr2 * d.y * d.y);\n ring = max(ring, g);\n }\n\n // The field in the lines' frame, from the region's middle: along and across.\n vec2 q = p - W - uSize * 0.5;\n vec2 aAxis = vec2(uAxis.x, uAxis.y) * uAxis.z;\n vec2 cAxis = vec2(-uAxis.y, uAxis.x);\n float along = dot(q, aAxis);\n float across = dot(q, cAxis);\n\n // The drift across the lines: two octaves, and its slope along and across.\n vec3 n = vec3(along * uNoise.y, across * uNoise.y * uNoise.z, uNoise.w);\n vec4 o1 = noised(n);\n vec4 o2 = noised(n * 2.3 + vec3(7.3, 3.1, 11.0));\n float drift = uNoise.x * (o1.x + 0.35 * o2.x);\n float dAlong = uNoise.x * uNoise.y * (o1.y + 0.35 * 2.3 * o2.y);\n float dAcross = uNoise.x * uNoise.y * uNoise.z * (o1.z + 0.35 * 2.3 * o2.z);\n\n // The line coordinate, its gradient in the pixel's frame, and so the distance to the nearest line in device px.\n float v = across - drift;\n vec2 gq = cAxis * (1.0 - dAcross) - aAxis * dAlong;\n vec2 gp = vec2((1.0 - J.x) * gq.x - J.y * gq.y, -J.y * gq.x + (1.0 - J.z) * gq.y);\n float k = floor(v / uLine.x + 0.5);\n float dist = abs(v - k * uLine.x) * inversesqrt(max(dot(gp, gp), 1e-6)) / uScale;\n float cover = clamp(uLine.y + 0.5 - dist, 0.0, 1.0);\n if (cover <= 0.0) {\n gl_FragColor = vec4(0.0);\n return;\n }\n\n // Each line's own lot: where its dashes start and how far behind the intro's head it is.\n float lot = hash(vec3(k, 1.7, 2.9));\n if (uDash.w > 0.5) {\n float pos = mod(along + uDash.z + lot * uDash.x, uDash.x);\n cover *= clamp(min(pos, uDash.x * uDash.y - pos) / uScale + 0.5, 0.0, 1.0);\n }\n float head = uIntro.x - lot * uIntro.y;\n cover *= 1.0 - smoothstep(head - uIntro.w, head, along + uIntro.z);\n\n // The accent where the push is strongest, and on a ripple's crest; a pushed line lays a little more ink.\n float pushed = length(W) / max(uReach.y, 1.0);\n float accent = max(smoothstep(0.08, 0.9, pushed), ring * 0.9);\n float alpha = min(1.0, cover * fade * uLine.z * (1.0 + 0.8 * accent));\n vec3 rgb = mix(uColor, uAccent, accent * 0.95);\n gl_FragColor = vec4(rgb * alpha, alpha);\n}`;\n\nconst UNIFORMS = [\n 'uSize',\n 'uScale',\n 'uAxis',\n 'uLine',\n 'uNoise',\n 'uColor',\n 'uAccent',\n 'uWake',\n 'uWakeCount',\n 'uWakeBox',\n 'uReach',\n 'uRipple',\n 'uRippleCount',\n 'uRippleShape',\n 'uDash',\n 'uIntro',\n 'uFade',\n] as const;\n\ntype FlowUniform = (typeof UNIFORMS)[number];\n\n/** Stands in for an infinite head: every line is whole. */\nconst NO_INTRO = 1e9;\n\nclass Renderer implements FlowRenderer {\n private readonly program: WebGLProgram;\n private readonly quad: WebGLBuffer;\n private readonly uniforms: Record<FlowUniform, WebGLUniformLocation | null>;\n\n constructor(private readonly gl: FlowGLContext) {\n const quad = gl.createBuffer();\n if (!quad) throw new Error('flow-lines: 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 fragment = this.shader(gl.FRAGMENT_SHADER, FRAGMENT);\n const program = gl.createProgram();\n if (!program) throw new Error('flow-lines: 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(vertex);\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(`flow-lines: program failed: ${log ?? ''}`);\n }\n this.program = program;\n const uniforms = {} as Record<FlowUniform, WebGLUniformLocation | null>;\n for (const name of UNIFORMS) uniforms[name] = gl.getUniformLocation(program, name);\n this.uniforms = uniforms;\n }\n\n render(frame: FlowFrame): void {\n const { gl, uniforms } = this;\n gl.useProgram(this.program);\n gl.uniform2f(uniforms.uSize, frame.regionWidth, frame.regionHeight);\n gl.uniform1f(uniforms.uScale, frame.scale);\n gl.uniform3f(uniforms.uAxis, frame.cos, frame.sin, frame.mirror);\n gl.uniform3f(uniforms.uLine, frame.spacing, frame.halfWidth, frame.ink);\n gl.uniform4f(uniforms.uNoise, frame.amplitude, frame.frequency, frame.across, frame.time);\n gl.uniform3f(uniforms.uColor, frame.color[0], frame.color[1], frame.color[2]);\n gl.uniform3f(uniforms.uAccent, frame.accent[0], frame.accent[1], frame.accent[2]);\n gl.uniform4fv(uniforms.uWake, frame.wake);\n gl.uniform1f(uniforms.uWakeCount, frame.wakeCount);\n gl.uniform4f(uniforms.uWakeBox, frame.wakeBox[0], frame.wakeBox[1], frame.wakeBox[2], frame.wakeBox[3]);\n gl.uniform2f(uniforms.uReach, frame.reach, frame.push);\n gl.uniform4fv(uniforms.uRipple, frame.ripples);\n gl.uniform1f(uniforms.uRippleCount, frame.rippleCount);\n gl.uniform3f(uniforms.uRippleShape, frame.rippleSpeed, frame.rippleWidth, frame.rippleLife);\n gl.uniform4f(uniforms.uDash, frame.dashPeriod, frame.dashDuty, frame.dashOffset, frame.dashed ? 1 : 0);\n const head = Number.isFinite(frame.introHead) ? frame.introHead : NO_INTRO;\n // The field's half length along the lines: the intro measures from the start edge, the shader from the middle.\n const half = (Math.abs(frame.regionWidth * frame.cos) + Math.abs(frame.regionHeight * frame.sin)) / 2;\n gl.uniform4f(uniforms.uIntro, head, frame.introStagger, half, frame.introSoft);\n gl.uniform1f(uniforms.uFade, frame.fade);\n\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.viewport(0, 0, frame.width, frame.height);\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\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 destroy(): void {\n const { gl } = this;\n gl.deleteBuffer(this.quad);\n gl.deleteProgram(this.program);\n }\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('flow-lines: 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(`flow-lines: shader failed: ${log ?? ''}`);\n }\n return shader;\n }\n}\n\n/**\n * The attributes the canvas's context is asked for: premultiplied alpha,\n * which is what the pass writes, no antialiasing (the shader does its own)\n * and no buffer the pass does not use.\n */\nconst FLOW_CONTEXT_ATTRIBUTES: WebGLContextAttributes = {\n alpha: true,\n premultipliedAlpha: true,\n antialias: false,\n depth: false,\n stencil: false,\n preserveDrawingBuffer: false,\n powerPreference: 'low-power',\n};\n\n/** A renderer on `gl`, or `null` where the shader will not compile or link. */\nfunction createFlowRenderer(gl: FlowGLContext): FlowRenderer | null {\n try {\n return new Renderer(gl);\n } catch {\n return null;\n }\n}\n\nexport { FLOW_CONTEXT_ATTRIBUTES, UNIFORMS as FLOW_UNIFORMS, NO_INTRO, createFlowRenderer };\nexport type { FlowFrame, FlowGLContext, FlowRenderer, FlowUniform };\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 { Directionality } from '@angular/cdk/bidi';\nimport { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n PLATFORM_ID,\n ViewEncapsulation,\n afterNextRender,\n booleanAttribute,\n computed,\n effect,\n inject,\n input,\n untracked,\n viewChild,\n} from '@angular/core';\n\nimport { FRAME_FLOOR_SLACK, MAX_FRAME_MS } from 'ngwr/animations/core';\nimport { WrPlatform } from 'ngwr/platform';\nimport { numAttr, resolveCssColorChannels, watchColorScheme, wrCheckStyles } from 'ngwr/utils';\n\nimport {\n FLOW_CONTEXT_ATTRIBUTES,\n type FlowFrame,\n type FlowGLContext,\n type FlowRenderer,\n createFlowRenderer,\n} from './flow-gl';\nimport {\n FlowRipples,\n FlowWake,\n INTRO_SOFT,\n INTRO_STAGGER,\n RIPPLE_LIFE,\n RIPPLE_SPEED,\n RIPPLE_WIDTH,\n SPRING_RATE,\n flowDamping,\n flowFade,\n flowFrameMs,\n flowInk,\n flowIntroHead,\n flowPush,\n flowRatio,\n flowSpacing,\n} from './flow-model';\nimport type { WrFlowLinesOrientation } from './types';\n\n/** The drift's frequency along a line, in noise cells per CSS px: a wave is about two cells long. */\nconst NOISE_FREQ = 1 / 220;\n/** How much slower the drift varies across the lines than along them: neighbours move together. */\nconst NOISE_ACROSS = 0.7;\n/** How fast the drift moves, in noise cells per second under a unit `speed`. */\nconst NOISE_DRIFT = 0.11;\n/** The dashes: one every this many CSS px, the dash's share of it, and how fast they stream in px/s under a unit `speed`. */\nconst DASH_PERIOD = 56;\nconst DASH_DUTY = 0.55;\nconst DASH_SPEED = 40;\n/** How much of its colour a line lays, on a light surface and on a dark one. */\nconst INK_LIGHT = 0.2;\nconst INK_DARK = 0.26;\n\n/**\n * A dense field of thin parallel lines behind a section's content that flows\n * like silk: a slow, smooth noise field bends every line in long gentle\n * waves, neighbours moving together, so the field reads like a surface or a\n * contour map in a breeze. The pointer is a soft weight on it: lines within\n * reach are pushed away with a smooth falloff and take on the accent where\n * they are displaced the most, and when it moves on they spring back with a\n * small elastic bounce, so a moving pointer leaves a short living wake. A\n * click sends a ring out across the field. The lines can be dashed, with the\n * dashes streaming along them, and can draw in from the inline start on\n * first view. The drawing is one WebGL pass in `flow-gl.ts`, a distance\n * field per pixel, so a line is a crisp anti-aliased hairline and a curve is\n * smooth whatever bends it; the pure pieces (the spring, the wake, the\n * ripples, the intro, the canvas size and the frame cap) are\n * `flow-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 finger\n * that moves pushes nothing, so a scroll over the section is never fought,\n * and a tap may ripple. The context is made when the host is first on screen\n * and sized, not at mount, so a region nobody scrolls to costs nothing; the\n * loop runs while the host is on screen and the document is visible, at\n * thirty frames a second while only the drift moves and at the screen's rate\n * while a wake, a ripple or the intro is live; with `speed` at none it stops\n * once they settle. The canvas renders at the device ratio under the model's\n * pixel budget.\n *\n * Colours come from the `--wr-flow-lines-color` and `-accent` hooks through\n * `resolveCssColorChannels`, re-read when the scheme changes; the surface is\n * read too, so the lines lay a little more light on a dark one than ink on\n * a light one, which is what reads the same. Under `prefers-reduced-motion: reduce` one still frame is\n * drawn, whole and at rest; under `forced-colors: active` nothing is;\n * without WebGL nothing is; on the server the empty canvas is rendered,\n * absolutely positioned, so the browser's first draw shifts no layout. A\n * lost context is let go and rebuilt when it comes back. Decorative:\n * `aria-hidden`, no pointer events. Styles: `@use 'ngwr/animations/flow-lines'`.\n */\n@Component({\n selector: 'wr-flow-lines',\n templateUrl: './flow-lines.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-flow-lines', 'aria-hidden': 'true' },\n})\nexport class WrFlowLines {\n /** Between two lines, in CSS px, four at least. @default 10 */\n readonly spacing = input(10, { transform: numAttr(10) });\n /** How thick a line is, in CSS px. @default 1 */\n readonly lineWidth = input(1, { transform: numAttr(1) });\n /** How far the drift bends a line at most, in CSS px. @default 28 */\n readonly amplitude = input(28, { transform: numAttr(28) });\n /** Which way the lines run across the region. @default 'horizontal' */\n readonly orientation = input<WrFlowLinesOrientation>('horizontal');\n /** The lines' tilt from their orientation, in degrees: positive falls toward the inline end. @default 0 */\n readonly twist = input(0, { transform: numAttr(0) });\n /** How fast the drift and the dashes move, a multiplier: none holds the field still between pushes. @default 1 */\n readonly speed = input(1, { transform: numAttr(1) });\n /** How far from the pointer a line is still pushed, in CSS px. @default 160 */\n readonly reach = input(160, { transform: numAttr(160) });\n /** How hard the pointer pushes, a multiplier: one moves a line a seventh of `reach` at most; none turns the push off. @default 1 */\n readonly push = input(1, { transform: numAttr(1) });\n /** How much a released line swings past its place, a multiplier: none settles without a swing. @default 1 */\n readonly bounce = input(1, { transform: numAttr(1) });\n /** Whether a click, or a tap, sends a ring out across the field. @default true */\n readonly ripple = input(true, { transform: booleanAttribute });\n /** Whether the lines draw in from the inline start when first on screen. @default false */\n readonly intro = input(false, { transform: booleanAttribute });\n /** Whether the lines are dashed, with the dashes streaming along them. @default false */\n readonly dashed = 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 private readonly dir = inject(Directionality, { optional: true });\n private readonly canvasRef = viewChild.required<ElementRef<HTMLCanvasElement>>('canvas');\n /** The intro draws from the inline start and the tilt falls toward the inline end: under RTL both are mirrored. */\n private readonly mirrored = computed(() => this.dir?.valueSignal() === 'rtl');\n\n private gl: FlowGLContext | null = null;\n private renderer: FlowRenderer | 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 readonly wake = new FlowWake();\n private readonly ripples = new FlowRipples();\n private readonly frame: FlowFrame = {\n width: 0,\n height: 0,\n scale: 1,\n regionWidth: 0,\n regionHeight: 0,\n cos: 1,\n sin: 0,\n mirror: 1,\n spacing: 10,\n halfWidth: 0.5,\n ink: INK_LIGHT,\n amplitude: 0,\n frequency: NOISE_FREQ,\n across: NOISE_ACROSS,\n time: 0,\n color: new Float32Array([0.42, 0.45, 0.5]),\n accent: new Float32Array([0.22, 0.41, 0.89]),\n wake: this.wake.data,\n wakeCount: 0,\n wakeBox: this.wake.box,\n reach: 160,\n push: 0,\n ripples: this.ripples.data,\n rippleCount: 0,\n rippleSpeed: RIPPLE_SPEED,\n rippleWidth: RIPPLE_WIDTH,\n rippleLife: RIPPLE_LIFE,\n dashPeriod: DASH_PERIOD,\n dashDuty: DASH_DUTY,\n dashOffset: 0,\n dashed: false,\n introHead: Infinity,\n introStagger: INTRO_STAGGER,\n introSoft: INTRO_SOFT,\n fade: 0,\n };\n\n /** The scene's clock in seconds, moving only while a frame runs, so a hidden tab holds the pose; and the drift's own, scaled by `speed`. The wake and the ripples keep wall time instead. */\n private time = 0;\n private drift = 0;\n /** When the intro began on the scene's clock; NaN before it has. */\n private introAt = NaN;\n /** Where the pointer is over the parent, in CSS px from the host's top left; NaN when it is not. */\n private pointerX = NaN;\n private pointerY = NaN;\n\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 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/flow-lines');\n if (!isPlatformBrowser(inject(PLATFORM_ID))) return;\n\n effect(() => {\n this.platform.pageVisible();\n this.platform.prefersReducedMotion();\n this.speed();\n untracked(() => this.sync());\n });\n effect(() => {\n this.spacing();\n this.lineWidth();\n this.amplitude();\n this.orientation();\n this.twist();\n this.dashed();\n this.mirrored();\n untracked(() => this.still());\n });\n watchColorScheme(() => {\n this.resolveColors();\n this.still();\n });\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 this.sync();\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.renderer?.destroy();\n this.renderer = 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 renderer, made at the first chance to draw; `null` where the browser has no WebGL. */\n private ensure(): FlowRenderer | null {\n if (this.renderer) return this.renderer;\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', FLOW_CONTEXT_ATTRIBUTES) ?? canvas.getContext('webgl', FLOW_CONTEXT_ATTRIBUTES);\n if (!gl) return null;\n this.gl = gl;\n this.renderer = createFlowRenderer(gl);\n if (!this.renderer) return null;\n this.resolveColors();\n return this.renderer;\n }\n\n private readonly onContextLost = (event: Event): void => {\n // Not prevented, the browser never restores it.\n event.preventDefault();\n this.renderer = null;\n this.running = false;\n this.stopLoop();\n };\n\n private readonly onContextRestored = (): void => {\n if (!this.gl) return;\n this.renderer = createFlowRenderer(this.gl);\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.sync();\n }\n\n /** Sizes the canvas to the host under the pixel budget. */\n private size(): void {\n const canvas = this.canvasRef().nativeElement;\n const ratio = flowRatio(this.width, this.height, this.doc.defaultView?.devicePixelRatio ?? 1);\n const width = Math.round(this.width * ratio);\n const height = Math.round(this.height * ratio);\n if (canvas.width !== width) canvas.width = width;\n if (canvas.height !== height) canvas.height = height;\n this.frame.width = width;\n this.frame.height = height;\n this.frame.scale = 1 / ratio;\n }\n\n // Colours\n\n private resolveColors(): void {\n if (!this.renderer) return;\n const canvas = this.canvasRef().nativeElement;\n this.frame.color.set(resolveCssColorChannels(canvas, 'var(--wr-flow-lines-color)', '#6b7280'));\n this.frame.accent.set(resolveCssColorChannels(canvas, 'var(--wr-flow-lines-accent)', '#3969e2'));\n const light = flowInk(resolveCssColorChannels(canvas, 'var(--wr-color-surface)', '#ffffff'));\n this.frame.ink = light ? INK_LIGHT : INK_DARK;\n }\n\n // Pointer\n\n /** Where `event` is over the host, in CSS px from its top left. */\n private at(event: PointerEvent): [number, number] {\n const rect = this.canvasRef().nativeElement.getBoundingClientRect();\n return [event.clientX - rect.left, event.clientY - rect.top];\n }\n\n private readonly onPointerMove = (event: PointerEvent): void => {\n // A finger that moves is scrolling: the field must never fight it.\n if (event.pointerType === 'touch' || this.width === 0) return;\n [this.pointerX, this.pointerY] = this.at(event);\n if (untracked(this.push) > 0 && !this.platform.prefersReducedMotion()) {\n this.wake.move(this.pointerX, this.pointerY, performance.now() / 1000);\n this.sync();\n }\n };\n\n private readonly onPointerDown = (event: PointerEvent): void => {\n if (this.width === 0 || event.button !== 0 || !untracked(this.ripple) || this.platform.prefersReducedMotion()) {\n return;\n }\n const [x, y] = this.at(event);\n this.ripples.add(x, y, performance.now() / 1000);\n this.sync();\n };\n\n private readonly onPointerLeave = (): void => {\n this.pointerX = NaN;\n this.pointerY = NaN;\n this.wake.release(performance.now() / 1000);\n };\n\n // Loop\n\n /** Whether anything beyond the drift moves: a wake, a ripple or the intro. The frame cap is lifted while it does. */\n private live(): boolean {\n return (\n this.wake.segments.length > 0 ||\n this.ripples.ripples.length > 0 ||\n (!Number.isNaN(this.introAt) && Number.isFinite(this.frame.introHead))\n );\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();\n const run = allowed && !reduced && (untracked(this.speed) > 0 || this.live());\n if (run !== this.running) {\n this.running = run;\n if (run) {\n this.lastFrame = performance.now();\n this.rafId = requestAnimationFrame(this.frameLoop);\n return;\n }\n this.stopLoop();\n }\n // Allowed but not running: one still frame, under reduced motion whole and at rest, however the pointer sits.\n if (allowed && !run) {\n if (reduced) this.rest();\n this.still();\n }\n }\n\n /** Everything beyond the drift gone at once: the still frame has no push and no intro in it. */\n private rest(): void {\n this.wake.clear();\n this.ripples.clear();\n this.introAt = NaN;\n this.frame.introHead = Infinity;\n }\n\n private stopLoop(): void {\n if (this.rafId !== null) cancelAnimationFrame(this.rafId);\n this.rafId = null;\n }\n\n /** One frame drawn outside the loop: the reduced-motion still, and a resize or a retheme while the loop is off. */\n private still(): void {\n if (this.running || !this.mounted || this.width === 0 || !this.inView) return;\n this.draw();\n }\n\n private readonly frameLoop = (now: number): void => {\n this.rafId = null;\n if (!this.running) return;\n const floor = flowFrameMs(this.live());\n if (floor > 0 && now - this.lastFrame + FRAME_FLOOR_SLACK < floor) {\n this.rafId = requestAnimationFrame(this.frameLoop);\n return;\n }\n const dt = Math.min(Math.max(now - this.lastFrame, 0), MAX_FRAME_MS) / 1000;\n this.lastFrame = now;\n // The wall clock the pointer's events were stamped on, not the frame's timestamp: a headless or throttled browser hands out one that runs apart from it.\n this.advance(performance.now() / 1000, dt);\n this.draw();\n // Nothing left to move: the loop rests until a push, a resize or a retheme.\n if (untracked(this.speed) <= 0 && !this.live()) {\n this.running = false;\n return;\n }\n if (this.running) this.rafId = requestAnimationFrame(this.frameLoop);\n };\n\n /**\n * The clocks move on and the wake's weights follow. The scene's clock takes\n * the frame's clamped `dt`, so a throttled tab resumes where it was; the\n * wake and the ripples read the wall clock, `now`, which the pointer's\n * events are stamped on, so a slow frame rate stretches nothing.\n */\n private advance(now: number, dt: number): void {\n this.time += dt;\n this.drift += dt * Math.max(0, untracked(this.speed));\n const reach = Math.max(1, untracked(this.reach));\n const push = flowPush(untracked(this.push), reach);\n this.wake.update(now, push, reach, SPRING_RATE, flowDamping(untracked(this.bounce)));\n this.ripples.update(now);\n }\n\n /** The frame's numbers from the inputs and the state, and the pass. */\n private draw(): void {\n const renderer = this.ensure();\n if (!renderer || this.width === 0) return;\n const frame = this.frame;\n this.size();\n\n const width = this.width;\n const height = this.height;\n const mirror = this.mirrored() ? -1 : 1;\n const turn = untracked(this.orientation) === 'vertical' ? 90 : 0;\n const angle = ((untracked(this.twist) + turn) * Math.PI) / 180;\n frame.regionWidth = width;\n frame.regionHeight = height;\n frame.cos = Math.cos(angle);\n frame.sin = Math.sin(angle) * mirror;\n frame.mirror = mirror;\n frame.spacing = flowSpacing(untracked(this.spacing));\n frame.halfWidth = Math.max(0.1, untracked(this.lineWidth)) / 2 / frame.scale;\n frame.amplitude = untracked(this.amplitude);\n frame.time = this.drift * NOISE_DRIFT;\n frame.wakeCount = this.wake.count;\n frame.reach = Math.max(1, untracked(this.reach));\n frame.push = flowPush(untracked(this.push), frame.reach);\n frame.rippleCount = this.ripples.count;\n frame.dashed = untracked(this.dashed);\n frame.dashOffset = -((this.drift * DASH_SPEED) % DASH_PERIOD);\n frame.fade = flowFade(width, height);\n\n // The intro begins at the first drawn frame, when the host is sized and on screen.\n if (untracked(this.intro) && Number.isNaN(this.introAt) && !this.platform.prefersReducedMotion()) {\n this.introAt = this.time;\n }\n const length = Math.abs(width * frame.cos) + Math.abs(height * frame.sin);\n frame.introHead = Number.isNaN(this.introAt) ? Infinity : flowIntroHead(this.time - this.introAt, length);\n\n renderer.render(frame);\n }\n}\n\nexport { DASH_DUTY, DASH_PERIOD, DASH_SPEED, INK_DARK, INK_LIGHT, NOISE_ACROSS, NOISE_DRIFT, NOISE_FREQ };\n","<canvas #canvas class=\"wr-flow-lines__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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AA;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-flow-lines.mjs","names":["DOCUMENT"],"sources":["../../../projects/lib/animations/flow-lines/flow-model.ts","../../../projects/lib/animations/flow-lines/flow-gl.ts","../../../projects/lib/animations/flow-lines/flow-lines.ts","../../../projects/lib/animations/flow-lines/flow-lines.html","../../../projects/lib/animations/flow-lines/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 { MAX_DPR } from '../internal';\n\n/**\n * The pure side of `<wr-flow-lines>`: the spring every pushed point follows,\n * the wake the pointer leaves as a list of weighted segments, the ripples a\n * click sends out, the intro's head, the canvas size and the frame cap. The\n * shader in `flow-gl.ts` reads the numbers from here as uniforms; it owns\n * only what has to be per pixel.\n *\n * The wake is the one idea worth a note. A pushed point follows a damped\n * spring toward where the pointer wants it, and a spring is linear, so the\n * field under a moving pointer is the sum of the field under every place\n * the pointer has been, each weighted by the spring's response to a push\n * that began when the pointer arrived there and ended when it moved on.\n * That response is the step response, which has a closed form, so no state\n * is integrated frame by frame: the frame computes one weight per segment\n * from the clock alone, which makes a slow or jumpy frame rate harmless.\n */\n\n/** A line is never closer to its neighbour than this, in CSS px. */\nconst SPACING_MIN = 4;\n/** The shader's loop bound over the wake's segments: the oldest fall off beyond it. */\nconst WAKE_MAX = 32;\n/** The shader's loop bound over live ripples: a fourth click drops the oldest. */\nconst RIPPLE_MAX = 3;\n/** A new wake segment opens no more often than this, in seconds, and only once the pointer moved {@link SEGMENT_MOVE}. */\nconst SEGMENT_S = 0.032;\nconst SEGMENT_MOVE = 2;\n/** The spring's natural rate in rad/s: a swing is about two thirds of a second, settled in about one and a half. */\nconst SPRING_RATE = 10;\n/** The spring's damping ratio under a unit `bounce`, and its floor and ceiling. */\nconst DAMPING_UNIT = 0.26;\nconst DAMPING_MIN = 0.08;\n/** A segment laid at speed pushes harder, by one for every this many CSS px/s, up to the cap: a sweep leaves a wake a crawl does not. */\nconst BOOST_PER_SPEED = 1 / 1200;\nconst BOOST_MAX = 1.6;\n/** A closed segment is dropped once its envelope falls under this share of a unit push. */\nconst SETTLE = 0.01;\n/** How far a unit `push` moves a line at most, as a share of `reach`, and the most any push may, so the lines never fold. */\nconst PUSH = 0.14;\nconst PUSH_MAX = 0.18;\n/** The lens the push makes: `(1 - q)^2 * sqrt(q)` of the reach peaks at this inverse, so the peak is the push itself. */\nconst LENS = 1 / (0.64 * Math.sqrt(0.2));\n/** The step response overshoots by this much at most at the unit damping: the spring's own peak. */\nconst OVERSHOOT = 1 + Math.exp((-DAMPING_UNIT * Math.PI) / Math.sqrt(1 - DAMPING_UNIT * DAMPING_UNIT));\n/** A ripple's ring: how fast it travels in CSS px/s, its half width in CSS px, how long it lives in seconds and how far it pushes at its crest. */\nconst RIPPLE_SPEED = 380;\nconst RIPPLE_WIDTH = 70;\nconst RIPPLE_LIFE = 2.2;\nconst RIPPLE_PUSH = 34;\n/** The intro's length in seconds, the stagger between lines in CSS px of head and the head's softness. */\nconst INTRO_S = 1.6;\nconst INTRO_STAGGER = 180;\nconst INTRO_SOFT = 120;\n/** How many frames a second at rest, and the gap between them, in ms: the drift needs no more. */\nconst REST_FPS = 30;\nconst REST_FRAME_MS = 1000 / REST_FPS;\n/** The most device pixels the canvas may hold: a wide hero at a high device ratio renders at a lower one. */\nconst PIXELS = 2_500_000;\n/** The field fades out over this share of the shorter side at the top and the bottom, within these bounds, in CSS px. */\nconst FADE_SHARE = 0.12;\nconst FADE_MIN = 24;\nconst FADE_MAX = 96;\n\n/** `spacing` as the shader takes it: a finite number, {@link SPACING_MIN} at least. */\nfunction flowSpacing(spacing: number): number {\n return Math.max(SPACING_MIN, Number.isFinite(spacing) ? spacing : SPACING_MIN);\n}\n\n/** The spring's damping ratio under `bounce`: none is critically damped, one is the unit, more swings further. */\nfunction flowDamping(bounce: number): number {\n const b = Number.isFinite(bounce) ? Math.max(0, bounce) : 1;\n return Math.min(1, Math.max(DAMPING_MIN, 1 - (1 - DAMPING_UNIT) * b));\n}\n\n/**\n * The unit step response of the spring at `t` seconds: how far a point has\n * gone toward where a push that began at zero wants it. Zero before the push,\n * climbing through one and settling back on it; at the critical damping it\n * never crosses one.\n */\nfunction flowStep(t: number, rate: number, damping: number): number {\n if (t <= 0) return 0;\n const a = damping * rate;\n if (damping >= 1) {\n // Critically damped: the oscillating form divides by zero here.\n return 1 - Math.exp(-a * t) * (1 + a * t);\n }\n const b = rate * Math.sqrt(1 - damping * damping);\n return 1 - Math.exp(-a * t) * (Math.cos(b * t) + (a / b) * Math.sin(b * t));\n}\n\n/** How long after a push ends its response is under {@link SETTLE}, in seconds. */\nfunction flowSettle(rate: number, damping: number): number {\n return Math.log(1 / SETTLE) / (damping * rate);\n}\n\n/** How far a unit `push` moves a line at most under `reach`, in CSS px, within the fold bound. */\nfunction flowPush(push: number, reach: number): number {\n const p = Number.isFinite(push) ? Math.max(0, push) : 1;\n return Math.min(PUSH * p, PUSH_MAX) * Math.max(0, reach);\n}\n\n/**\n * How far a push moves a line `distance` from its centre, as a share of the\n * push: nothing at the centre, so the field never folds there, the whole\n * push at about 0.45 of `reach`, and nothing again at the reach. The\n * shader's own lens, kept here so a spec can read it.\n */\nfunction flowLensAt(distance: number, reach: number): number {\n if (reach <= 0 || distance >= reach) return 0;\n const q = (distance * distance) / (reach * reach);\n return LENS * (1 - q) * (1 - q) * (distance / reach);\n}\n\n/** One stretch of the pointer's path: where it was and when, `end` infinite while it is still there, and how much harder it pushes for the speed it was laid at. */\ninterface FlowSegment {\n x: number;\n y: number;\n start: number;\n end: number;\n boost: number;\n}\n\n/** How much harder a segment pushes when the pointer came `distance` CSS px in `seconds` to lay it. */\nfunction flowBoost(distance: number, seconds: number): number {\n if (!(seconds > 0)) return 1;\n return Math.min(BOOST_MAX, 1 + (distance / seconds) * BOOST_PER_SPEED);\n}\n\n/**\n * The pointer's wake: the segments of its path still pushing on the field,\n * and the weights the shader reads for them. `move` and `release` record the\n * pointer; `update` turns the clock into weights, drops the settled and\n * returns how many are live. Every time is in seconds.\n */\nclass FlowWake {\n readonly segments: FlowSegment[] = [];\n /** `x`, `y`, weight and nothing, per segment, in the order of {@link segments}; the shader's uniform. */\n readonly data = new Float32Array(WAKE_MAX * 4);\n /** How many of {@link data}'s entries are live after the last `update`. */\n count = 0;\n /** The box the live segments reach, min x, min y, max x, max y, in CSS px, after the last `update`. */\n readonly box = new Float32Array(4);\n\n /** The pointer is at `x`, `y` now. */\n move(x: number, y: number, now: number): void {\n const live = this.segments[this.segments.length - 1];\n if (live?.end === Infinity) {\n const moved = Math.hypot(x - live.x, y - live.y);\n if (moved < SEGMENT_MOVE) return;\n // A young segment has next to no weight yet: it slides rather than splits.\n if (now - live.start < SEGMENT_S) {\n live.x = x;\n live.y = y;\n return;\n }\n live.end = now;\n }\n const boost = live ? flowBoost(Math.hypot(x - live.x, y - live.y), now - live.start) : 1;\n if (this.segments.length === WAKE_MAX) this.segments.shift();\n this.segments.push({ x, y, start: now, end: Infinity, boost });\n }\n\n /** The pointer has left. */\n release(now: number): void {\n const live = this.segments[this.segments.length - 1];\n if (live?.end === Infinity) live.end = now;\n }\n\n /** Whether a segment is still open under the pointer. */\n pressed(): boolean {\n const live = this.segments[this.segments.length - 1];\n return live?.end === Infinity;\n }\n\n /** Forgets every segment at once: the still frame and a resize. */\n clear(): void {\n this.segments.length = 0;\n this.count = 0;\n }\n\n /**\n * The weights at `now` for a push of `push` CSS px at the heart, reaching\n * `reach` px, on a spring of `rate` and `damping`; the settled segments are\n * dropped first. Returns the live count, which is also {@link count}.\n */\n update(now: number, push: number, reach: number, rate: number, damping: number): number {\n const settle = flowSettle(rate, damping);\n const segments = this.segments;\n let kept = 0;\n for (const segment of segments) {\n if (now - segment.end > settle) continue;\n segments[kept++] = segment;\n }\n segments.length = kept;\n\n const data = this.data;\n const box = this.box;\n box[0] = box[1] = Infinity;\n box[2] = box[3] = -Infinity;\n for (let i = 0; i < kept; i++) {\n const segment = segments[i];\n const weight =\n push *\n segment.boost *\n (flowStep(now - segment.start, rate, damping) - flowStep(now - segment.end, rate, damping));\n const at = i * 4;\n data[at] = segment.x;\n data[at + 1] = segment.y;\n data[at + 2] = weight;\n data[at + 3] = 0;\n if (segment.x - reach < box[0]) box[0] = segment.x - reach;\n if (segment.y - reach < box[1]) box[1] = segment.y - reach;\n if (segment.x + reach > box[2]) box[2] = segment.x + reach;\n if (segment.y + reach > box[3]) box[3] = segment.y + reach;\n }\n if (kept === 0) box[0] = box[1] = box[2] = box[3] = 0;\n this.count = kept;\n return kept;\n }\n}\n\n/** One ripple: where the click was and when. */\ninterface FlowRipple {\n x: number;\n y: number;\n start: number;\n}\n\n/**\n * The ripples live from clicks: {@link RIPPLE_MAX} at most, the oldest giving\n * way. `update` drops the spent and lays `x`, `y`, age and crest push per\n * ripple into `data`.\n */\nclass FlowRipples {\n readonly ripples: FlowRipple[] = [];\n readonly data = new Float32Array(RIPPLE_MAX * 4);\n count = 0;\n\n add(x: number, y: number, now: number): void {\n if (this.ripples.length === RIPPLE_MAX) this.ripples.shift();\n this.ripples.push({ x, y, start: now });\n }\n\n clear(): void {\n this.ripples.length = 0;\n this.count = 0;\n }\n\n update(now: number): number {\n const ripples = this.ripples;\n let kept = 0;\n for (const ripple of ripples) {\n if (now - ripple.start >= RIPPLE_LIFE) continue;\n ripples[kept++] = ripple;\n }\n ripples.length = kept;\n for (let i = 0; i < kept; i++) {\n const ripple = ripples[i];\n const at = i * 4;\n this.data[at] = ripple.x;\n this.data[at + 1] = ripple.y;\n this.data[at + 2] = now - ripple.start;\n this.data[at + 3] = RIPPLE_PUSH;\n }\n this.count = kept;\n return kept;\n }\n}\n\n/**\n * How far a ripple's ring pushes at `distance` from its centre, `age`\n * seconds in, as a share of its crest push: a bell riding out at\n * {@link RIPPLE_SPEED}, fading as it goes and gone at {@link RIPPLE_LIFE},\n * softened by its own width at the centre so the field never folds there.\n * The shader's own formula, kept here so a spec can read it.\n */\nfunction flowRippleAt(distance: number, age: number): number {\n if (age <= 0 || age >= RIPPLE_LIFE) return 0;\n const life = 1 - age / RIPPLE_LIFE;\n const s = (distance - age * RIPPLE_SPEED) / RIPPLE_WIDTH;\n return life * Math.exp(-s * s) * (distance / Math.hypot(distance, RIPPLE_WIDTH));\n}\n\n/**\n * Where the intro's head is `elapsed` seconds in, in CSS px along the lines\n * from the edge it draws from, for a field `length` px long: eased out, past\n * the far edge by the stagger and the softness once done, so the slowest line\n * is whole too. Infinity once the intro is over or when there is none.\n */\nfunction flowIntroHead(elapsed: number, length: number): number {\n if (elapsed >= INTRO_S) return Infinity;\n const t = Math.max(0, elapsed) / INTRO_S;\n const eased = 1 - (1 - t) ** 3;\n return eased * (length + INTRO_STAGGER + INTRO_SOFT);\n}\n\n/** The render ratio: the device ratio, {@link MAX_DPR} at most, lowered to keep the canvas under {@link PIXELS}, never under one. */\nfunction flowRatio(width: number, height: number, devicePixelRatio: number): number {\n const area = Math.max(1, width * height);\n return Math.max(1, Math.min(MAX_DPR, devicePixelRatio, Math.sqrt(PIXELS / area)));\n}\n\n/** The shortest frame, in ms: none while anything beyond the drift moves, {@link REST_FRAME_MS} otherwise. */\nfunction flowFrameMs(live: boolean): number {\n return live ? 0 : REST_FRAME_MS;\n}\n\n/** How far in from the top and the bottom the field is faded, in CSS px, for a region of this size. */\nfunction flowFade(width: number, height: number): number {\n return Math.min(FADE_MAX, Math.max(FADE_MIN, FADE_SHARE * Math.min(width, height)));\n}\n\n/** Whether `surface` is light, so the lines are laid as ink on it rather than lit over it. */\nfunction flowInk(surface: ArrayLike<number>): boolean {\n return 0.2126 * surface[0] + 0.7152 * surface[1] + 0.0722 * surface[2] > 0.5;\n}\n\nexport {\n BOOST_MAX,\n BOOST_PER_SPEED,\n DAMPING_MIN,\n DAMPING_UNIT,\n FADE_MAX,\n FADE_MIN,\n FADE_SHARE,\n FlowRipples,\n FlowWake,\n INTRO_S,\n INTRO_SOFT,\n INTRO_STAGGER,\n LENS,\n OVERSHOOT,\n PIXELS,\n PUSH,\n PUSH_MAX,\n REST_FRAME_MS,\n RIPPLE_LIFE,\n RIPPLE_MAX,\n RIPPLE_PUSH,\n RIPPLE_SPEED,\n RIPPLE_WIDTH,\n SEGMENT_MOVE,\n SEGMENT_S,\n SETTLE,\n SPACING_MIN,\n SPRING_RATE,\n WAKE_MAX,\n flowBoost,\n flowDamping,\n flowFade,\n flowFrameMs,\n flowInk,\n flowIntroHead,\n flowLensAt,\n flowPush,\n flowRatio,\n flowRippleAt,\n flowSettle,\n flowSpacing,\n flowStep,\n};\nexport type { FlowRipple, FlowSegment };\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 { LENS, RIPPLE_MAX, WAKE_MAX } from './flow-model';\n\n/**\n * The one pass `<wr-flow-lines>` draws: a full-screen quad whose fragment\n * shader finds, for its pixel, the nearest line of the field and how far\n * away it is. The field is a family of level sets: a pixel is first carried\n * back through the pointer's wake and the ripples (each a radial push with a\n * smooth falloff, summed), then read in the lines' own frame, along and\n * across, and the drift, two octaves of smooth noise across the lines, is\n * taken off its across coordinate. What is left, divided by the spacing,\n * says which line is nearest and how far it is in the field's units; the\n * gradient of that coordinate, carried analytically through the noise and\n * through the pushes' Jacobians, turns it into a distance in device px, so\n * the line is a crisp anti-aliased hairline whatever bends it, and a curve\n * through the pushed region is as smooth as one at rest. Dashes, the intro's\n * head and the edge fade multiply the coverage; the accent is mixed in where\n * the push is strongest; the output is premultiplied.\n *\n * The wake's segments and the ripples come in as uniform arrays, so a frame\n * uploads a few hundred floats and nothing else. GLSL ES 1.00, which WebGL1\n * and WebGL2 both accept; the loop bounds are the model's `WAKE_MAX` and\n * `RIPPLE_MAX`, with a break at the live counts.\n */\n\ntype FlowGLContext = WebGLRenderingContext | WebGL2RenderingContext;\n\n/** What one frame needs, every length in CSS px unless said otherwise. */\ninterface FlowFrame {\n /** The canvas, in device px. */\n width: number;\n height: number;\n /** CSS px per device px: the inverse of the render ratio. */\n scale: number;\n /** The region's CSS size. */\n regionWidth: number;\n regionHeight: number;\n /** The lines' direction, as its cos and sin, and -1 under RTL so the intro draws from the inline start; 1 otherwise. */\n cos: number;\n sin: number;\n mirror: number;\n /** Between two lines; a line's half thickness in device px; how much of its colour a line lays. */\n spacing: number;\n halfWidth: number;\n ink: number;\n /** The drift: how far it bends a line, its frequency along a line in cycles per px, how much slower it varies across, and the clock. */\n amplitude: number;\n frequency: number;\n across: number;\n time: number;\n /** The line and the accent colour, 0..1 sRGB. */\n color: Float32Array;\n accent: Float32Array;\n /** The wake: `x`, `y`, weight, nothing per segment, how many are live, and the box they reach. */\n wake: Float32Array;\n wakeCount: number;\n wakeBox: Float32Array;\n /** How far from a segment it still pushes, and the push at its heart, which the accent is measured against. */\n reach: number;\n push: number;\n /** The ripples: `x`, `y`, age in seconds, crest push per ripple, and how many are live. */\n ripples: Float32Array;\n rippleCount: number;\n /** A ripple's speed in px/s, its ring's half width and its life in seconds. */\n rippleSpeed: number;\n rippleWidth: number;\n rippleLife: number;\n /** The dashes: their period, the dash's share of it, their offset along the lines now, and whether they are on. */\n dashPeriod: number;\n dashDuty: number;\n dashOffset: number;\n dashed: boolean;\n /** The intro's head from the start edge, how far the lines are staggered behind it and how soft it is; a head past everything is no intro. */\n introHead: number;\n introStagger: number;\n introSoft: number;\n /** How far in from the top and the bottom the field fades; the sides run on to the edge. */\n fade: number;\n}\n\ninterface FlowRenderer {\n /** Draws the frame onto the canvas. */\n render(frame: FlowFrame): void;\n /** Frees the program and the quad. */\n destroy(): void;\n}\n\nconst VERTEX = `\nattribute vec2 aPosition;\nvoid main () {\n gl_Position = vec4(aPosition, 0.0, 1.0);\n}`;\n\nconst FRAGMENT = `\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nprecision highp float;\n#else\nprecision mediump float;\n#endif\nconst int WAKE_MAX = ${WAKE_MAX};\nconst int RIPPLE_MAX = ${RIPPLE_MAX};\nconst float LENS = ${LENS.toFixed(4)};\nuniform vec2 uSize;\nuniform float uScale;\nuniform vec3 uAxis;\nuniform vec3 uLine;\nuniform vec4 uNoise;\nuniform vec3 uColor;\nuniform vec3 uAccent;\nuniform vec4 uWake[WAKE_MAX];\nuniform float uWakeCount;\nuniform vec4 uWakeBox;\nuniform vec2 uReach;\nuniform vec4 uRipple[RIPPLE_MAX];\nuniform float uRippleCount;\nuniform vec3 uRippleShape;\nuniform vec4 uDash;\nuniform vec4 uIntro;\nuniform float uFade;\n\nfloat hash (vec3 p) {\n p = fract(p * vec3(0.1031, 0.1030, 0.0973));\n p += dot(p, p.yxz + 33.33);\n return fract((p.x + p.y) * p.z);\n}\n\n// Value noise in -1..1 with its gradient, quintic-smoothed, so the slope is continuous too.\nvec4 noised (vec3 x) {\n vec3 p = floor(x);\n vec3 w = fract(x);\n vec3 u = w * w * w * (w * (w * 6.0 - 15.0) + 10.0);\n vec3 du = 30.0 * w * w * (w * (w - 2.0) + 1.0);\n float a = hash(p);\n float b = hash(p + vec3(1.0, 0.0, 0.0));\n float c = hash(p + vec3(0.0, 1.0, 0.0));\n float d = hash(p + vec3(1.0, 1.0, 0.0));\n float e = hash(p + vec3(0.0, 0.0, 1.0));\n float f = hash(p + vec3(1.0, 0.0, 1.0));\n float g = hash(p + vec3(0.0, 1.0, 1.0));\n float h = hash(p + vec3(1.0, 1.0, 1.0));\n float k1 = b - a;\n float k2 = c - a;\n float k3 = e - a;\n float k4 = a - b - c + d;\n float k5 = a - c - e + g;\n float k6 = a - b - e + f;\n float k7 = -a + b + c - d + e - f - g + h;\n float v = a + k1 * u.x + k2 * u.y + k3 * u.z + k4 * u.x * u.y + k5 * u.y * u.z + k6 * u.z * u.x\n + k7 * u.x * u.y * u.z;\n vec3 grad = du * vec3(\n k1 + k4 * u.y + k6 * u.z + k7 * u.y * u.z,\n k2 + k5 * u.z + k4 * u.x + k7 * u.z * u.x,\n k3 + k6 * u.x + k5 * u.y + k7 * u.x * u.y);\n return vec4(v * 2.0 - 1.0, grad * 2.0);\n}\n\nvoid main () {\n // The pixel in CSS px from the region's top left, y down.\n vec2 p = vec2(gl_FragCoord.x * uScale, uSize.y - gl_FragCoord.y * uScale);\n float fade = smoothstep(0.0, uFade, min(p.y, uSize.y - p.y));\n if (fade <= 0.0) {\n gl_FragColor = vec4(0.0);\n return;\n }\n\n // Where the pixel is carried from: the wake's and the ripples' pushes, each\n // f(r) times the offset from its centre, nothing at the centre itself so the\n // field never folds, and the Jacobian of the sum (symmetric: xx, xy, yy),\n // f on the diagonal plus 2 df/d(r^2) d d^T.\n vec2 W = vec2(0.0);\n vec3 J = vec3(0.0);\n if (uWakeCount > 0.0 && all(greaterThan(p, uWakeBox.xy)) && all(lessThan(p, uWakeBox.zw))) {\n float R2 = uReach.x * uReach.x;\n // A lens: the push grows from the centre and falls off to the reach, peaking at the push itself.\n float gain = LENS / uReach.x;\n for (int i = 0; i < WAKE_MAX; i++) {\n if (float(i) >= uWakeCount) break;\n vec4 s = uWake[i];\n vec2 d = p - s.xy;\n float r2 = dot(d, d);\n if (r2 >= R2) continue;\n float q = r2 / R2;\n float f = s.z * gain * (1.0 - q) * (1.0 - q);\n float dfdr2 = s.z * gain * -2.0 * (1.0 - q) / R2;\n W += f * d;\n J += vec3(f + 2.0 * dfdr2 * d.x * d.x, 2.0 * dfdr2 * d.x * d.y, f + 2.0 * dfdr2 * d.y * d.y);\n }\n }\n float ring = 0.0;\n for (int i = 0; i < RIPPLE_MAX; i++) {\n if (float(i) >= uRippleCount) break;\n vec4 rp = uRipple[i];\n vec2 d = p - rp.xy;\n float r2 = dot(d, d);\n float r = sqrt(r2);\n float w = uRippleShape.y;\n float s = (r - rp.z * uRippleShape.x) / w;\n if (abs(s) > 3.0) continue;\n float life = 1.0 - rp.z / uRippleShape.z;\n float g = life * exp(-s * s);\n float amp = rp.w * g;\n // Softened by the ring's width, so the crest pushes its whole amount and the centre nothing.\n float inv = inversesqrt(r2 + w * w);\n float f = amp * inv;\n float dfdr2 = -amp * s / (w * max(r, 0.001)) * inv - 0.5 * amp * inv * inv * inv;\n W += f * d;\n J += vec3(f + 2.0 * dfdr2 * d.x * d.x, 2.0 * dfdr2 * d.x * d.y, f + 2.0 * dfdr2 * d.y * d.y);\n ring = max(ring, g);\n }\n\n // The field in the lines' frame, from the region's middle: along and across.\n vec2 q = p - W - uSize * 0.5;\n vec2 aAxis = vec2(uAxis.x, uAxis.y) * uAxis.z;\n vec2 cAxis = vec2(-uAxis.y, uAxis.x);\n float along = dot(q, aAxis);\n float across = dot(q, cAxis);\n\n // The drift across the lines: two octaves, and its slope along and across.\n vec3 n = vec3(along * uNoise.y, across * uNoise.y * uNoise.z, uNoise.w);\n vec4 o1 = noised(n);\n vec4 o2 = noised(n * 2.3 + vec3(7.3, 3.1, 11.0));\n float drift = uNoise.x * (o1.x + 0.35 * o2.x);\n float dAlong = uNoise.x * uNoise.y * (o1.y + 0.35 * 2.3 * o2.y);\n float dAcross = uNoise.x * uNoise.y * uNoise.z * (o1.z + 0.35 * 2.3 * o2.z);\n\n // The line coordinate, its gradient in the pixel's frame, and so the distance to the nearest line in device px.\n float v = across - drift;\n vec2 gq = cAxis * (1.0 - dAcross) - aAxis * dAlong;\n vec2 gp = vec2((1.0 - J.x) * gq.x - J.y * gq.y, -J.y * gq.x + (1.0 - J.z) * gq.y);\n float k = floor(v / uLine.x + 0.5);\n float dist = abs(v - k * uLine.x) * inversesqrt(max(dot(gp, gp), 1e-6)) / uScale;\n float cover = clamp(uLine.y + 0.5 - dist, 0.0, 1.0);\n if (cover <= 0.0) {\n gl_FragColor = vec4(0.0);\n return;\n }\n\n // Each line's own lot: where its dashes start and how far behind the intro's head it is.\n float lot = hash(vec3(k, 1.7, 2.9));\n if (uDash.w > 0.5) {\n float pos = mod(along + uDash.z + lot * uDash.x, uDash.x);\n cover *= clamp(min(pos, uDash.x * uDash.y - pos) / uScale + 0.5, 0.0, 1.0);\n }\n float head = uIntro.x - lot * uIntro.y;\n cover *= 1.0 - smoothstep(head - uIntro.w, head, along + uIntro.z);\n\n // The accent where the push is strongest, and on a ripple's crest; a pushed line lays a little more ink.\n float pushed = length(W) / max(uReach.y, 1.0);\n float accent = max(smoothstep(0.08, 0.9, pushed), ring * 0.9);\n float alpha = min(1.0, cover * fade * uLine.z * (1.0 + 0.8 * accent));\n vec3 rgb = mix(uColor, uAccent, accent * 0.95);\n gl_FragColor = vec4(rgb * alpha, alpha);\n}`;\n\nconst UNIFORMS = [\n 'uSize',\n 'uScale',\n 'uAxis',\n 'uLine',\n 'uNoise',\n 'uColor',\n 'uAccent',\n 'uWake',\n 'uWakeCount',\n 'uWakeBox',\n 'uReach',\n 'uRipple',\n 'uRippleCount',\n 'uRippleShape',\n 'uDash',\n 'uIntro',\n 'uFade',\n] as const;\n\ntype FlowUniform = (typeof UNIFORMS)[number];\n\n/** Stands in for an infinite head: every line is whole. */\nconst NO_INTRO = 1e9;\n\nclass Renderer implements FlowRenderer {\n private readonly program: WebGLProgram;\n private readonly quad: WebGLBuffer;\n private readonly uniforms: Record<FlowUniform, WebGLUniformLocation | null>;\n\n constructor(private readonly gl: FlowGLContext) {\n const quad = gl.createBuffer();\n if (!quad) throw new Error('flow-lines: 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 fragment = this.shader(gl.FRAGMENT_SHADER, FRAGMENT);\n const program = gl.createProgram();\n if (!program) throw new Error('flow-lines: 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(vertex);\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(`flow-lines: program failed: ${log ?? ''}`);\n }\n this.program = program;\n const uniforms = {} as Record<FlowUniform, WebGLUniformLocation | null>;\n for (const name of UNIFORMS) uniforms[name] = gl.getUniformLocation(program, name);\n this.uniforms = uniforms;\n }\n\n render(frame: FlowFrame): void {\n const { gl, uniforms } = this;\n gl.useProgram(this.program);\n gl.uniform2f(uniforms.uSize, frame.regionWidth, frame.regionHeight);\n gl.uniform1f(uniforms.uScale, frame.scale);\n gl.uniform3f(uniforms.uAxis, frame.cos, frame.sin, frame.mirror);\n gl.uniform3f(uniforms.uLine, frame.spacing, frame.halfWidth, frame.ink);\n gl.uniform4f(uniforms.uNoise, frame.amplitude, frame.frequency, frame.across, frame.time);\n gl.uniform3f(uniforms.uColor, frame.color[0], frame.color[1], frame.color[2]);\n gl.uniform3f(uniforms.uAccent, frame.accent[0], frame.accent[1], frame.accent[2]);\n gl.uniform4fv(uniforms.uWake, frame.wake);\n gl.uniform1f(uniforms.uWakeCount, frame.wakeCount);\n gl.uniform4f(uniforms.uWakeBox, frame.wakeBox[0], frame.wakeBox[1], frame.wakeBox[2], frame.wakeBox[3]);\n gl.uniform2f(uniforms.uReach, frame.reach, frame.push);\n gl.uniform4fv(uniforms.uRipple, frame.ripples);\n gl.uniform1f(uniforms.uRippleCount, frame.rippleCount);\n gl.uniform3f(uniforms.uRippleShape, frame.rippleSpeed, frame.rippleWidth, frame.rippleLife);\n gl.uniform4f(uniforms.uDash, frame.dashPeriod, frame.dashDuty, frame.dashOffset, frame.dashed ? 1 : 0);\n const head = Number.isFinite(frame.introHead) ? frame.introHead : NO_INTRO;\n // The field's half length along the lines: the intro measures from the start edge, the shader from the middle.\n const half = (Math.abs(frame.regionWidth * frame.cos) + Math.abs(frame.regionHeight * frame.sin)) / 2;\n gl.uniform4f(uniforms.uIntro, head, frame.introStagger, half, frame.introSoft);\n gl.uniform1f(uniforms.uFade, frame.fade);\n\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.viewport(0, 0, frame.width, frame.height);\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\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 destroy(): void {\n const { gl } = this;\n gl.deleteBuffer(this.quad);\n gl.deleteProgram(this.program);\n }\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('flow-lines: 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(`flow-lines: shader failed: ${log ?? ''}`);\n }\n return shader;\n }\n}\n\n/**\n * The attributes the canvas's context is asked for: premultiplied alpha,\n * which is what the pass writes, no antialiasing (the shader does its own)\n * and no buffer the pass does not use.\n */\nconst FLOW_CONTEXT_ATTRIBUTES: WebGLContextAttributes = {\n alpha: true,\n premultipliedAlpha: true,\n antialias: false,\n depth: false,\n stencil: false,\n preserveDrawingBuffer: false,\n powerPreference: 'low-power',\n};\n\n/** A renderer on `gl`, or `null` where the shader will not compile or link. */\nfunction createFlowRenderer(gl: FlowGLContext): FlowRenderer | null {\n try {\n return new Renderer(gl);\n } catch {\n return null;\n }\n}\n\nexport { FLOW_CONTEXT_ATTRIBUTES, UNIFORMS as FLOW_UNIFORMS, NO_INTRO, createFlowRenderer };\nexport type { FlowFrame, FlowGLContext, FlowRenderer, FlowUniform };\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 { Directionality } from '@angular/cdk/bidi';\nimport { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n PLATFORM_ID,\n ViewEncapsulation,\n afterNextRender,\n booleanAttribute,\n computed,\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 { FRAME_FLOOR_SLACK, MAX_FRAME_MS } from '../internal';\n\nimport {\n FLOW_CONTEXT_ATTRIBUTES,\n type FlowFrame,\n type FlowGLContext,\n type FlowRenderer,\n createFlowRenderer,\n} from './flow-gl';\nimport {\n FlowRipples,\n FlowWake,\n INTRO_SOFT,\n INTRO_STAGGER,\n RIPPLE_LIFE,\n RIPPLE_SPEED,\n RIPPLE_WIDTH,\n SPRING_RATE,\n flowDamping,\n flowFade,\n flowFrameMs,\n flowInk,\n flowIntroHead,\n flowPush,\n flowRatio,\n flowSpacing,\n} from './flow-model';\nimport type { WrFlowLinesOrientation } from './types';\n\n/** The drift's frequency along a line, in noise cells per CSS px: a wave is about two cells long. */\nconst NOISE_FREQ = 1 / 220;\n/** How much slower the drift varies across the lines than along them: neighbours move together. */\nconst NOISE_ACROSS = 0.7;\n/** How fast the drift moves, in noise cells per second under a unit `speed`. */\nconst NOISE_DRIFT = 0.11;\n/** The dashes: one every this many CSS px, the dash's share of it, and how fast they stream in px/s under a unit `speed`. */\nconst DASH_PERIOD = 56;\nconst DASH_DUTY = 0.55;\nconst DASH_SPEED = 40;\n/** How much of its colour a line lays, on a light surface and on a dark one. */\nconst INK_LIGHT = 0.2;\nconst INK_DARK = 0.26;\n\n/**\n * A dense field of thin parallel lines behind a section's content that flows\n * like silk: a slow, smooth noise field bends every line in long gentle\n * waves, neighbours moving together, so the field reads like a surface or a\n * contour map in a breeze. The pointer is a soft weight on it: lines within\n * reach are pushed away with a smooth falloff and take on the accent where\n * they are displaced the most, and when it moves on they spring back with a\n * small elastic bounce, so a moving pointer leaves a short living wake. A\n * click sends a ring out across the field. The lines can be dashed, with the\n * dashes streaming along them, and can draw in from the inline start on\n * first view. The drawing is one WebGL pass in `flow-gl.ts`, a distance\n * field per pixel, so a line is a crisp anti-aliased hairline and a curve is\n * smooth whatever bends it; the pure pieces (the spring, the wake, the\n * ripples, the intro, the canvas size and the frame cap) are\n * `flow-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 finger\n * that moves pushes nothing, so a scroll over the section is never fought,\n * and a tap may ripple. The context is made when the host is first on screen\n * and sized, not at mount, so a region nobody scrolls to costs nothing; the\n * loop runs while the host is on screen and the document is visible, at\n * thirty frames a second while only the drift moves and at the screen's rate\n * while a wake, a ripple or the intro is live; with `speed` at none it stops\n * once they settle. The canvas renders at the device ratio under the model's\n * pixel budget.\n *\n * Colours come from the `--wr-flow-lines-color` and `-accent` hooks through\n * `wrResolveCssColorChannels`, re-read when the scheme changes; the surface is\n * read too, so the lines lay a little more light on a dark one than ink on\n * a light one, which is what reads the same. Under `prefers-reduced-motion: reduce` one still frame is\n * drawn, whole and at rest; under `forced-colors: active` nothing is;\n * without WebGL nothing is; on the server the empty canvas is rendered,\n * absolutely positioned, so the browser's first draw shifts no layout. A\n * lost context is let go and rebuilt when it comes back. Decorative:\n * `aria-hidden`, no pointer events. Styles: `@use 'ngwr/animations/flow-lines'`.\n */\n@Component({\n selector: 'wr-flow-lines',\n templateUrl: './flow-lines.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-flow-lines', 'aria-hidden': 'true' },\n})\nexport class WrFlowLines {\n /** Between two lines, in CSS px, four at least. @default 10 */\n readonly spacing = input(10, { transform: wrNumAttr(10) });\n /** How thick a line is, in CSS px. @default 1 */\n readonly lineWidth = input(1, { transform: wrNumAttr(1) });\n /** How far the drift bends a line at most, in CSS px. @default 28 */\n readonly amplitude = input(28, { transform: wrNumAttr(28) });\n /** Which way the lines run across the region. @default 'horizontal' */\n readonly orientation = input<WrFlowLinesOrientation>('horizontal');\n /** The lines' tilt from their orientation, in degrees: positive falls toward the inline end. @default 0 */\n readonly twist = input(0, { transform: wrNumAttr(0) });\n /** How fast the drift and the dashes move, a multiplier: none holds the field still between pushes. @default 1 */\n readonly speed = input(1, { transform: wrNumAttr(1) });\n /** How far from the pointer a line is still pushed, in CSS px. @default 160 */\n readonly reach = input(160, { transform: wrNumAttr(160) });\n /** How hard the pointer pushes, a multiplier: one moves a line a seventh of `reach` at most; none turns the push off. @default 1 */\n readonly push = input(1, { transform: wrNumAttr(1) });\n /** How much a released line swings past its place, a multiplier: none settles without a swing. @default 1 */\n readonly bounce = input(1, { transform: wrNumAttr(1) });\n /** Whether a click, or a tap, sends a ring out across the field. @default true */\n readonly ripple = input(true, { transform: booleanAttribute });\n /** Whether the lines draw in from the inline start when first on screen. @default false */\n readonly intro = input(false, { transform: booleanAttribute });\n /** Whether the lines are dashed, with the dashes streaming along them. @default false */\n readonly dashed = 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 private readonly dir = inject(Directionality, { optional: true });\n private readonly canvasRef = viewChild.required<ElementRef<HTMLCanvasElement>>('canvas');\n /** The intro draws from the inline start and the tilt falls toward the inline end: under RTL both are mirrored. */\n private readonly mirrored = computed(() => this.dir?.valueSignal() === 'rtl');\n\n private gl: FlowGLContext | null = null;\n private renderer: FlowRenderer | 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 readonly wake = new FlowWake();\n private readonly ripples = new FlowRipples();\n private readonly frame: FlowFrame = {\n width: 0,\n height: 0,\n scale: 1,\n regionWidth: 0,\n regionHeight: 0,\n cos: 1,\n sin: 0,\n mirror: 1,\n spacing: 10,\n halfWidth: 0.5,\n ink: INK_LIGHT,\n amplitude: 0,\n frequency: NOISE_FREQ,\n across: NOISE_ACROSS,\n time: 0,\n color: new Float32Array([0.42, 0.45, 0.5]),\n accent: new Float32Array([0.22, 0.41, 0.89]),\n wake: this.wake.data,\n wakeCount: 0,\n wakeBox: this.wake.box,\n reach: 160,\n push: 0,\n ripples: this.ripples.data,\n rippleCount: 0,\n rippleSpeed: RIPPLE_SPEED,\n rippleWidth: RIPPLE_WIDTH,\n rippleLife: RIPPLE_LIFE,\n dashPeriod: DASH_PERIOD,\n dashDuty: DASH_DUTY,\n dashOffset: 0,\n dashed: false,\n introHead: Infinity,\n introStagger: INTRO_STAGGER,\n introSoft: INTRO_SOFT,\n fade: 0,\n };\n\n /** The scene's clock in seconds, moving only while a frame runs, so a hidden tab holds the pose; and the drift's own, scaled by `speed`. The wake and the ripples keep wall time instead. */\n private time = 0;\n private drift = 0;\n /** When the intro began on the scene's clock; NaN before it has. */\n private introAt = NaN;\n /** Where the pointer is over the parent, in CSS px from the host's top left; NaN when it is not. */\n private pointerX = NaN;\n private pointerY = NaN;\n\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 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/flow-lines');\n if (!isPlatformBrowser(inject(PLATFORM_ID))) return;\n\n effect(() => {\n this.platform.pageVisible();\n this.platform.prefersReducedMotion();\n this.speed();\n untracked(() => this.sync());\n });\n effect(() => {\n this.spacing();\n this.lineWidth();\n this.amplitude();\n this.orientation();\n this.twist();\n this.dashed();\n this.mirrored();\n untracked(() => this.still());\n });\n wrWatchColorScheme(() => {\n this.resolveColors();\n this.still();\n });\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 this.sync();\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.renderer?.destroy();\n this.renderer = 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 renderer, made at the first chance to draw; `null` where the browser has no WebGL. */\n private ensure(): FlowRenderer | null {\n if (this.renderer) return this.renderer;\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', FLOW_CONTEXT_ATTRIBUTES) ?? canvas.getContext('webgl', FLOW_CONTEXT_ATTRIBUTES);\n if (!gl) return null;\n this.gl = gl;\n this.renderer = createFlowRenderer(gl);\n if (!this.renderer) return null;\n this.resolveColors();\n return this.renderer;\n }\n\n private readonly onContextLost = (event: Event): void => {\n // Not prevented, the browser never restores it.\n event.preventDefault();\n this.renderer = null;\n this.running = false;\n this.stopLoop();\n };\n\n private readonly onContextRestored = (): void => {\n if (!this.gl) return;\n this.renderer = createFlowRenderer(this.gl);\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.sync();\n }\n\n /** Sizes the canvas to the host under the pixel budget. */\n private size(): void {\n const canvas = this.canvasRef().nativeElement;\n const ratio = flowRatio(this.width, this.height, this.doc.defaultView?.devicePixelRatio ?? 1);\n const width = Math.round(this.width * ratio);\n const height = Math.round(this.height * ratio);\n if (canvas.width !== width) canvas.width = width;\n if (canvas.height !== height) canvas.height = height;\n this.frame.width = width;\n this.frame.height = height;\n this.frame.scale = 1 / ratio;\n }\n\n // Colours\n\n private resolveColors(): void {\n if (!this.renderer) return;\n const canvas = this.canvasRef().nativeElement;\n this.frame.color.set(wrResolveCssColorChannels(canvas, 'var(--wr-flow-lines-color)', '#6b7280'));\n this.frame.accent.set(wrResolveCssColorChannels(canvas, 'var(--wr-flow-lines-accent)', '#3969e2'));\n const light = flowInk(wrResolveCssColorChannels(canvas, 'var(--wr-color-surface)', '#ffffff'));\n this.frame.ink = light ? INK_LIGHT : INK_DARK;\n }\n\n // Pointer\n\n /** Where `event` is over the host, in CSS px from its top left. */\n private at(event: PointerEvent): [number, number] {\n const rect = this.canvasRef().nativeElement.getBoundingClientRect();\n return [event.clientX - rect.left, event.clientY - rect.top];\n }\n\n private readonly onPointerMove = (event: PointerEvent): void => {\n // A finger that moves is scrolling: the field must never fight it.\n if (event.pointerType === 'touch' || this.width === 0) return;\n [this.pointerX, this.pointerY] = this.at(event);\n if (untracked(this.push) > 0 && !this.platform.prefersReducedMotion()) {\n this.wake.move(this.pointerX, this.pointerY, performance.now() / 1000);\n this.sync();\n }\n };\n\n private readonly onPointerDown = (event: PointerEvent): void => {\n if (this.width === 0 || event.button !== 0 || !untracked(this.ripple) || this.platform.prefersReducedMotion()) {\n return;\n }\n const [x, y] = this.at(event);\n this.ripples.add(x, y, performance.now() / 1000);\n this.sync();\n };\n\n private readonly onPointerLeave = (): void => {\n this.pointerX = NaN;\n this.pointerY = NaN;\n this.wake.release(performance.now() / 1000);\n };\n\n // Loop\n\n /** Whether anything beyond the drift moves: a wake, a ripple or the intro. The frame cap is lifted while it does. */\n private live(): boolean {\n return (\n this.wake.segments.length > 0 ||\n this.ripples.ripples.length > 0 ||\n (!Number.isNaN(this.introAt) && Number.isFinite(this.frame.introHead))\n );\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();\n const run = allowed && !reduced && (untracked(this.speed) > 0 || this.live());\n if (run !== this.running) {\n this.running = run;\n if (run) {\n this.lastFrame = performance.now();\n this.rafId = requestAnimationFrame(this.frameLoop);\n return;\n }\n this.stopLoop();\n }\n // Allowed but not running: one still frame, under reduced motion whole and at rest, however the pointer sits.\n if (allowed && !run) {\n if (reduced) this.rest();\n this.still();\n }\n }\n\n /** Everything beyond the drift gone at once: the still frame has no push and no intro in it. */\n private rest(): void {\n this.wake.clear();\n this.ripples.clear();\n this.introAt = NaN;\n this.frame.introHead = Infinity;\n }\n\n private stopLoop(): void {\n if (this.rafId !== null) cancelAnimationFrame(this.rafId);\n this.rafId = null;\n }\n\n /** One frame drawn outside the loop: the reduced-motion still, and a resize or a retheme while the loop is off. */\n private still(): void {\n if (this.running || !this.mounted || this.width === 0 || !this.inView) return;\n this.draw();\n }\n\n private readonly frameLoop = (now: number): void => {\n this.rafId = null;\n if (!this.running) return;\n const floor = flowFrameMs(this.live());\n if (floor > 0 && now - this.lastFrame + FRAME_FLOOR_SLACK < floor) {\n this.rafId = requestAnimationFrame(this.frameLoop);\n return;\n }\n const dt = Math.min(Math.max(now - this.lastFrame, 0), MAX_FRAME_MS) / 1000;\n this.lastFrame = now;\n // The wall clock the pointer's events were stamped on, not the frame's timestamp: a headless or throttled browser hands out one that runs apart from it.\n this.advance(performance.now() / 1000, dt);\n this.draw();\n // Nothing left to move: the loop rests until a push, a resize or a retheme.\n if (untracked(this.speed) <= 0 && !this.live()) {\n this.running = false;\n return;\n }\n if (this.running) this.rafId = requestAnimationFrame(this.frameLoop);\n };\n\n /**\n * The clocks move on and the wake's weights follow. The scene's clock takes\n * the frame's clamped `dt`, so a throttled tab resumes where it was; the\n * wake and the ripples read the wall clock, `now`, which the pointer's\n * events are stamped on, so a slow frame rate stretches nothing.\n */\n private advance(now: number, dt: number): void {\n this.time += dt;\n this.drift += dt * Math.max(0, untracked(this.speed));\n const reach = Math.max(1, untracked(this.reach));\n const push = flowPush(untracked(this.push), reach);\n this.wake.update(now, push, reach, SPRING_RATE, flowDamping(untracked(this.bounce)));\n this.ripples.update(now);\n }\n\n /** The frame's numbers from the inputs and the state, and the pass. */\n private draw(): void {\n const renderer = this.ensure();\n if (!renderer || this.width === 0) return;\n const frame = this.frame;\n this.size();\n\n const width = this.width;\n const height = this.height;\n const mirror = this.mirrored() ? -1 : 1;\n const turn = untracked(this.orientation) === 'vertical' ? 90 : 0;\n const angle = ((untracked(this.twist) + turn) * Math.PI) / 180;\n frame.regionWidth = width;\n frame.regionHeight = height;\n frame.cos = Math.cos(angle);\n frame.sin = Math.sin(angle) * mirror;\n frame.mirror = mirror;\n frame.spacing = flowSpacing(untracked(this.spacing));\n frame.halfWidth = Math.max(0.1, untracked(this.lineWidth)) / 2 / frame.scale;\n frame.amplitude = untracked(this.amplitude);\n frame.time = this.drift * NOISE_DRIFT;\n frame.wakeCount = this.wake.count;\n frame.reach = Math.max(1, untracked(this.reach));\n frame.push = flowPush(untracked(this.push), frame.reach);\n frame.rippleCount = this.ripples.count;\n frame.dashed = untracked(this.dashed);\n frame.dashOffset = -((this.drift * DASH_SPEED) % DASH_PERIOD);\n frame.fade = flowFade(width, height);\n\n // The intro begins at the first drawn frame, when the host is sized and on screen.\n if (untracked(this.intro) && Number.isNaN(this.introAt) && !this.platform.prefersReducedMotion()) {\n this.introAt = this.time;\n }\n const length = Math.abs(width * frame.cos) + Math.abs(height * frame.sin);\n frame.introHead = Number.isNaN(this.introAt) ? Infinity : flowIntroHead(this.time - this.introAt, length);\n\n renderer.render(frame);\n }\n}\n\nexport { DASH_DUTY, DASH_PERIOD, DASH_SPEED, INK_DARK, INK_LIGHT, NOISE_ACROSS, NOISE_DRIFT, NOISE_FREQ };\n","<canvas #canvas class=\"wr-flow-lines__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 { WrFlowLines } from './flow-lines';\nexport type { WrFlowLinesOrientation } from './types';\n"],"mappings":";;;;;;;;;;;;;AAsCA,MAAM,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A,UAAQ,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { d as MAX_PIXELS, f as canvasBackdropRatio } from "./internal-BaQU4t_0.mjs";
|
|
1
2
|
import * as i0 from "@angular/core";
|
|
2
3
|
import { Component, DestroyRef, ElementRef, PLATFORM_ID, ViewEncapsulation, afterNextRender, booleanAttribute, effect, inject, input, untracked, viewChild } from "@angular/core";
|
|
3
4
|
import { DOCUMENT as DOCUMENT$1, isPlatformBrowser } from "@angular/common";
|
|
4
|
-
import {
|
|
5
|
+
import { wrCheckStyles, wrNumAttr, wrResolveCssColorChannels, wrWatchColorScheme } from "ngwr/utils";
|
|
5
6
|
import { WrPlatform } from "ngwr/platform";
|
|
6
|
-
import { MAX_FRAME_MS, MAX_PIXELS, canvasBackdropRatio } from "ngwr/animations/core";
|
|
7
7
|
/**
|
|
8
8
|
* @license
|
|
9
9
|
*
|
|
@@ -639,27 +639,27 @@ const SPLASH_PHASE = .17;
|
|
|
639
639
|
var WrFluidCursor = class WrFluidCursor {
|
|
640
640
|
intensity = input(1, {
|
|
641
641
|
...ngDevMode ? { debugName: "intensity" } : /* istanbul ignore next */ {},
|
|
642
|
-
transform:
|
|
642
|
+
transform: wrNumAttr(1)
|
|
643
643
|
});
|
|
644
644
|
size = input(24, {
|
|
645
645
|
...ngDevMode ? { debugName: "size" } : /* istanbul ignore next */ {},
|
|
646
|
-
transform:
|
|
646
|
+
transform: wrNumAttr(24)
|
|
647
647
|
});
|
|
648
648
|
force = input(1, {
|
|
649
649
|
...ngDevMode ? { debugName: "force" } : /* istanbul ignore next */ {},
|
|
650
|
-
transform:
|
|
650
|
+
transform: wrNumAttr(1)
|
|
651
651
|
});
|
|
652
652
|
swirl = input(1, {
|
|
653
653
|
...ngDevMode ? { debugName: "swirl" } : /* istanbul ignore next */ {},
|
|
654
|
-
transform:
|
|
654
|
+
transform: wrNumAttr(1)
|
|
655
655
|
});
|
|
656
656
|
trail = input(3, {
|
|
657
657
|
...ngDevMode ? { debugName: "trail" } : /* istanbul ignore next */ {},
|
|
658
|
-
transform:
|
|
658
|
+
transform: wrNumAttr(3)
|
|
659
659
|
});
|
|
660
660
|
momentum = input(6, {
|
|
661
661
|
...ngDevMode ? { debugName: "momentum" } : /* istanbul ignore next */ {},
|
|
662
|
-
transform:
|
|
662
|
+
transform: wrNumAttr(6)
|
|
663
663
|
});
|
|
664
664
|
shading = input(true, {
|
|
665
665
|
...ngDevMode ? { debugName: "shading" } : /* istanbul ignore next */ {},
|
|
@@ -718,7 +718,7 @@ var WrFluidCursor = class WrFluidCursor {
|
|
|
718
718
|
this.quality();
|
|
719
719
|
untracked(() => this.relayout());
|
|
720
720
|
});
|
|
721
|
-
|
|
721
|
+
wrWatchColorScheme(() => this.resolveColors());
|
|
722
722
|
afterNextRender(() => this.mount());
|
|
723
723
|
inject(DestroyRef).onDestroy(() => this.unmount());
|
|
724
724
|
}
|
|
@@ -837,8 +837,8 @@ var WrFluidCursor = class WrFluidCursor {
|
|
|
837
837
|
if (!this.sim) return;
|
|
838
838
|
const canvas = this.canvasRef().nativeElement;
|
|
839
839
|
this.palette.length = 0;
|
|
840
|
-
for (const [hook, fallback] of PALETTE_HOOKS) this.palette.push(
|
|
841
|
-
this.ink = fluidInk(
|
|
840
|
+
for (const [hook, fallback] of PALETTE_HOOKS) this.palette.push(wrResolveCssColorChannels(canvas, hook, fallback));
|
|
841
|
+
this.ink = fluidInk(wrResolveCssColorChannels(canvas, "var(--wr-color-surface)", "#ffffff"));
|
|
842
842
|
}
|
|
843
843
|
tint() {
|
|
844
844
|
if (untracked(this.rainbow)) fluidRainbowColor(this.phase, this.color);
|
|
@@ -947,7 +947,7 @@ var WrFluidCursor = class WrFluidCursor {
|
|
|
947
947
|
this.running = false;
|
|
948
948
|
return;
|
|
949
949
|
}
|
|
950
|
-
const dt = Math.min(Math.max(now - this.lastFrame, 0),
|
|
950
|
+
const dt = Math.min(Math.max(now - this.lastFrame, 0), 50);
|
|
951
951
|
this.lastFrame = now;
|
|
952
952
|
this.time += dt;
|
|
953
953
|
const quality = QUALITY[untracked(this.quality)];
|