ngwr 14.10.0 → 14.12.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/card/styles/_rules.scss +1 -1
- package/event-calendar/styles/_index.scss +14 -0
- package/fesm2022/ngwr-action-sheet-testing.mjs +111 -310
- package/fesm2022/ngwr-action-sheet-testing.mjs.map +1 -1
- package/fesm2022/ngwr-action-sheet.mjs +209 -89
- package/fesm2022/ngwr-action-sheet.mjs.map +1 -1
- package/fesm2022/ngwr-affix.mjs +122 -140
- package/fesm2022/ngwr-affix.mjs.map +1 -1
- package/fesm2022/ngwr-alert.mjs +204 -107
- package/fesm2022/ngwr-alert.mjs.map +1 -1
- package/fesm2022/ngwr-anchor.mjs +171 -113
- package/fesm2022/ngwr-anchor.mjs.map +1 -1
- package/fesm2022/ngwr-aurora.mjs +278 -198
- package/fesm2022/ngwr-aurora.mjs.map +1 -1
- package/fesm2022/ngwr-avatar.mjs +191 -190
- package/fesm2022/ngwr-avatar.mjs.map +1 -1
- package/fesm2022/ngwr-back-top.mjs +140 -95
- package/fesm2022/ngwr-back-top.mjs.map +1 -1
- package/fesm2022/ngwr-badge.mjs +339 -204
- package/fesm2022/ngwr-badge.mjs.map +1 -1
- package/fesm2022/ngwr-bar-chart-testing.mjs +56 -120
- package/fesm2022/ngwr-bar-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-bar-chart.mjs +204 -113
- package/fesm2022/ngwr-bar-chart.mjs.map +1 -1
- package/fesm2022/ngwr-blur-text-testing.mjs +44 -198
- package/fesm2022/ngwr-blur-text-testing.mjs.map +1 -1
- package/fesm2022/ngwr-blur-text.mjs +322 -202
- package/fesm2022/ngwr-blur-text.mjs.map +1 -1
- package/fesm2022/ngwr-border-glow-testing.mjs +134 -318
- package/fesm2022/ngwr-border-glow-testing.mjs.map +1 -1
- package/fesm2022/ngwr-border-glow.mjs +440 -277
- package/fesm2022/ngwr-border-glow.mjs.map +1 -1
- package/fesm2022/ngwr-breadcrumbs.mjs +256 -120
- package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngwr-burger.mjs +115 -63
- package/fesm2022/ngwr-burger.mjs.map +1 -1
- package/fesm2022/ngwr-button-testing.mjs +39 -94
- package/fesm2022/ngwr-button-testing.mjs.map +1 -1
- package/fesm2022/ngwr-button.mjs +404 -354
- package/fesm2022/ngwr-button.mjs.map +1 -1
- package/fesm2022/ngwr-calendar-heatmap-testing.mjs +50 -96
- package/fesm2022/ngwr-calendar-heatmap-testing.mjs.map +1 -1
- package/fesm2022/ngwr-calendar-heatmap.mjs +360 -264
- package/fesm2022/ngwr-calendar-heatmap.mjs.map +1 -1
- package/fesm2022/ngwr-calendar-testing.mjs +181 -378
- package/fesm2022/ngwr-calendar-testing.mjs.map +1 -1
- package/fesm2022/ngwr-calendar.mjs +612 -790
- package/fesm2022/ngwr-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-card.mjs +216 -98
- package/fesm2022/ngwr-card.mjs.map +1 -1
- package/fesm2022/ngwr-carousel-testing.mjs +131 -374
- package/fesm2022/ngwr-carousel-testing.mjs.map +1 -1
- package/fesm2022/ngwr-carousel.mjs +459 -332
- package/fesm2022/ngwr-carousel.mjs.map +1 -1
- package/fesm2022/ngwr-cascader-testing.mjs +227 -600
- package/fesm2022/ngwr-cascader-testing.mjs.map +1 -1
- package/fesm2022/ngwr-cascader.mjs +482 -418
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-checkbox-testing.mjs +45 -99
- package/fesm2022/ngwr-checkbox-testing.mjs.map +1 -1
- package/fesm2022/ngwr-checkbox.mjs +461 -354
- package/fesm2022/ngwr-checkbox.mjs.map +1 -1
- package/fesm2022/ngwr-circular-text-testing.mjs +56 -223
- package/fesm2022/ngwr-circular-text-testing.mjs.map +1 -1
- package/fesm2022/ngwr-circular-text.mjs +226 -186
- package/fesm2022/ngwr-circular-text.mjs.map +1 -1
- package/fesm2022/ngwr-click-spark.mjs +303 -199
- package/fesm2022/ngwr-click-spark.mjs.map +1 -1
- package/fesm2022/ngwr-clipboard.mjs +95 -163
- package/fesm2022/ngwr-clipboard.mjs.map +1 -1
- package/fesm2022/ngwr-collapse-testing.mjs +118 -365
- package/fesm2022/ngwr-collapse-testing.mjs.map +1 -1
- package/fesm2022/ngwr-collapse.mjs +287 -227
- package/fesm2022/ngwr-collapse.mjs.map +1 -1
- package/fesm2022/ngwr-color-picker-testing.mjs +223 -461
- package/fesm2022/ngwr-color-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-color-picker.mjs +952 -976
- package/fesm2022/ngwr-color-picker.mjs.map +1 -1
- package/fesm2022/ngwr-command-palette-testing.mjs +236 -585
- package/fesm2022/ngwr-command-palette-testing.mjs.map +1 -1
- package/fesm2022/ngwr-command-palette.mjs +512 -443
- package/fesm2022/ngwr-command-palette.mjs.map +1 -1
- package/fesm2022/ngwr-compare.mjs +252 -225
- package/fesm2022/ngwr-compare.mjs.map +1 -1
- package/fesm2022/ngwr-confetti.mjs +163 -181
- package/fesm2022/ngwr-confetti.mjs.map +1 -1
- package/fesm2022/ngwr-config.mjs +31 -106
- package/fesm2022/ngwr-config.mjs.map +1 -1
- package/fesm2022/ngwr-context-menu-testing.mjs +233 -642
- package/fesm2022/ngwr-context-menu-testing.mjs.map +1 -1
- package/fesm2022/ngwr-context-menu.mjs +837 -1167
- package/fesm2022/ngwr-context-menu.mjs.map +1 -1
- package/fesm2022/ngwr-cookie.mjs +103 -140
- package/fesm2022/ngwr-cookie.mjs.map +1 -1
- package/fesm2022/ngwr-counter.mjs +646 -460
- package/fesm2022/ngwr-counter.mjs.map +1 -1
- package/fesm2022/ngwr-date-adapters-fns.mjs +173 -266
- package/fesm2022/ngwr-date-adapters-fns.mjs.map +1 -1
- package/fesm2022/ngwr-date-adapters-luxon.mjs +164 -236
- package/fesm2022/ngwr-date-adapters-luxon.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker-testing.mjs +340 -700
- package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker.mjs +2581 -2416
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-date.mjs +606 -861
- package/fesm2022/ngwr-date.mjs.map +1 -1
- package/fesm2022/ngwr-decrypt-text-testing.mjs +57 -256
- package/fesm2022/ngwr-decrypt-text-testing.mjs.map +1 -1
- package/fesm2022/ngwr-decrypt-text.mjs +489 -409
- package/fesm2022/ngwr-decrypt-text.mjs.map +1 -1
- package/fesm2022/ngwr-density.mjs +157 -154
- package/fesm2022/ngwr-density.mjs.map +1 -1
- package/fesm2022/ngwr-descriptions.mjs +188 -90
- package/fesm2022/ngwr-descriptions.mjs.map +1 -1
- package/fesm2022/ngwr-dialog-testing.mjs +44 -87
- package/fesm2022/ngwr-dialog-testing.mjs.map +1 -1
- package/fesm2022/ngwr-dialog.mjs +391 -522
- package/fesm2022/ngwr-dialog.mjs.map +1 -1
- package/fesm2022/ngwr-directives.mjs +354 -271
- package/fesm2022/ngwr-directives.mjs.map +1 -1
- package/fesm2022/ngwr-divider.mjs +151 -133
- package/fesm2022/ngwr-divider.mjs.map +1 -1
- package/fesm2022/ngwr-donut-chart-testing.mjs +48 -111
- package/fesm2022/ngwr-donut-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-donut-chart.mjs +295 -190
- package/fesm2022/ngwr-donut-chart.mjs.map +1 -1
- package/fesm2022/ngwr-drag-drop.mjs +411 -301
- package/fesm2022/ngwr-drag-drop.mjs.map +1 -1
- package/fesm2022/ngwr-drawer-testing.mjs +97 -248
- package/fesm2022/ngwr-drawer-testing.mjs.map +1 -1
- package/fesm2022/ngwr-drawer.mjs +862 -889
- package/fesm2022/ngwr-drawer.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown-testing.mjs +125 -288
- package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +613 -641
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-editor-testing.mjs +194 -640
- package/fesm2022/ngwr-editor-testing.mjs.map +1 -1
- package/fesm2022/ngwr-editor.mjs +2062 -2541
- package/fesm2022/ngwr-editor.mjs.map +1 -1
- package/fesm2022/ngwr-empty.mjs +117 -72
- package/fesm2022/ngwr-empty.mjs.map +1 -1
- package/fesm2022/ngwr-event-calendar-testing.mjs +217 -439
- package/fesm2022/ngwr-event-calendar-testing.mjs.map +1 -1
- package/fesm2022/ngwr-event-calendar.mjs +906 -822
- package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-falling-text-testing.mjs +52 -216
- package/fesm2022/ngwr-falling-text-testing.mjs.map +1 -1
- package/fesm2022/ngwr-falling-text.mjs +375 -342
- package/fesm2022/ngwr-falling-text.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload-testing.mjs +138 -320
- package/fesm2022/ngwr-file-upload-testing.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload.mjs +475 -328
- package/fesm2022/ngwr-file-upload.mjs.map +1 -1
- package/fesm2022/ngwr-form-testing.mjs +145 -452
- package/fesm2022/ngwr-form-testing.mjs.map +1 -1
- package/fesm2022/ngwr-form.mjs +512 -590
- package/fesm2022/ngwr-form.mjs.map +1 -1
- package/fesm2022/ngwr-fuzzy-text-testing.mjs +36 -132
- package/fesm2022/ngwr-fuzzy-text-testing.mjs.map +1 -1
- package/fesm2022/ngwr-fuzzy-text.mjs +635 -421
- package/fesm2022/ngwr-fuzzy-text.mjs.map +1 -1
- package/fesm2022/ngwr-gauge-testing.mjs +49 -98
- package/fesm2022/ngwr-gauge-testing.mjs.map +1 -1
- package/fesm2022/ngwr-gauge.mjs +297 -129
- package/fesm2022/ngwr-gauge.mjs.map +1 -1
- package/fesm2022/ngwr-glitch-text-testing.mjs +61 -213
- package/fesm2022/ngwr-glitch-text-testing.mjs.map +1 -1
- package/fesm2022/ngwr-glitch-text.mjs +170 -73
- package/fesm2022/ngwr-glitch-text.mjs.map +1 -1
- package/fesm2022/ngwr-gradient-text-testing.mjs +82 -251
- package/fesm2022/ngwr-gradient-text-testing.mjs.map +1 -1
- package/fesm2022/ngwr-gradient-text.mjs +215 -114
- package/fesm2022/ngwr-gradient-text.mjs.map +1 -1
- package/fesm2022/ngwr-graph-testing.mjs +65 -233
- package/fesm2022/ngwr-graph-testing.mjs.map +1 -1
- package/fesm2022/ngwr-graph.mjs +882 -1046
- package/fesm2022/ngwr-graph.mjs.map +1 -1
- package/fesm2022/ngwr-hotkey.mjs +307 -285
- package/fesm2022/ngwr-hotkey.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ar.mjs +374 -464
- package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-cs.mjs +374 -434
- package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-de.mjs +374 -453
- package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +374 -561
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-es.mjs +374 -434
- package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-fr.mjs +374 -458
- package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-he.mjs +374 -457
- package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-hi.mjs +374 -434
- package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-id.mjs +374 -434
- package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-it.mjs +374 -453
- package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ja.mjs +374 -438
- package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ko.mjs +374 -446
- package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-nl.mjs +374 -450
- package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pl.mjs +374 -460
- package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pt.mjs +374 -443
- package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +374 -447
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-sv.mjs +374 -434
- package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-tr.mjs +374 -458
- package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-uk.mjs +374 -455
- package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-vi.mjs +374 -451
- package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh-TW.mjs +374 -442
- package/fesm2022/ngwr-i18n-zh-TW.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh.mjs +374 -433
- package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
- package/fesm2022/ngwr-i18n.mjs +415 -683
- package/fesm2022/ngwr-i18n.mjs.map +1 -1
- package/fesm2022/ngwr-icon-adapters-feather.mjs +28 -77
- package/fesm2022/ngwr-icon-adapters-feather.mjs.map +1 -1
- package/fesm2022/ngwr-icon-adapters-lucide.mjs +32 -94
- package/fesm2022/ngwr-icon-adapters-lucide.mjs.map +1 -1
- package/fesm2022/ngwr-icon.mjs +371 -690
- package/fesm2022/ngwr-icon.mjs.map +1 -1
- package/fesm2022/ngwr-image-cropper-testing.mjs +84 -227
- package/fesm2022/ngwr-image-cropper-testing.mjs.map +1 -1
- package/fesm2022/ngwr-image-cropper.mjs +577 -639
- package/fesm2022/ngwr-image-cropper.mjs.map +1 -1
- package/fesm2022/ngwr-input-number-testing.mjs +108 -305
- package/fesm2022/ngwr-input-number-testing.mjs.map +1 -1
- package/fesm2022/ngwr-input-number.mjs +511 -361
- package/fesm2022/ngwr-input-number.mjs.map +1 -1
- package/fesm2022/ngwr-input-otp-testing.mjs +172 -420
- package/fesm2022/ngwr-input-otp-testing.mjs.map +1 -1
- package/fesm2022/ngwr-input-otp.mjs +400 -352
- package/fesm2022/ngwr-input-otp.mjs.map +1 -1
- package/fesm2022/ngwr-input-testing.mjs +52 -100
- package/fesm2022/ngwr-input-testing.mjs.map +1 -1
- package/fesm2022/ngwr-input.mjs +356 -303
- package/fesm2022/ngwr-input.mjs.map +1 -1
- package/fesm2022/ngwr-keyboard.mjs +63 -45
- package/fesm2022/ngwr-keyboard.mjs.map +1 -1
- package/fesm2022/ngwr-knob-testing.mjs +101 -223
- package/fesm2022/ngwr-knob-testing.mjs.map +1 -1
- package/fesm2022/ngwr-knob.mjs +436 -303
- package/fesm2022/ngwr-knob.mjs.map +1 -1
- package/fesm2022/ngwr-layout.mjs +362 -207
- package/fesm2022/ngwr-layout.mjs.map +1 -1
- package/fesm2022/ngwr-lightbox-testing.mjs +100 -221
- package/fesm2022/ngwr-lightbox-testing.mjs.map +1 -1
- package/fesm2022/ngwr-lightbox.mjs +335 -268
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-line-chart-testing.mjs +65 -133
- package/fesm2022/ngwr-line-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-line-chart.mjs +356 -281
- package/fesm2022/ngwr-line-chart.mjs.map +1 -1
- package/fesm2022/ngwr-list.mjs +251 -134
- package/fesm2022/ngwr-list.mjs.map +1 -1
- package/fesm2022/ngwr-loading-bar-router.mjs +26 -68
- package/fesm2022/ngwr-loading-bar-router.mjs.map +1 -1
- package/fesm2022/ngwr-loading-bar.mjs +173 -186
- package/fesm2022/ngwr-loading-bar.mjs.map +1 -1
- package/fesm2022/ngwr-markdown-testing.mjs +174 -505
- package/fesm2022/ngwr-markdown-testing.mjs.map +1 -1
- package/fesm2022/ngwr-markdown.mjs +1578 -2219
- package/fesm2022/ngwr-markdown.mjs.map +1 -1
- package/fesm2022/ngwr-marquee-testing.mjs +118 -331
- package/fesm2022/ngwr-marquee-testing.mjs.map +1 -1
- package/fesm2022/ngwr-marquee.mjs +411 -230
- package/fesm2022/ngwr-marquee.mjs.map +1 -1
- package/fesm2022/ngwr-media.mjs +100 -127
- package/fesm2022/ngwr-media.mjs.map +1 -1
- package/fesm2022/ngwr-mention-testing.mjs +179 -506
- package/fesm2022/ngwr-mention-testing.mjs.map +1 -1
- package/fesm2022/ngwr-mention.mjs +668 -732
- package/fesm2022/ngwr-mention.mjs.map +1 -1
- package/fesm2022/ngwr-meta.mjs +257 -329
- package/fesm2022/ngwr-meta.mjs.map +1 -1
- package/fesm2022/ngwr-meter-group-testing.mjs +56 -101
- package/fesm2022/ngwr-meter-group-testing.mjs.map +1 -1
- package/fesm2022/ngwr-meter-group.mjs +206 -114
- package/fesm2022/ngwr-meter-group.mjs.map +1 -1
- package/fesm2022/ngwr-overlay.mjs +264 -576
- package/fesm2022/ngwr-overlay.mjs.map +1 -1
- package/fesm2022/ngwr-page-header.mjs +107 -67
- package/fesm2022/ngwr-page-header.mjs.map +1 -1
- package/fesm2022/ngwr-pagination-testing.mjs +125 -388
- package/fesm2022/ngwr-pagination-testing.mjs.map +1 -1
- package/fesm2022/ngwr-pagination.mjs +505 -335
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-pipes.mjs +343 -382
- package/fesm2022/ngwr-pipes.mjs.map +1 -1
- package/fesm2022/ngwr-platform.mjs +182 -221
- package/fesm2022/ngwr-platform.mjs.map +1 -1
- package/fesm2022/ngwr-popconfirm-testing.mjs +112 -307
- package/fesm2022/ngwr-popconfirm-testing.mjs.map +1 -1
- package/fesm2022/ngwr-popconfirm.mjs +474 -277
- package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
- package/fesm2022/ngwr-popover-testing.mjs +114 -332
- package/fesm2022/ngwr-popover-testing.mjs.map +1 -1
- package/fesm2022/ngwr-popover.mjs +1106 -1311
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-progress.mjs +124 -68
- package/fesm2022/ngwr-progress.mjs.map +1 -1
- package/fesm2022/ngwr-pull-to-refresh.mjs +198 -185
- package/fesm2022/ngwr-pull-to-refresh.mjs.map +1 -1
- package/fesm2022/ngwr-qr.mjs +1179 -1100
- package/fesm2022/ngwr-qr.mjs.map +1 -1
- package/fesm2022/ngwr-radio-testing.mjs +138 -389
- package/fesm2022/ngwr-radio-testing.mjs.map +1 -1
- package/fesm2022/ngwr-radio.mjs +351 -239
- package/fesm2022/ngwr-radio.mjs.map +1 -1
- package/fesm2022/ngwr-rating-testing.mjs +153 -390
- package/fesm2022/ngwr-rating-testing.mjs.map +1 -1
- package/fesm2022/ngwr-rating.mjs +296 -247
- package/fesm2022/ngwr-rating.mjs.map +1 -1
- package/fesm2022/ngwr-result.mjs +359 -114
- package/fesm2022/ngwr-result.mjs.map +1 -1
- package/fesm2022/ngwr-rotating-text-testing.mjs +45 -215
- package/fesm2022/ngwr-rotating-text-testing.mjs.map +1 -1
- package/fesm2022/ngwr-rotating-text.mjs +402 -272
- package/fesm2022/ngwr-rotating-text.mjs.map +1 -1
- package/fesm2022/ngwr-schema-form.mjs +384 -213
- package/fesm2022/ngwr-schema-form.mjs.map +1 -1
- package/fesm2022/ngwr-scroll.mjs +95 -105
- package/fesm2022/ngwr-scroll.mjs.map +1 -1
- package/fesm2022/ngwr-segmented-testing.mjs +184 -593
- package/fesm2022/ngwr-segmented-testing.mjs.map +1 -1
- package/fesm2022/ngwr-segmented.mjs +238 -251
- package/fesm2022/ngwr-segmented.mjs.map +1 -1
- package/fesm2022/ngwr-select-testing.mjs +139 -284
- package/fesm2022/ngwr-select-testing.mjs.map +1 -1
- package/fesm2022/ngwr-select.mjs +1810 -2098
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-shiny-text-testing.mjs +83 -228
- package/fesm2022/ngwr-shiny-text-testing.mjs.map +1 -1
- package/fesm2022/ngwr-shiny-text.mjs +304 -131
- package/fesm2022/ngwr-shiny-text.mjs.map +1 -1
- package/fesm2022/ngwr-sidebar.mjs +256 -205
- package/fesm2022/ngwr-sidebar.mjs.map +1 -1
- package/fesm2022/ngwr-skeleton.mjs +101 -72
- package/fesm2022/ngwr-skeleton.mjs.map +1 -1
- package/fesm2022/ngwr-slider-testing.mjs +191 -473
- package/fesm2022/ngwr-slider-testing.mjs.map +1 -1
- package/fesm2022/ngwr-slider.mjs +444 -443
- package/fesm2022/ngwr-slider.mjs.map +1 -1
- package/fesm2022/ngwr-sparkline-testing.mjs +37 -74
- package/fesm2022/ngwr-sparkline-testing.mjs.map +1 -1
- package/fesm2022/ngwr-sparkline.mjs +311 -196
- package/fesm2022/ngwr-sparkline.mjs.map +1 -1
- package/fesm2022/ngwr-speed-dial-testing.mjs +135 -278
- package/fesm2022/ngwr-speed-dial-testing.mjs.map +1 -1
- package/fesm2022/ngwr-speed-dial.mjs +242 -140
- package/fesm2022/ngwr-speed-dial.mjs.map +1 -1
- package/fesm2022/ngwr-spinner.mjs +97 -60
- package/fesm2022/ngwr-spinner.mjs.map +1 -1
- package/fesm2022/ngwr-splash-cursor-testing.mjs +23 -87
- package/fesm2022/ngwr-splash-cursor-testing.mjs.map +1 -1
- package/fesm2022/ngwr-splash-cursor.mjs +980 -725
- package/fesm2022/ngwr-splash-cursor.mjs.map +1 -1
- package/fesm2022/ngwr-split-text-testing.mjs +48 -218
- package/fesm2022/ngwr-split-text-testing.mjs.map +1 -1
- package/fesm2022/ngwr-split-text.mjs +365 -220
- package/fesm2022/ngwr-split-text.mjs.map +1 -1
- package/fesm2022/ngwr-splitter-testing.mjs +107 -241
- package/fesm2022/ngwr-splitter-testing.mjs.map +1 -1
- package/fesm2022/ngwr-splitter.mjs +222 -184
- package/fesm2022/ngwr-splitter.mjs.map +1 -1
- package/fesm2022/ngwr-spotlight-card-testing.mjs +105 -360
- package/fesm2022/ngwr-spotlight-card-testing.mjs.map +1 -1
- package/fesm2022/ngwr-spotlight-card.mjs +217 -135
- package/fesm2022/ngwr-spotlight-card.mjs.map +1 -1
- package/fesm2022/ngwr-squircle.mjs +410 -326
- package/fesm2022/ngwr-squircle.mjs.map +1 -1
- package/fesm2022/ngwr-star-border-testing.mjs +53 -168
- package/fesm2022/ngwr-star-border-testing.mjs.map +1 -1
- package/fesm2022/ngwr-star-border.mjs +160 -70
- package/fesm2022/ngwr-star-border.mjs.map +1 -1
- package/fesm2022/ngwr-statistic.mjs +570 -389
- package/fesm2022/ngwr-statistic.mjs.map +1 -1
- package/fesm2022/ngwr-stepper-testing.mjs +158 -471
- package/fesm2022/ngwr-stepper-testing.mjs.map +1 -1
- package/fesm2022/ngwr-stepper.mjs +336 -215
- package/fesm2022/ngwr-stepper.mjs.map +1 -1
- package/fesm2022/ngwr-storage.mjs +217 -330
- package/fesm2022/ngwr-storage.mjs.map +1 -1
- package/fesm2022/ngwr-switch-testing.mjs +42 -75
- package/fesm2022/ngwr-switch-testing.mjs.map +1 -1
- package/fesm2022/ngwr-switch.mjs +212 -114
- package/fesm2022/ngwr-switch.mjs.map +1 -1
- package/fesm2022/ngwr-table-testing.mjs +238 -572
- package/fesm2022/ngwr-table-testing.mjs.map +1 -1
- package/fesm2022/ngwr-table.mjs +1879 -1446
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tabs-router.mjs +84 -153
- package/fesm2022/ngwr-tabs-router.mjs.map +1 -1
- package/fesm2022/ngwr-tabs-testing.mjs +217 -617
- package/fesm2022/ngwr-tabs-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tabs.mjs +402 -425
- package/fesm2022/ngwr-tabs.mjs.map +1 -1
- package/fesm2022/ngwr-textarea-testing.mjs +84 -236
- package/fesm2022/ngwr-textarea-testing.mjs.map +1 -1
- package/fesm2022/ngwr-textarea.mjs +388 -264
- package/fesm2022/ngwr-textarea.mjs.map +1 -1
- package/fesm2022/ngwr-theme.mjs +247 -443
- package/fesm2022/ngwr-theme.mjs.map +1 -1
- package/fesm2022/ngwr-tilt-card-testing.mjs +79 -186
- package/fesm2022/ngwr-tilt-card-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tilt-card.mjs +257 -168
- package/fesm2022/ngwr-tilt-card.mjs.map +1 -1
- package/fesm2022/ngwr-timeline.mjs +157 -70
- package/fesm2022/ngwr-timeline.mjs.map +1 -1
- package/fesm2022/ngwr-toast-testing.mjs +59 -99
- package/fesm2022/ngwr-toast-testing.mjs.map +1 -1
- package/fesm2022/ngwr-toast.mjs +769 -691
- package/fesm2022/ngwr-toast.mjs.map +1 -1
- package/fesm2022/ngwr-toolbar.mjs +73 -58
- package/fesm2022/ngwr-toolbar.mjs.map +1 -1
- package/fesm2022/ngwr-tour-testing.mjs +75 -171
- package/fesm2022/ngwr-tour-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tour.mjs +333 -347
- package/fesm2022/ngwr-tour.mjs.map +1 -1
- package/fesm2022/ngwr-transfer-testing.mjs +195 -534
- package/fesm2022/ngwr-transfer-testing.mjs.map +1 -1
- package/fesm2022/ngwr-transfer.mjs +444 -322
- package/fesm2022/ngwr-transfer.mjs.map +1 -1
- package/fesm2022/ngwr-tree-testing.mjs +277 -754
- package/fesm2022/ngwr-tree-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tree.mjs +884 -906
- package/fesm2022/ngwr-tree.mjs.map +1 -1
- package/fesm2022/ngwr-typewriter-testing.mjs +50 -237
- package/fesm2022/ngwr-typewriter-testing.mjs.map +1 -1
- package/fesm2022/ngwr-typewriter.mjs +461 -242
- package/fesm2022/ngwr-typewriter.mjs.map +1 -1
- package/fesm2022/ngwr-typography.mjs +142 -81
- package/fesm2022/ngwr-typography.mjs.map +1 -1
- package/fesm2022/ngwr-utils.mjs +304 -613
- package/fesm2022/ngwr-utils.mjs.map +1 -1
- package/fesm2022/ngwr-validators.mjs +179 -361
- package/fesm2022/ngwr-validators.mjs.map +1 -1
- package/fesm2022/ngwr-version.mjs +17 -47
- package/fesm2022/ngwr-version.mjs.map +1 -1
- package/fesm2022/ngwr-virtual-scroll.mjs +259 -125
- package/fesm2022/ngwr-virtual-scroll.mjs.map +1 -1
- package/fesm2022/ngwr-waves-testing.mjs +34 -125
- package/fesm2022/ngwr-waves-testing.mjs.map +1 -1
- package/fesm2022/ngwr-waves.mjs +816 -373
- package/fesm2022/ngwr-waves.mjs.map +1 -1
- package/fesm2022/ngwr-window-testing.mjs +171 -366
- package/fesm2022/ngwr-window-testing.mjs.map +1 -1
- package/fesm2022/ngwr-window.mjs +1437 -1351
- package/fesm2022/ngwr-window.mjs.map +1 -1
- package/fesm2022/ngwr.mjs +0 -4
- package/i18n/ar.json +0 -1
- package/i18n/cs.json +0 -1
- package/i18n/de.json +0 -1
- package/i18n/en.json +0 -1
- package/i18n/es.json +0 -1
- package/i18n/fr.json +0 -1
- package/i18n/he.json +0 -1
- package/i18n/hi.json +0 -1
- package/i18n/id.json +0 -1
- package/i18n/it.json +0 -1
- package/i18n/ja.json +0 -1
- package/i18n/ko.json +0 -1
- package/i18n/nl.json +0 -1
- package/i18n/pl.json +0 -1
- package/i18n/pt.json +0 -1
- package/i18n/ru.json +0 -1
- package/i18n/sv.json +0 -1
- package/i18n/tr.json +0 -1
- package/i18n/uk.json +0 -1
- package/i18n/vi.json +0 -1
- package/i18n/zh-TW.json +0 -1
- package/i18n/zh.json +0 -1
- package/input-number/styles/_index.scss +33 -35
- package/llms-full.txt +3 -3
- package/loading-bar/styles/_rules.scss +1 -1
- package/package.json +2 -2
- package/segmented/styles/_index.scss +10 -3
- package/theme/_index.scss +84 -0
- package/theme/styles/_contrast.scss +1 -1
- package/theme/styles/_dark.scss +59 -3
- package/types/ngwr-action-sheet-testing.d.ts +174 -200
- package/types/ngwr-action-sheet.d.ts +83 -45
- package/types/ngwr-affix.d.ts +27 -22
- package/types/ngwr-alert.d.ts +93 -59
- package/types/ngwr-anchor.d.ts +52 -35
- package/types/ngwr-aurora.d.ts +53 -35
- package/types/ngwr-avatar.d.ts +97 -81
- package/types/ngwr-back-top.d.ts +36 -23
- package/types/ngwr-badge.d.ts +160 -105
- package/types/ngwr-bar-chart-testing.d.ts +40 -58
- package/types/ngwr-bar-chart.d.ts +86 -60
- package/types/ngwr-blur-text-testing.d.ts +103 -121
- package/types/ngwr-blur-text.d.ts +99 -60
- package/types/ngwr-border-glow-testing.d.ts +155 -173
- package/types/ngwr-border-glow.d.ts +93 -45
- package/types/ngwr-breadcrumbs.d.ts +60 -32
- package/types/ngwr-burger.d.ts +38 -23
- package/types/ngwr-button-testing.d.ts +41 -59
- package/types/ngwr-button.d.ts +213 -163
- package/types/ngwr-calendar-heatmap-testing.d.ts +38 -56
- package/types/ngwr-calendar-heatmap.d.ts +151 -105
- package/types/ngwr-calendar-testing.d.ts +198 -224
- package/types/ngwr-calendar.d.ts +285 -246
- package/types/ngwr-card.d.ts +41 -23
- package/types/ngwr-carousel-testing.d.ts +196 -214
- package/types/ngwr-carousel.d.ts +173 -122
- package/types/ngwr-cascader-testing.d.ts +338 -372
- package/types/ngwr-cascader.d.ts +235 -161
- package/types/ngwr-checkbox-testing.d.ts +45 -63
- package/types/ngwr-checkbox.d.ts +252 -183
- package/types/ngwr-circular-text-testing.d.ts +108 -126
- package/types/ngwr-circular-text.d.ts +53 -41
- package/types/ngwr-click-spark.d.ts +82 -50
- package/types/ngwr-clipboard.d.ts +40 -44
- package/types/ngwr-collapse-testing.d.ts +193 -219
- package/types/ngwr-collapse.d.ts +82 -71
- package/types/ngwr-color-picker-testing.d.ts +211 -237
- package/types/ngwr-color-picker.d.ts +353 -300
- package/types/ngwr-command-palette-testing.d.ts +311 -345
- package/types/ngwr-command-palette.d.ts +257 -197
- package/types/ngwr-compare.d.ts +102 -67
- package/types/ngwr-confetti.d.ts +51 -55
- package/types/ngwr-config.d.ts +44 -71
- package/types/ngwr-context-menu-testing.d.ts +301 -327
- package/types/ngwr-context-menu.d.ts +350 -310
- package/types/ngwr-cookie.d.ts +37 -41
- package/types/ngwr-counter.d.ts +223 -128
- package/types/ngwr-date-adapters-fns.d.ts +40 -59
- package/types/ngwr-date-adapters-luxon.d.ts +61 -72
- package/types/ngwr-date-picker-testing.d.ts +295 -339
- package/types/ngwr-date-picker.d.ts +771 -583
- package/types/ngwr-date.d.ts +229 -258
- package/types/ngwr-decrypt-text-testing.d.ts +140 -158
- package/types/ngwr-decrypt-text.d.ts +104 -62
- package/types/ngwr-density.d.ts +42 -57
- package/types/ngwr-descriptions.d.ts +50 -27
- package/types/ngwr-dialog-testing.d.ts +36 -54
- package/types/ngwr-dialog.d.ts +166 -190
- package/types/ngwr-directives.d.ts +82 -60
- package/types/ngwr-divider.d.ts +78 -62
- package/types/ngwr-donut-chart-testing.d.ts +36 -54
- package/types/ngwr-donut-chart.d.ts +102 -66
- package/types/ngwr-drag-drop.d.ts +139 -106
- package/types/ngwr-drawer-testing.d.ts +141 -159
- package/types/ngwr-drawer.d.ts +374 -316
- package/types/ngwr-dropdown-testing.d.ts +128 -154
- package/types/ngwr-dropdown.d.ts +260 -166
- package/types/ngwr-editor-testing.d.ts +312 -330
- package/types/ngwr-editor.d.ts +435 -344
- package/types/ngwr-empty.d.ts +41 -28
- package/types/ngwr-event-calendar-testing.d.ts +221 -243
- package/types/ngwr-event-calendar.d.ts +340 -298
- package/types/ngwr-falling-text-testing.d.ts +108 -126
- package/types/ngwr-falling-text.d.ts +57 -35
- package/types/ngwr-file-upload-testing.d.ts +134 -151
- package/types/ngwr-file-upload.d.ts +210 -128
- package/types/ngwr-form-testing.d.ts +255 -282
- package/types/ngwr-form.d.ts +324 -306
- package/types/ngwr-fuzzy-text-testing.d.ts +63 -81
- package/types/ngwr-fuzzy-text.d.ts +152 -65
- package/types/ngwr-gauge-testing.d.ts +43 -61
- package/types/ngwr-gauge.d.ts +113 -61
- package/types/ngwr-glitch-text-testing.d.ts +125 -143
- package/types/ngwr-glitch-text.d.ts +47 -24
- package/types/ngwr-gradient-text-testing.d.ts +114 -132
- package/types/ngwr-gradient-text.d.ts +51 -24
- package/types/ngwr-graph-testing.d.ts +89 -115
- package/types/ngwr-graph.d.ts +137 -124
- package/types/ngwr-hotkey.d.ts +85 -75
- package/types/ngwr-i18n-ar.d.ts +2 -5
- package/types/ngwr-i18n-cs.d.ts +2 -5
- package/types/ngwr-i18n-de.d.ts +2 -5
- package/types/ngwr-i18n-en.d.ts +2 -5
- package/types/ngwr-i18n-es.d.ts +2 -5
- package/types/ngwr-i18n-fr.d.ts +2 -5
- package/types/ngwr-i18n-he.d.ts +2 -5
- package/types/ngwr-i18n-hi.d.ts +2 -5
- package/types/ngwr-i18n-id.d.ts +2 -5
- package/types/ngwr-i18n-it.d.ts +2 -5
- package/types/ngwr-i18n-ja.d.ts +2 -5
- package/types/ngwr-i18n-ko.d.ts +2 -5
- package/types/ngwr-i18n-nl.d.ts +2 -5
- package/types/ngwr-i18n-pl.d.ts +2 -5
- package/types/ngwr-i18n-pt.d.ts +2 -5
- package/types/ngwr-i18n-ru.d.ts +2 -5
- package/types/ngwr-i18n-sv.d.ts +2 -5
- package/types/ngwr-i18n-tr.d.ts +2 -5
- package/types/ngwr-i18n-uk.d.ts +2 -5
- package/types/ngwr-i18n-vi.d.ts +2 -5
- package/types/ngwr-i18n-zh-TW.d.ts +2 -5
- package/types/ngwr-i18n-zh.d.ts +2 -5
- package/types/ngwr-i18n.d.ts +202 -246
- package/types/ngwr-icon-adapters-feather.d.ts +2 -11
- package/types/ngwr-icon-adapters-lucide.d.ts +2 -12
- package/types/ngwr-icon.d.ts +62 -84
- package/types/ngwr-image-cropper-testing.d.ts +116 -134
- package/types/ngwr-image-cropper.d.ts +287 -252
- package/types/ngwr-input-number-testing.d.ts +164 -182
- package/types/ngwr-input-number.d.ts +238 -150
- package/types/ngwr-input-otp-testing.d.ts +210 -244
- package/types/ngwr-input-otp.d.ts +175 -123
- package/types/ngwr-input-testing.d.ts +42 -60
- package/types/ngwr-input.d.ts +118 -94
- package/types/ngwr-keyboard.d.ts +14 -12
- package/types/ngwr-knob-testing.d.ts +106 -124
- package/types/ngwr-knob.d.ts +203 -129
- package/types/ngwr-layout.d.ts +57 -40
- package/types/ngwr-lightbox-testing.d.ts +101 -119
- package/types/ngwr-lightbox.d.ts +140 -87
- package/types/ngwr-line-chart-testing.d.ts +51 -69
- package/types/ngwr-line-chart.d.ts +171 -134
- package/types/ngwr-list.d.ts +55 -27
- package/types/ngwr-loading-bar-router.d.ts +2 -12
- package/types/ngwr-loading-bar.d.ts +45 -39
- package/types/ngwr-markdown-testing.d.ts +323 -350
- package/types/ngwr-markdown.d.ts +432 -318
- package/types/ngwr-marquee-testing.d.ts +190 -216
- package/types/ngwr-marquee.d.ts +127 -75
- package/types/ngwr-media.d.ts +25 -39
- package/types/ngwr-mention-testing.d.ts +274 -300
- package/types/ngwr-mention.d.ts +249 -164
- package/types/ngwr-meta.d.ts +93 -108
- package/types/ngwr-meter-group-testing.d.ts +33 -51
- package/types/ngwr-meter-group.d.ts +86 -60
- package/types/ngwr-overlay.d.ts +57 -132
- package/types/ngwr-page-header.d.ts +32 -19
- package/types/ngwr-pagination-testing.d.ts +215 -233
- package/types/ngwr-pagination.d.ts +213 -141
- package/types/ngwr-pipes.d.ts +67 -84
- package/types/ngwr-platform.d.ts +52 -57
- package/types/ngwr-popconfirm-testing.d.ts +181 -199
- package/types/ngwr-popconfirm.d.ts +151 -82
- package/types/ngwr-popover-testing.d.ts +183 -201
- package/types/ngwr-popover.d.ts +291 -207
- package/types/ngwr-progress.d.ts +38 -25
- package/types/ngwr-pull-to-refresh.d.ts +55 -40
- package/types/ngwr-qr.d.ts +79 -37
- package/types/ngwr-radio-testing.d.ts +208 -234
- package/types/ngwr-radio.d.ts +171 -125
- package/types/ngwr-rating-testing.d.ts +218 -244
- package/types/ngwr-rating.d.ts +154 -111
- package/types/ngwr-result.d.ts +85 -41
- package/types/ngwr-rotating-text-testing.d.ts +107 -125
- package/types/ngwr-rotating-text.d.ts +96 -52
- package/types/ngwr-schema-form.d.ts +57 -49
- package/types/ngwr-scroll.d.ts +27 -31
- package/types/ngwr-segmented-testing.d.ts +333 -359
- package/types/ngwr-segmented.d.ts +189 -165
- package/types/ngwr-select-testing.d.ts +128 -154
- package/types/ngwr-select.d.ts +1103 -906
- package/types/ngwr-shiny-text-testing.d.ts +82 -100
- package/types/ngwr-shiny-text.d.ts +83 -36
- package/types/ngwr-sidebar.d.ts +108 -93
- package/types/ngwr-skeleton.d.ts +34 -26
- package/types/ngwr-slider-testing.d.ts +228 -254
- package/types/ngwr-slider.d.ts +244 -186
- package/types/ngwr-sparkline-testing.d.ts +29 -47
- package/types/ngwr-sparkline.d.ts +130 -88
- package/types/ngwr-speed-dial-testing.d.ts +129 -155
- package/types/ngwr-speed-dial.d.ts +92 -57
- package/types/ngwr-spinner.d.ts +30 -23
- package/types/ngwr-splash-cursor-testing.d.ts +42 -60
- package/types/ngwr-splash-cursor.d.ts +129 -61
- package/types/ngwr-split-text-testing.d.ts +119 -137
- package/types/ngwr-split-text.d.ts +120 -71
- package/types/ngwr-splitter-testing.d.ts +114 -132
- package/types/ngwr-splitter.d.ts +85 -55
- package/types/ngwr-spotlight-card-testing.d.ts +177 -203
- package/types/ngwr-spotlight-card.d.ts +50 -32
- package/types/ngwr-squircle.d.ts +112 -70
- package/types/ngwr-star-border-testing.d.ts +74 -92
- package/types/ngwr-star-border.d.ts +42 -20
- package/types/ngwr-statistic.d.ts +210 -130
- package/types/ngwr-stepper-testing.d.ts +258 -284
- package/types/ngwr-stepper.d.ts +112 -75
- package/types/ngwr-storage.d.ts +96 -118
- package/types/ngwr-switch-testing.d.ts +26 -44
- package/types/ngwr-switch.d.ts +99 -62
- package/types/ngwr-table-testing.d.ts +291 -333
- package/types/ngwr-table.d.ts +930 -707
- package/types/ngwr-tabs-router.d.ts +21 -24
- package/types/ngwr-tabs-testing.d.ts +354 -380
- package/types/ngwr-tabs.d.ts +169 -155
- package/types/ngwr-textarea-testing.d.ts +123 -141
- package/types/ngwr-textarea.d.ts +166 -105
- package/types/ngwr-theme.d.ts +81 -163
- package/types/ngwr-tilt-card-testing.d.ts +94 -112
- package/types/ngwr-tilt-card.d.ts +64 -35
- package/types/ngwr-timeline.d.ts +36 -19
- package/types/ngwr-toast-testing.d.ts +37 -55
- package/types/ngwr-toast.d.ts +165 -209
- package/types/ngwr-toolbar.d.ts +17 -14
- package/types/ngwr-tour-testing.d.ts +84 -102
- package/types/ngwr-tour.d.ts +142 -144
- package/types/ngwr-transfer-testing.d.ts +293 -328
- package/types/ngwr-transfer.d.ts +228 -159
- package/types/ngwr-tree-testing.d.ts +428 -454
- package/types/ngwr-tree.d.ts +407 -296
- package/types/ngwr-typewriter-testing.d.ts +125 -143
- package/types/ngwr-typewriter.d.ts +137 -63
- package/types/ngwr-typography.d.ts +49 -27
- package/types/ngwr-utils.d.ts +100 -107
- package/types/ngwr-validators.d.ts +94 -104
- package/types/ngwr-version.d.ts +3 -14
- package/types/ngwr-virtual-scroll.d.ts +86 -58
- package/types/ngwr-waves-testing.d.ts +61 -79
- package/types/ngwr-waves.d.ts +116 -63
- package/types/ngwr-window-testing.d.ts +178 -204
- package/types/ngwr-window.d.ts +299 -325
- package/types/ngwr.d.ts +1 -2
- package/fesm2022/ngwr.mjs.map +0 -1
|
@@ -1,120 +1,111 @@
|
|
|
1
|
-
import { coerceBooleanProperty } from
|
|
2
|
-
import { isPlatformBrowser } from
|
|
3
|
-
import * as i0 from
|
|
4
|
-
import {
|
|
5
|
-
import { WrPlatform } from
|
|
6
|
-
import { numAttr } from
|
|
7
|
-
|
|
1
|
+
import { coerceBooleanProperty } from "@angular/cdk/coercion";
|
|
2
|
+
import { isPlatformBrowser } from "@angular/common";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import { Component, NgZone, PLATFORM_ID, ViewEncapsulation, effect, inject, input, viewChild } from "@angular/core";
|
|
5
|
+
import { WrPlatform } from "ngwr/platform";
|
|
6
|
+
import { numAttr } from "ngwr/utils";
|
|
8
7
|
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
8
|
+
* @license
|
|
9
|
+
*
|
|
10
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
11
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
12
|
+
*
|
|
13
|
+
* WebGL fluid simulation behind `<wr-splash-cursor>`. Port of the engine
|
|
14
|
+
* used by reactbits.dev's SplashCursor (itself based on Pavel Dobryakov's
|
|
15
|
+
* WebGL-Fluid-Simulation, MIT).
|
|
16
|
+
*
|
|
17
|
+
* Framework-free on purpose: `createFluidSimulation(canvas, config)` boots
|
|
18
|
+
* the sim and returns a teardown, or `null` when WebGL isn't available.
|
|
19
|
+
*/
|
|
21
20
|
function createFluidSimulation(canvas, config) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
this.activeProgram = program;
|
|
111
|
-
}
|
|
112
|
-
bind() {
|
|
113
|
-
gl.useProgram(this.activeProgram);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
// Shaders
|
|
117
|
-
const baseVertexShader = compile(gl.VERTEX_SHADER, `
|
|
21
|
+
const ctx = getWebGLContext(canvas);
|
|
22
|
+
if (!ctx) return null;
|
|
23
|
+
const { gl, ext } = ctx;
|
|
24
|
+
let dyeResolution = config.dyeResolution;
|
|
25
|
+
let shading = config.shading;
|
|
26
|
+
if (!ext.supportLinearFiltering) {
|
|
27
|
+
dyeResolution = 256;
|
|
28
|
+
shading = false;
|
|
29
|
+
}
|
|
30
|
+
let active = true;
|
|
31
|
+
let rafId = 0;
|
|
32
|
+
const pointer = {
|
|
33
|
+
texcoordX: 0,
|
|
34
|
+
texcoordY: 0,
|
|
35
|
+
prevTexcoordX: 0,
|
|
36
|
+
prevTexcoordY: 0,
|
|
37
|
+
deltaX: 0,
|
|
38
|
+
deltaY: 0,
|
|
39
|
+
moved: false,
|
|
40
|
+
color: {
|
|
41
|
+
r: 0,
|
|
42
|
+
g: 0,
|
|
43
|
+
b: 0
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
function compile(type, source, keywords) {
|
|
47
|
+
const prefixed = keywords ? keywords.map((k) => `#define ${k}\n`).join("") + source : source;
|
|
48
|
+
const shader = gl.createShader(type);
|
|
49
|
+
gl.shaderSource(shader, prefixed);
|
|
50
|
+
gl.compileShader(shader);
|
|
51
|
+
if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) console.error("wr-splash-cursor shader error:", gl.getShaderInfoLog(shader));
|
|
52
|
+
return shader;
|
|
53
|
+
}
|
|
54
|
+
function link(vertex, fragment) {
|
|
55
|
+
const program = gl.createProgram();
|
|
56
|
+
gl.attachShader(program, vertex);
|
|
57
|
+
gl.attachShader(program, fragment);
|
|
58
|
+
gl.linkProgram(program);
|
|
59
|
+
if (!gl.getProgramParameter(program, gl.LINK_STATUS)) console.error("wr-splash-cursor program error:", gl.getProgramInfoLog(program));
|
|
60
|
+
return program;
|
|
61
|
+
}
|
|
62
|
+
function uniformsOf(program) {
|
|
63
|
+
const out = {};
|
|
64
|
+
const count = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS);
|
|
65
|
+
for (let i = 0; i < count; i++) {
|
|
66
|
+
const name = gl.getActiveUniform(program, i).name;
|
|
67
|
+
out[name] = gl.getUniformLocation(program, name);
|
|
68
|
+
}
|
|
69
|
+
return out;
|
|
70
|
+
}
|
|
71
|
+
class ShaderProgram {
|
|
72
|
+
program;
|
|
73
|
+
uniforms;
|
|
74
|
+
constructor(vertex, fragment) {
|
|
75
|
+
this.program = link(vertex, fragment);
|
|
76
|
+
this.uniforms = uniformsOf(this.program);
|
|
77
|
+
}
|
|
78
|
+
bind() {
|
|
79
|
+
gl.useProgram(this.program);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
class DisplayMaterial {
|
|
83
|
+
vertex;
|
|
84
|
+
fragmentSource;
|
|
85
|
+
programs = /* @__PURE__ */ new Map();
|
|
86
|
+
activeProgram = null;
|
|
87
|
+
uniforms = {};
|
|
88
|
+
constructor(vertex, fragmentSource) {
|
|
89
|
+
this.vertex = vertex;
|
|
90
|
+
this.fragmentSource = fragmentSource;
|
|
91
|
+
}
|
|
92
|
+
setKeywords(keywords) {
|
|
93
|
+
let hash = 0;
|
|
94
|
+
for (const k of keywords) hash += hashCode(k);
|
|
95
|
+
let program = this.programs.get(hash);
|
|
96
|
+
if (!program) {
|
|
97
|
+
program = link(this.vertex, compile(gl.FRAGMENT_SHADER, this.fragmentSource, keywords));
|
|
98
|
+
this.programs.set(hash, program);
|
|
99
|
+
}
|
|
100
|
+
if (program === this.activeProgram) return;
|
|
101
|
+
this.uniforms = uniformsOf(program);
|
|
102
|
+
this.activeProgram = program;
|
|
103
|
+
}
|
|
104
|
+
bind() {
|
|
105
|
+
gl.useProgram(this.activeProgram);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
const baseVertexShader = compile(gl.VERTEX_SHADER, `
|
|
118
109
|
precision highp float;
|
|
119
110
|
attribute vec2 aPosition;
|
|
120
111
|
varying vec2 vUv;
|
|
@@ -133,7 +124,7 @@ function createFluidSimulation(canvas, config) {
|
|
|
133
124
|
gl_Position = vec4(aPosition, 0.0, 1.0);
|
|
134
125
|
}
|
|
135
126
|
`);
|
|
136
|
-
|
|
127
|
+
const copyShader = compile(gl.FRAGMENT_SHADER, `
|
|
137
128
|
precision mediump float;
|
|
138
129
|
precision mediump sampler2D;
|
|
139
130
|
varying highp vec2 vUv;
|
|
@@ -143,7 +134,7 @@ function createFluidSimulation(canvas, config) {
|
|
|
143
134
|
gl_FragColor = texture2D(uTexture, vUv);
|
|
144
135
|
}
|
|
145
136
|
`);
|
|
146
|
-
|
|
137
|
+
const clearShader = compile(gl.FRAGMENT_SHADER, `
|
|
147
138
|
precision mediump float;
|
|
148
139
|
precision mediump sampler2D;
|
|
149
140
|
varying highp vec2 vUv;
|
|
@@ -154,7 +145,7 @@ function createFluidSimulation(canvas, config) {
|
|
|
154
145
|
gl_FragColor = value * texture2D(uTexture, vUv);
|
|
155
146
|
}
|
|
156
147
|
`);
|
|
157
|
-
|
|
148
|
+
const displayShaderSource = `
|
|
158
149
|
precision highp float;
|
|
159
150
|
precision highp sampler2D;
|
|
160
151
|
varying vec2 vUv;
|
|
@@ -187,7 +178,7 @@ function createFluidSimulation(canvas, config) {
|
|
|
187
178
|
gl_FragColor = vec4(c, a);
|
|
188
179
|
}
|
|
189
180
|
`;
|
|
190
|
-
|
|
181
|
+
const splatShader = compile(gl.FRAGMENT_SHADER, `
|
|
191
182
|
precision highp float;
|
|
192
183
|
precision highp sampler2D;
|
|
193
184
|
varying vec2 vUv;
|
|
@@ -205,7 +196,7 @@ function createFluidSimulation(canvas, config) {
|
|
|
205
196
|
gl_FragColor = vec4(base + splat, 1.0);
|
|
206
197
|
}
|
|
207
198
|
`);
|
|
208
|
-
|
|
199
|
+
const advectionShader = compile(gl.FRAGMENT_SHADER, `
|
|
209
200
|
precision highp float;
|
|
210
201
|
precision highp sampler2D;
|
|
211
202
|
varying vec2 vUv;
|
|
@@ -240,8 +231,8 @@ function createFluidSimulation(canvas, config) {
|
|
|
240
231
|
float decay = 1.0 + dissipation * dt;
|
|
241
232
|
gl_FragColor = result / decay;
|
|
242
233
|
}
|
|
243
|
-
`, ext.supportLinearFiltering ?
|
|
244
|
-
|
|
234
|
+
`, ext.supportLinearFiltering ? void 0 : ["MANUAL_FILTERING"]);
|
|
235
|
+
const divergenceShader = compile(gl.FRAGMENT_SHADER, `
|
|
245
236
|
precision mediump float;
|
|
246
237
|
precision mediump sampler2D;
|
|
247
238
|
varying highp vec2 vUv;
|
|
@@ -267,7 +258,7 @@ function createFluidSimulation(canvas, config) {
|
|
|
267
258
|
gl_FragColor = vec4(div, 0.0, 0.0, 1.0);
|
|
268
259
|
}
|
|
269
260
|
`);
|
|
270
|
-
|
|
261
|
+
const curlShader = compile(gl.FRAGMENT_SHADER, `
|
|
271
262
|
precision mediump float;
|
|
272
263
|
precision mediump sampler2D;
|
|
273
264
|
varying highp vec2 vUv;
|
|
@@ -286,7 +277,7 @@ function createFluidSimulation(canvas, config) {
|
|
|
286
277
|
gl_FragColor = vec4(0.5 * vorticity, 0.0, 0.0, 1.0);
|
|
287
278
|
}
|
|
288
279
|
`);
|
|
289
|
-
|
|
280
|
+
const vorticityShader = compile(gl.FRAGMENT_SHADER, `
|
|
290
281
|
precision highp float;
|
|
291
282
|
precision highp sampler2D;
|
|
292
283
|
varying vec2 vUv;
|
|
@@ -317,7 +308,7 @@ function createFluidSimulation(canvas, config) {
|
|
|
317
308
|
gl_FragColor = vec4(velocity, 0.0, 1.0);
|
|
318
309
|
}
|
|
319
310
|
`);
|
|
320
|
-
|
|
311
|
+
const pressureShader = compile(gl.FRAGMENT_SHADER, `
|
|
321
312
|
precision mediump float;
|
|
322
313
|
precision mediump sampler2D;
|
|
323
314
|
varying highp vec2 vUv;
|
|
@@ -339,7 +330,7 @@ function createFluidSimulation(canvas, config) {
|
|
|
339
330
|
gl_FragColor = vec4(pressure, 0.0, 0.0, 1.0);
|
|
340
331
|
}
|
|
341
332
|
`);
|
|
342
|
-
|
|
333
|
+
const gradientSubtractShader = compile(gl.FRAGMENT_SHADER, `
|
|
343
334
|
precision mediump float;
|
|
344
335
|
precision mediump sampler2D;
|
|
345
336
|
varying highp vec2 vUv;
|
|
@@ -360,611 +351,875 @@ function createFluidSimulation(canvas, config) {
|
|
|
360
351
|
gl_FragColor = vec4(velocity, 0.0, 1.0);
|
|
361
352
|
}
|
|
362
353
|
`);
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
354
|
+
gl.bindBuffer(gl.ARRAY_BUFFER, gl.createBuffer());
|
|
355
|
+
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([
|
|
356
|
+
-1,
|
|
357
|
+
-1,
|
|
358
|
+
-1,
|
|
359
|
+
1,
|
|
360
|
+
1,
|
|
361
|
+
1,
|
|
362
|
+
1,
|
|
363
|
+
-1
|
|
364
|
+
]), gl.STATIC_DRAW);
|
|
365
|
+
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, gl.createBuffer());
|
|
366
|
+
gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array([
|
|
367
|
+
0,
|
|
368
|
+
1,
|
|
369
|
+
2,
|
|
370
|
+
0,
|
|
371
|
+
2,
|
|
372
|
+
3
|
|
373
|
+
]), gl.STATIC_DRAW);
|
|
374
|
+
gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);
|
|
375
|
+
gl.enableVertexAttribArray(0);
|
|
376
|
+
function blit(target, clear = false) {
|
|
377
|
+
if (target === null) {
|
|
378
|
+
gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);
|
|
379
|
+
gl.bindFramebuffer(gl.FRAMEBUFFER, null);
|
|
380
|
+
} else {
|
|
381
|
+
gl.viewport(0, 0, target.width, target.height);
|
|
382
|
+
gl.bindFramebuffer(gl.FRAMEBUFFER, target.fbo);
|
|
383
|
+
}
|
|
384
|
+
if (clear) {
|
|
385
|
+
gl.clearColor(0, 0, 0, 1);
|
|
386
|
+
gl.clear(gl.COLOR_BUFFER_BIT);
|
|
387
|
+
}
|
|
388
|
+
gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0);
|
|
389
|
+
}
|
|
390
|
+
function createFBO(w, h, internalFormat, format, type, param) {
|
|
391
|
+
gl.activeTexture(gl.TEXTURE0);
|
|
392
|
+
const texture = gl.createTexture();
|
|
393
|
+
gl.bindTexture(gl.TEXTURE_2D, texture);
|
|
394
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, param);
|
|
395
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, param);
|
|
396
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
|
|
397
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
|
|
398
|
+
gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat, w, h, 0, format, type, null);
|
|
399
|
+
const fbo = gl.createFramebuffer();
|
|
400
|
+
gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
|
|
401
|
+
gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
|
|
402
|
+
gl.viewport(0, 0, w, h);
|
|
403
|
+
gl.clear(gl.COLOR_BUFFER_BIT);
|
|
404
|
+
return {
|
|
405
|
+
texture,
|
|
406
|
+
fbo,
|
|
407
|
+
width: w,
|
|
408
|
+
height: h,
|
|
409
|
+
texelSizeX: 1 / w,
|
|
410
|
+
texelSizeY: 1 / h,
|
|
411
|
+
attach(id) {
|
|
412
|
+
gl.activeTexture(gl.TEXTURE0 + id);
|
|
413
|
+
gl.bindTexture(gl.TEXTURE_2D, texture);
|
|
414
|
+
return id;
|
|
415
|
+
}
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
function createDoubleFBO(w, h, internalFormat, format, type, param) {
|
|
419
|
+
let fbo1 = createFBO(w, h, internalFormat, format, type, param);
|
|
420
|
+
let fbo2 = createFBO(w, h, internalFormat, format, type, param);
|
|
421
|
+
return {
|
|
422
|
+
width: w,
|
|
423
|
+
height: h,
|
|
424
|
+
texelSizeX: fbo1.texelSizeX,
|
|
425
|
+
texelSizeY: fbo1.texelSizeY,
|
|
426
|
+
get read() {
|
|
427
|
+
return fbo1;
|
|
428
|
+
},
|
|
429
|
+
set read(value) {
|
|
430
|
+
fbo1 = value;
|
|
431
|
+
},
|
|
432
|
+
get write() {
|
|
433
|
+
return fbo2;
|
|
434
|
+
},
|
|
435
|
+
set write(value) {
|
|
436
|
+
fbo2 = value;
|
|
437
|
+
},
|
|
438
|
+
swap() {
|
|
439
|
+
const temp = fbo1;
|
|
440
|
+
fbo1 = fbo2;
|
|
441
|
+
fbo2 = temp;
|
|
442
|
+
}
|
|
443
|
+
};
|
|
444
|
+
}
|
|
445
|
+
function resizeFBO(target, w, h, internalFormat, format, type, param) {
|
|
446
|
+
const newFBO = createFBO(w, h, internalFormat, format, type, param);
|
|
447
|
+
copyProgram.bind();
|
|
448
|
+
gl.uniform1i(copyProgram.uniforms["uTexture"], target.attach(0));
|
|
449
|
+
blit(newFBO);
|
|
450
|
+
return newFBO;
|
|
451
|
+
}
|
|
452
|
+
function resizeDoubleFBO(target, w, h, internalFormat, format, type, param) {
|
|
453
|
+
if (target.width === w && target.height === h) return target;
|
|
454
|
+
target.read = resizeFBO(target.read, w, h, internalFormat, format, type, param);
|
|
455
|
+
target.write = createFBO(w, h, internalFormat, format, type, param);
|
|
456
|
+
target.width = w;
|
|
457
|
+
target.height = h;
|
|
458
|
+
target.texelSizeX = 1 / w;
|
|
459
|
+
target.texelSizeY = 1 / h;
|
|
460
|
+
return target;
|
|
461
|
+
}
|
|
462
|
+
const copyProgram = new ShaderProgram(baseVertexShader, copyShader);
|
|
463
|
+
const clearProgram = new ShaderProgram(baseVertexShader, clearShader);
|
|
464
|
+
const splatProgram = new ShaderProgram(baseVertexShader, splatShader);
|
|
465
|
+
const advectionProgram = new ShaderProgram(baseVertexShader, advectionShader);
|
|
466
|
+
const divergenceProgram = new ShaderProgram(baseVertexShader, divergenceShader);
|
|
467
|
+
const curlProgram = new ShaderProgram(baseVertexShader, curlShader);
|
|
468
|
+
const vorticityProgram = new ShaderProgram(baseVertexShader, vorticityShader);
|
|
469
|
+
const pressureProgram = new ShaderProgram(baseVertexShader, pressureShader);
|
|
470
|
+
const gradientSubtractProgram = new ShaderProgram(baseVertexShader, gradientSubtractShader);
|
|
471
|
+
const displayMaterial = new DisplayMaterial(baseVertexShader, displayShaderSource);
|
|
472
|
+
let dye;
|
|
473
|
+
let velocity;
|
|
474
|
+
let divergence;
|
|
475
|
+
let curl;
|
|
476
|
+
let pressure;
|
|
477
|
+
function initFramebuffers() {
|
|
478
|
+
const simRes = getResolution(config.simResolution);
|
|
479
|
+
const dyeRes = getResolution(dyeResolution);
|
|
480
|
+
const texType = ext.halfFloatTexType;
|
|
481
|
+
const rgba = ext.formatRGBA;
|
|
482
|
+
const rg = ext.formatRG;
|
|
483
|
+
const r = ext.formatR;
|
|
484
|
+
const filtering = ext.supportLinearFiltering ? gl.LINEAR : gl.NEAREST;
|
|
485
|
+
gl.disable(gl.BLEND);
|
|
486
|
+
dye = dye ? resizeDoubleFBO(dye, dyeRes.width, dyeRes.height, rgba.internalFormat, rgba.format, texType, filtering) : createDoubleFBO(dyeRes.width, dyeRes.height, rgba.internalFormat, rgba.format, texType, filtering);
|
|
487
|
+
velocity = velocity ? resizeDoubleFBO(velocity, simRes.width, simRes.height, rg.internalFormat, rg.format, texType, filtering) : createDoubleFBO(simRes.width, simRes.height, rg.internalFormat, rg.format, texType, filtering);
|
|
488
|
+
divergence = createFBO(simRes.width, simRes.height, r.internalFormat, r.format, texType, gl.NEAREST);
|
|
489
|
+
curl = createFBO(simRes.width, simRes.height, r.internalFormat, r.format, texType, gl.NEAREST);
|
|
490
|
+
pressure = createDoubleFBO(simRes.width, simRes.height, r.internalFormat, r.format, texType, gl.NEAREST);
|
|
491
|
+
}
|
|
492
|
+
displayMaterial.setKeywords(shading ? ["SHADING"] : []);
|
|
493
|
+
initFramebuffers();
|
|
494
|
+
let lastUpdateTime = Date.now();
|
|
495
|
+
let colorUpdateTimer = 0;
|
|
496
|
+
function updateFrame() {
|
|
497
|
+
if (!active) return;
|
|
498
|
+
const dt = calcDeltaTime();
|
|
499
|
+
if (resizeCanvas()) initFramebuffers();
|
|
500
|
+
updateColors(dt);
|
|
501
|
+
applyInputs();
|
|
502
|
+
step(dt);
|
|
503
|
+
render();
|
|
504
|
+
rafId = requestAnimationFrame(updateFrame);
|
|
505
|
+
}
|
|
506
|
+
function calcDeltaTime() {
|
|
507
|
+
const now = Date.now();
|
|
508
|
+
const dt = Math.min((now - lastUpdateTime) / 1e3, .016666);
|
|
509
|
+
lastUpdateTime = now;
|
|
510
|
+
return dt;
|
|
511
|
+
}
|
|
512
|
+
function resizeCanvas() {
|
|
513
|
+
const width = scaleByPixelRatio(canvas.clientWidth);
|
|
514
|
+
const height = scaleByPixelRatio(canvas.clientHeight);
|
|
515
|
+
if (canvas.width !== width || canvas.height !== height) {
|
|
516
|
+
canvas.width = width;
|
|
517
|
+
canvas.height = height;
|
|
518
|
+
return true;
|
|
519
|
+
}
|
|
520
|
+
return false;
|
|
521
|
+
}
|
|
522
|
+
function updateColors(dt) {
|
|
523
|
+
colorUpdateTimer += dt * config.colorUpdateSpeed;
|
|
524
|
+
if (colorUpdateTimer >= 1) {
|
|
525
|
+
colorUpdateTimer = wrap(colorUpdateTimer, 0, 1);
|
|
526
|
+
pointer.color = generateColor();
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
function applyInputs() {
|
|
530
|
+
if (pointer.moved) {
|
|
531
|
+
pointer.moved = false;
|
|
532
|
+
splatPointer();
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
function step(dt) {
|
|
536
|
+
gl.disable(gl.BLEND);
|
|
537
|
+
curlProgram.bind();
|
|
538
|
+
gl.uniform2f(curlProgram.uniforms["texelSize"], velocity.texelSizeX, velocity.texelSizeY);
|
|
539
|
+
gl.uniform1i(curlProgram.uniforms["uVelocity"], velocity.read.attach(0));
|
|
540
|
+
blit(curl);
|
|
541
|
+
vorticityProgram.bind();
|
|
542
|
+
gl.uniform2f(vorticityProgram.uniforms["texelSize"], velocity.texelSizeX, velocity.texelSizeY);
|
|
543
|
+
gl.uniform1i(vorticityProgram.uniforms["uVelocity"], velocity.read.attach(0));
|
|
544
|
+
gl.uniform1i(vorticityProgram.uniforms["uCurl"], curl.attach(1));
|
|
545
|
+
gl.uniform1f(vorticityProgram.uniforms["curl"], config.curl);
|
|
546
|
+
gl.uniform1f(vorticityProgram.uniforms["dt"], dt);
|
|
547
|
+
blit(velocity.write);
|
|
548
|
+
velocity.swap();
|
|
549
|
+
divergenceProgram.bind();
|
|
550
|
+
gl.uniform2f(divergenceProgram.uniforms["texelSize"], velocity.texelSizeX, velocity.texelSizeY);
|
|
551
|
+
gl.uniform1i(divergenceProgram.uniforms["uVelocity"], velocity.read.attach(0));
|
|
552
|
+
blit(divergence);
|
|
553
|
+
clearProgram.bind();
|
|
554
|
+
gl.uniform1i(clearProgram.uniforms["uTexture"], pressure.read.attach(0));
|
|
555
|
+
gl.uniform1f(clearProgram.uniforms["value"], config.pressure);
|
|
556
|
+
blit(pressure.write);
|
|
557
|
+
pressure.swap();
|
|
558
|
+
pressureProgram.bind();
|
|
559
|
+
gl.uniform2f(pressureProgram.uniforms["texelSize"], velocity.texelSizeX, velocity.texelSizeY);
|
|
560
|
+
gl.uniform1i(pressureProgram.uniforms["uDivergence"], divergence.attach(0));
|
|
561
|
+
for (let i = 0; i < config.pressureIterations; i++) {
|
|
562
|
+
gl.uniform1i(pressureProgram.uniforms["uPressure"], pressure.read.attach(1));
|
|
563
|
+
blit(pressure.write);
|
|
564
|
+
pressure.swap();
|
|
565
|
+
}
|
|
566
|
+
gradientSubtractProgram.bind();
|
|
567
|
+
gl.uniform2f(gradientSubtractProgram.uniforms["texelSize"], velocity.texelSizeX, velocity.texelSizeY);
|
|
568
|
+
gl.uniform1i(gradientSubtractProgram.uniforms["uPressure"], pressure.read.attach(0));
|
|
569
|
+
gl.uniform1i(gradientSubtractProgram.uniforms["uVelocity"], velocity.read.attach(1));
|
|
570
|
+
blit(velocity.write);
|
|
571
|
+
velocity.swap();
|
|
572
|
+
advectionProgram.bind();
|
|
573
|
+
gl.uniform2f(advectionProgram.uniforms["texelSize"], velocity.texelSizeX, velocity.texelSizeY);
|
|
574
|
+
if (!ext.supportLinearFiltering) gl.uniform2f(advectionProgram.uniforms["dyeTexelSize"], velocity.texelSizeX, velocity.texelSizeY);
|
|
575
|
+
const velocityId = velocity.read.attach(0);
|
|
576
|
+
gl.uniform1i(advectionProgram.uniforms["uVelocity"], velocityId);
|
|
577
|
+
gl.uniform1i(advectionProgram.uniforms["uSource"], velocityId);
|
|
578
|
+
gl.uniform1f(advectionProgram.uniforms["dt"], dt);
|
|
579
|
+
gl.uniform1f(advectionProgram.uniforms["dissipation"], config.velocityDissipation);
|
|
580
|
+
blit(velocity.write);
|
|
581
|
+
velocity.swap();
|
|
582
|
+
if (!ext.supportLinearFiltering) gl.uniform2f(advectionProgram.uniforms["dyeTexelSize"], dye.texelSizeX, dye.texelSizeY);
|
|
583
|
+
gl.uniform1i(advectionProgram.uniforms["uVelocity"], velocity.read.attach(0));
|
|
584
|
+
gl.uniform1i(advectionProgram.uniforms["uSource"], dye.read.attach(1));
|
|
585
|
+
gl.uniform1f(advectionProgram.uniforms["dissipation"], config.densityDissipation);
|
|
586
|
+
blit(dye.write);
|
|
587
|
+
dye.swap();
|
|
588
|
+
}
|
|
589
|
+
function render() {
|
|
590
|
+
gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
|
|
591
|
+
gl.enable(gl.BLEND);
|
|
592
|
+
displayMaterial.bind();
|
|
593
|
+
if (shading) gl.uniform2f(displayMaterial.uniforms["texelSize"], 1 / gl.drawingBufferWidth, 1 / gl.drawingBufferHeight);
|
|
594
|
+
gl.uniform1i(displayMaterial.uniforms["uTexture"], dye.read.attach(0));
|
|
595
|
+
blit(null);
|
|
596
|
+
}
|
|
597
|
+
function splatPointer() {
|
|
598
|
+
const dx = pointer.deltaX * config.splatForce;
|
|
599
|
+
const dy = pointer.deltaY * config.splatForce;
|
|
600
|
+
splat(pointer.texcoordX, pointer.texcoordY, dx, dy, pointer.color);
|
|
601
|
+
}
|
|
602
|
+
function clickSplat() {
|
|
603
|
+
const color = generateColor();
|
|
604
|
+
color.r *= 10;
|
|
605
|
+
color.g *= 10;
|
|
606
|
+
color.b *= 10;
|
|
607
|
+
const dx = 10 * (Math.random() - .5);
|
|
608
|
+
const dy = 30 * (Math.random() - .5);
|
|
609
|
+
splat(pointer.texcoordX, pointer.texcoordY, dx, dy, color);
|
|
610
|
+
}
|
|
611
|
+
function splat(x, y, dx, dy, color) {
|
|
612
|
+
splatProgram.bind();
|
|
613
|
+
gl.uniform1i(splatProgram.uniforms["uTarget"], velocity.read.attach(0));
|
|
614
|
+
gl.uniform1f(splatProgram.uniforms["aspectRatio"], canvas.width / canvas.height);
|
|
615
|
+
gl.uniform2f(splatProgram.uniforms["point"], x, y);
|
|
616
|
+
gl.uniform3f(splatProgram.uniforms["color"], dx, dy, 0);
|
|
617
|
+
gl.uniform1f(splatProgram.uniforms["radius"], correctRadius(config.splatRadius / 100));
|
|
618
|
+
blit(velocity.write);
|
|
619
|
+
velocity.swap();
|
|
620
|
+
gl.uniform1i(splatProgram.uniforms["uTarget"], dye.read.attach(0));
|
|
621
|
+
gl.uniform3f(splatProgram.uniforms["color"], color.r, color.g, color.b);
|
|
622
|
+
blit(dye.write);
|
|
623
|
+
dye.swap();
|
|
624
|
+
}
|
|
625
|
+
function correctRadius(radius) {
|
|
626
|
+
const aspectRatio = canvas.width / canvas.height;
|
|
627
|
+
return aspectRatio > 1 ? radius * aspectRatio : radius;
|
|
628
|
+
}
|
|
629
|
+
function pointerDown(posX, posY) {
|
|
630
|
+
pointer.moved = false;
|
|
631
|
+
pointer.texcoordX = posX / canvas.width;
|
|
632
|
+
pointer.texcoordY = 1 - posY / canvas.height;
|
|
633
|
+
pointer.prevTexcoordX = pointer.texcoordX;
|
|
634
|
+
pointer.prevTexcoordY = pointer.texcoordY;
|
|
635
|
+
pointer.deltaX = 0;
|
|
636
|
+
pointer.deltaY = 0;
|
|
637
|
+
pointer.color = generateColor();
|
|
638
|
+
}
|
|
639
|
+
function pointerMove(posX, posY, color) {
|
|
640
|
+
pointer.prevTexcoordX = pointer.texcoordX;
|
|
641
|
+
pointer.prevTexcoordY = pointer.texcoordY;
|
|
642
|
+
pointer.texcoordX = posX / canvas.width;
|
|
643
|
+
pointer.texcoordY = 1 - posY / canvas.height;
|
|
644
|
+
pointer.deltaX = correctDeltaX(pointer.texcoordX - pointer.prevTexcoordX);
|
|
645
|
+
pointer.deltaY = correctDeltaY(pointer.texcoordY - pointer.prevTexcoordY);
|
|
646
|
+
pointer.moved = Math.abs(pointer.deltaX) > 0 || Math.abs(pointer.deltaY) > 0;
|
|
647
|
+
pointer.color = color;
|
|
648
|
+
}
|
|
649
|
+
function correctDeltaX(delta) {
|
|
650
|
+
const aspectRatio = canvas.width / canvas.height;
|
|
651
|
+
return aspectRatio < 1 ? delta * aspectRatio : delta;
|
|
652
|
+
}
|
|
653
|
+
function correctDeltaY(delta) {
|
|
654
|
+
const aspectRatio = canvas.width / canvas.height;
|
|
655
|
+
return aspectRatio > 1 ? delta / aspectRatio : delta;
|
|
656
|
+
}
|
|
657
|
+
function hexToRGB(hex) {
|
|
658
|
+
let val = hex.replace("#", "");
|
|
659
|
+
if (val.length === 3) val = val[0] + val[0] + val[1] + val[1] + val[2] + val[2];
|
|
660
|
+
return {
|
|
661
|
+
r: Number.parseInt(val.slice(0, 2), 16) / 255 * .15,
|
|
662
|
+
g: Number.parseInt(val.slice(2, 4), 16) / 255 * .15,
|
|
663
|
+
b: Number.parseInt(val.slice(4, 6), 16) / 255 * .15
|
|
664
|
+
};
|
|
665
|
+
}
|
|
666
|
+
function generateColor() {
|
|
667
|
+
if (!config.rainbow) return hexToRGB(config.color);
|
|
668
|
+
const c = hsvToRgb(Math.random(), 1, 1);
|
|
669
|
+
c.r *= .15;
|
|
670
|
+
c.g *= .15;
|
|
671
|
+
c.b *= .15;
|
|
672
|
+
return c;
|
|
673
|
+
}
|
|
674
|
+
function hsvToRgb(h, s, v) {
|
|
675
|
+
const i = Math.floor(h * 6);
|
|
676
|
+
const f = h * 6 - i;
|
|
677
|
+
const p = v * (1 - s);
|
|
678
|
+
const q = v * (1 - f * s);
|
|
679
|
+
const t = v * (1 - (1 - f) * s);
|
|
680
|
+
switch (i % 6) {
|
|
681
|
+
case 0: return {
|
|
682
|
+
r: v,
|
|
683
|
+
g: t,
|
|
684
|
+
b: p
|
|
685
|
+
};
|
|
686
|
+
case 1: return {
|
|
687
|
+
r: q,
|
|
688
|
+
g: v,
|
|
689
|
+
b: p
|
|
690
|
+
};
|
|
691
|
+
case 2: return {
|
|
692
|
+
r: p,
|
|
693
|
+
g: v,
|
|
694
|
+
b: t
|
|
695
|
+
};
|
|
696
|
+
case 3: return {
|
|
697
|
+
r: p,
|
|
698
|
+
g: q,
|
|
699
|
+
b: v
|
|
700
|
+
};
|
|
701
|
+
case 4: return {
|
|
702
|
+
r: t,
|
|
703
|
+
g: p,
|
|
704
|
+
b: v
|
|
705
|
+
};
|
|
706
|
+
default: return {
|
|
707
|
+
r: v,
|
|
708
|
+
g: p,
|
|
709
|
+
b: q
|
|
710
|
+
};
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
function wrap(value, min, max) {
|
|
714
|
+
const range = max - min;
|
|
715
|
+
if (range === 0) return min;
|
|
716
|
+
return (value - min) % range + min;
|
|
717
|
+
}
|
|
718
|
+
function getResolution(resolution) {
|
|
719
|
+
let aspectRatio = gl.drawingBufferWidth / gl.drawingBufferHeight;
|
|
720
|
+
if (aspectRatio < 1) aspectRatio = 1 / aspectRatio;
|
|
721
|
+
const min = Math.round(resolution);
|
|
722
|
+
const max = Math.round(resolution * aspectRatio);
|
|
723
|
+
return gl.drawingBufferWidth > gl.drawingBufferHeight ? {
|
|
724
|
+
width: max,
|
|
725
|
+
height: min
|
|
726
|
+
} : {
|
|
727
|
+
width: min,
|
|
728
|
+
height: max
|
|
729
|
+
};
|
|
730
|
+
}
|
|
731
|
+
function scaleByPixelRatio(input) {
|
|
732
|
+
return Math.floor(input * (window.devicePixelRatio || 1));
|
|
733
|
+
}
|
|
734
|
+
function hashCode(s) {
|
|
735
|
+
let hash = 0;
|
|
736
|
+
for (let i = 0; i < s.length; i++) {
|
|
737
|
+
hash = (hash << 5) - hash + s.charCodeAt(i);
|
|
738
|
+
hash |= 0;
|
|
739
|
+
}
|
|
740
|
+
return hash;
|
|
741
|
+
}
|
|
742
|
+
let firstMoveHandled = false;
|
|
743
|
+
const toLocal = (clientX, clientY) => {
|
|
744
|
+
const rect = canvas.getBoundingClientRect();
|
|
745
|
+
return {
|
|
746
|
+
x: scaleByPixelRatio(clientX - rect.left),
|
|
747
|
+
y: scaleByPixelRatio(clientY - rect.top)
|
|
748
|
+
};
|
|
749
|
+
};
|
|
750
|
+
const onMouseDown = (e) => {
|
|
751
|
+
const pos = toLocal(e.clientX, e.clientY);
|
|
752
|
+
pointerDown(pos.x, pos.y);
|
|
753
|
+
clickSplat();
|
|
754
|
+
};
|
|
755
|
+
const onMouseMove = (e) => {
|
|
756
|
+
const pos = toLocal(e.clientX, e.clientY);
|
|
757
|
+
const color = firstMoveHandled ? pointer.color : generateColor();
|
|
758
|
+
firstMoveHandled = true;
|
|
759
|
+
pointerMove(pos.x, pos.y, color);
|
|
760
|
+
};
|
|
761
|
+
const onTouchStart = (e) => {
|
|
762
|
+
const t = e.targetTouches[0];
|
|
763
|
+
if (!t) return;
|
|
764
|
+
const pos = toLocal(t.clientX, t.clientY);
|
|
765
|
+
pointerDown(pos.x, pos.y);
|
|
766
|
+
};
|
|
767
|
+
const onTouchMove = (e) => {
|
|
768
|
+
const t = e.targetTouches[0];
|
|
769
|
+
if (!t) return;
|
|
770
|
+
const pos = toLocal(t.clientX, t.clientY);
|
|
771
|
+
pointerMove(pos.x, pos.y, pointer.color);
|
|
772
|
+
};
|
|
773
|
+
window.addEventListener("mousedown", onMouseDown);
|
|
774
|
+
window.addEventListener("mousemove", onMouseMove);
|
|
775
|
+
window.addEventListener("touchstart", onTouchStart, { passive: true });
|
|
776
|
+
window.addEventListener("touchmove", onTouchMove, { passive: true });
|
|
777
|
+
updateFrame();
|
|
778
|
+
return () => {
|
|
779
|
+
active = false;
|
|
780
|
+
cancelAnimationFrame(rafId);
|
|
781
|
+
window.removeEventListener("mousedown", onMouseDown);
|
|
782
|
+
window.removeEventListener("mousemove", onMouseMove);
|
|
783
|
+
window.removeEventListener("touchstart", onTouchStart);
|
|
784
|
+
window.removeEventListener("touchmove", onTouchMove);
|
|
785
|
+
};
|
|
785
786
|
}
|
|
786
|
-
// WebGL context bootstrap
|
|
787
787
|
function getWebGLContext(canvas) {
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
788
|
+
const params = {
|
|
789
|
+
alpha: true,
|
|
790
|
+
depth: false,
|
|
791
|
+
stencil: false,
|
|
792
|
+
antialias: false,
|
|
793
|
+
preserveDrawingBuffer: false
|
|
794
|
+
};
|
|
795
|
+
const gl2 = canvas.getContext("webgl2", params);
|
|
796
|
+
const gl = gl2 ?? canvas.getContext("webgl", params);
|
|
797
|
+
if (!gl) return null;
|
|
798
|
+
const isWebGL2 = !!gl2;
|
|
799
|
+
let halfFloat = null;
|
|
800
|
+
let supportLinearFiltering;
|
|
801
|
+
if (isWebGL2) {
|
|
802
|
+
gl.getExtension("EXT_color_buffer_float");
|
|
803
|
+
supportLinearFiltering = !!gl.getExtension("OES_texture_float_linear");
|
|
804
|
+
} else {
|
|
805
|
+
halfFloat = gl.getExtension("OES_texture_half_float");
|
|
806
|
+
supportLinearFiltering = !!gl.getExtension("OES_texture_half_float_linear");
|
|
807
|
+
}
|
|
808
|
+
gl.clearColor(0, 0, 0, 1);
|
|
809
|
+
const halfFloatTexType = isWebGL2 ? gl.HALF_FLOAT : halfFloat?.HALF_FLOAT_OES ?? gl.UNSIGNED_BYTE;
|
|
810
|
+
let formatRGBA;
|
|
811
|
+
let formatRG;
|
|
812
|
+
let formatR;
|
|
813
|
+
if (isWebGL2) {
|
|
814
|
+
const g2 = gl;
|
|
815
|
+
formatRGBA = getSupportedFormat(g2, g2.RGBA16F, g2.RGBA, halfFloatTexType);
|
|
816
|
+
formatRG = getSupportedFormat(g2, g2.RG16F, g2.RG, halfFloatTexType);
|
|
817
|
+
formatR = getSupportedFormat(g2, g2.R16F, g2.RED, halfFloatTexType);
|
|
818
|
+
} else {
|
|
819
|
+
formatRGBA = getSupportedFormat(gl, gl.RGBA, gl.RGBA, halfFloatTexType);
|
|
820
|
+
formatRG = formatRGBA;
|
|
821
|
+
formatR = formatRGBA;
|
|
822
|
+
}
|
|
823
|
+
if (!formatRGBA || !formatRG || !formatR) return null;
|
|
824
|
+
return {
|
|
825
|
+
gl,
|
|
826
|
+
ext: {
|
|
827
|
+
formatRGBA,
|
|
828
|
+
formatRG,
|
|
829
|
+
formatR,
|
|
830
|
+
halfFloatTexType,
|
|
831
|
+
supportLinearFiltering
|
|
832
|
+
}
|
|
833
|
+
};
|
|
831
834
|
}
|
|
832
835
|
function getSupportedFormat(gl, internalFormat, format, type) {
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
836
|
+
if (!supportRenderTextureFormat(gl, internalFormat, format, type)) {
|
|
837
|
+
const g2 = gl;
|
|
838
|
+
switch (internalFormat) {
|
|
839
|
+
case g2.R16F: return getSupportedFormat(gl, g2.RG16F, g2.RG, type);
|
|
840
|
+
case g2.RG16F: return getSupportedFormat(gl, g2.RGBA16F, g2.RGBA, type);
|
|
841
|
+
default: return null;
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
return {
|
|
845
|
+
internalFormat,
|
|
846
|
+
format
|
|
847
|
+
};
|
|
845
848
|
}
|
|
846
849
|
function supportRenderTextureFormat(gl, internalFormat, format, type) {
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
}
|
|
859
|
-
|
|
860
|
-
/**
|
|
861
|
-
* @license
|
|
862
|
-
*
|
|
863
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
864
|
-
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
865
|
-
*
|
|
866
|
-
* Angular adaptation of the SplashCursor effect by David Haz / reactbits.dev.
|
|
867
|
-
* Original: https://www.reactbits.dev/animations/splash-cursor
|
|
868
|
-
*/
|
|
869
|
-
/**
|
|
870
|
-
* Splash cursor — a WebGL fluid simulation that splashes colourful dye
|
|
871
|
-
* wherever the pointer moves or clicks. Renders as a fixed, full-viewport,
|
|
872
|
-
* click-through overlay; mount it once on a page (it follows the pointer
|
|
873
|
-
* everywhere) and it tears down with the component.
|
|
874
|
-
*
|
|
875
|
-
* Renders nothing under `prefers-reduced-motion` or when WebGL is
|
|
876
|
-
* unavailable.
|
|
877
|
-
*
|
|
878
|
-
* @example
|
|
879
|
-
* ```html
|
|
880
|
-
* <wr-splash-cursor />
|
|
881
|
-
* <wr-splash-cursor [rainbow]="false" color="#5227ff" />
|
|
882
|
-
* ```
|
|
883
|
-
*
|
|
884
|
-
* @see https://ngwr.dev/animations/splash-cursor
|
|
885
|
-
*/
|
|
886
|
-
class WrSplashCursor {
|
|
887
|
-
/**
|
|
888
|
-
* `true` overlays the whole viewport (reactbits behaviour); `false`
|
|
889
|
-
* fills the nearest positioned ancestor instead — handy for demo boxes,
|
|
890
|
-
* and the dye collides with the box walls. @default true
|
|
891
|
-
*/
|
|
892
|
-
fullscreen = input(true, { ...(ngDevMode ? { debugName: "fullscreen" } : /* istanbul ignore next */ {}), transform: coerceBooleanProperty });
|
|
893
|
-
/** Velocity / pressure grid resolution. @default 128 */
|
|
894
|
-
simResolution = input(128, { ...(ngDevMode ? { debugName: "simResolution" } : /* istanbul ignore next */ {}), transform: numAttr(128) });
|
|
895
|
-
/** Dye texture resolution — the visible detail. @default 1440 */
|
|
896
|
-
dyeResolution = input(1440, { ...(ngDevMode ? { debugName: "dyeResolution" } : /* istanbul ignore next */ {}), transform: numAttr(1440) });
|
|
897
|
-
/** How fast the dye fades, higher = shorter trails. @default 3.5 */
|
|
898
|
-
densityDissipation = input(3.5, { ...(ngDevMode ? { debugName: "densityDissipation" } : /* istanbul ignore next */ {}), transform: numAttr(3.5) });
|
|
899
|
-
/** How fast motion settles. @default 2 */
|
|
900
|
-
velocityDissipation = input(2, { ...(ngDevMode ? { debugName: "velocityDissipation" } : /* istanbul ignore next */ {}), transform: numAttr(2) });
|
|
901
|
-
/** Pressure retained between frames, 0..1. @default 0.1 */
|
|
902
|
-
pressure = input(0.1, { ...(ngDevMode ? { debugName: "pressure" } : /* istanbul ignore next */ {}), transform: numAttr(0.1) });
|
|
903
|
-
/** Jacobi iterations for the pressure solve. @default 20 */
|
|
904
|
-
pressureIterations = input(20, { ...(ngDevMode ? { debugName: "pressureIterations" } : /* istanbul ignore next */ {}), transform: numAttr(20) });
|
|
905
|
-
/** Vorticity confinement — swirliness. @default 3 */
|
|
906
|
-
curl = input(3, { ...(ngDevMode ? { debugName: "curl" } : /* istanbul ignore next */ {}), transform: numAttr(3) });
|
|
907
|
-
/** Splat size. @default 0.2 */
|
|
908
|
-
splatRadius = input(0.2, { ...(ngDevMode ? { debugName: "splatRadius" } : /* istanbul ignore next */ {}), transform: numAttr(0.2) });
|
|
909
|
-
/** Velocity a pointer move injects. @default 6000 */
|
|
910
|
-
splatForce = input(6000, { ...(ngDevMode ? { debugName: "splatForce" } : /* istanbul ignore next */ {}), transform: numAttr(6000) });
|
|
911
|
-
/** Pseudo-3D shading on the dye. @default true */
|
|
912
|
-
shading = input(true, { ...(ngDevMode ? { debugName: "shading" } : /* istanbul ignore next */ {}), transform: coerceBooleanProperty });
|
|
913
|
-
/** How fast the splat colour cycles. @default 10 */
|
|
914
|
-
colorUpdateSpeed = input(10, { ...(ngDevMode ? { debugName: "colorUpdateSpeed" } : /* istanbul ignore next */ {}), transform: numAttr(10) });
|
|
915
|
-
/** Cycle splat colours through the rainbow. @default true */
|
|
916
|
-
rainbow = input(true, { ...(ngDevMode ? { debugName: "rainbow" } : /* istanbul ignore next */ {}), transform: coerceBooleanProperty });
|
|
917
|
-
/** Fixed splat colour when `rainbow` is off. @default '#ff0000' */
|
|
918
|
-
color = input('#ff0000', /* @ts-ignore */
|
|
919
|
-
...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
920
|
-
canvasRef = viewChild('canvas', /* @ts-ignore */
|
|
921
|
-
...(ngDevMode ? [{ debugName: "canvasRef" }] : /* istanbul ignore next */ []));
|
|
922
|
-
zone = inject(NgZone);
|
|
923
|
-
platform = inject(WrPlatform);
|
|
924
|
-
isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
|
|
925
|
-
constructor() {
|
|
926
|
-
if (!this.isBrowser)
|
|
927
|
-
return;
|
|
928
|
-
// (Re)boot whenever the canvas appears, any input changes, or the OS
|
|
929
|
-
// reduced-motion preference flips. `onCleanup` tears the old sim down.
|
|
930
|
-
effect(onCleanup => {
|
|
931
|
-
const canvas = this.canvasRef()?.nativeElement;
|
|
932
|
-
const config = {
|
|
933
|
-
simResolution: this.simResolution(),
|
|
934
|
-
dyeResolution: this.dyeResolution(),
|
|
935
|
-
densityDissipation: this.densityDissipation(),
|
|
936
|
-
velocityDissipation: this.velocityDissipation(),
|
|
937
|
-
pressure: this.pressure(),
|
|
938
|
-
pressureIterations: this.pressureIterations(),
|
|
939
|
-
curl: this.curl(),
|
|
940
|
-
splatRadius: this.splatRadius(),
|
|
941
|
-
splatForce: this.splatForce(),
|
|
942
|
-
shading: this.shading(),
|
|
943
|
-
colorUpdateSpeed: this.colorUpdateSpeed(),
|
|
944
|
-
rainbow: this.rainbow(),
|
|
945
|
-
color: this.color(),
|
|
946
|
-
};
|
|
947
|
-
if (!canvas || this.platform.prefersReducedMotion())
|
|
948
|
-
return;
|
|
949
|
-
const teardown = this.zone.runOutsideAngular(() => createFluidSimulation(canvas, config));
|
|
950
|
-
if (teardown)
|
|
951
|
-
onCleanup(teardown);
|
|
952
|
-
});
|
|
953
|
-
}
|
|
954
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: WrSplashCursor, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
955
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.7", type: WrSplashCursor, isStandalone: true, selector: "wr-splash-cursor", inputs: { fullscreen: { classPropertyName: "fullscreen", publicName: "fullscreen", isSignal: true, isRequired: false, transformFunction: null }, simResolution: { classPropertyName: "simResolution", publicName: "simResolution", isSignal: true, isRequired: false, transformFunction: null }, dyeResolution: { classPropertyName: "dyeResolution", publicName: "dyeResolution", isSignal: true, isRequired: false, transformFunction: null }, densityDissipation: { classPropertyName: "densityDissipation", publicName: "densityDissipation", isSignal: true, isRequired: false, transformFunction: null }, velocityDissipation: { classPropertyName: "velocityDissipation", publicName: "velocityDissipation", isSignal: true, isRequired: false, transformFunction: null }, pressure: { classPropertyName: "pressure", publicName: "pressure", isSignal: true, isRequired: false, transformFunction: null }, pressureIterations: { classPropertyName: "pressureIterations", publicName: "pressureIterations", isSignal: true, isRequired: false, transformFunction: null }, curl: { classPropertyName: "curl", publicName: "curl", isSignal: true, isRequired: false, transformFunction: null }, splatRadius: { classPropertyName: "splatRadius", publicName: "splatRadius", isSignal: true, isRequired: false, transformFunction: null }, splatForce: { classPropertyName: "splatForce", publicName: "splatForce", isSignal: true, isRequired: false, transformFunction: null }, shading: { classPropertyName: "shading", publicName: "shading", isSignal: true, isRequired: false, transformFunction: null }, colorUpdateSpeed: { classPropertyName: "colorUpdateSpeed", publicName: "colorUpdateSpeed", isSignal: true, isRequired: false, transformFunction: null }, rainbow: { classPropertyName: "rainbow", publicName: "rainbow", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.wr-splash-cursor--contained": "!fullscreen()" }, classAttribute: "wr-splash-cursor" }, viewQueries: [{ propertyName: "canvasRef", first: true, predicate: ["canvas"], descendants: true, isSignal: true }], ngImport: i0, template: '<canvas #canvas class="wr-splash-cursor__canvas" aria-hidden="true"></canvas>', isInline: true, styles: [".wr-splash-cursor{position:fixed;inset:0;z-index:50;display:block;pointer-events:none}.wr-splash-cursor__canvas{display:block;width:100vw;height:100vh;height:100dvh}.wr-splash-cursor--contained{position:absolute;z-index:0}.wr-splash-cursor--contained .wr-splash-cursor__canvas{width:100%;height:100%}\n"], encapsulation: i0.ViewEncapsulation.None });
|
|
850
|
+
const texture = gl.createTexture();
|
|
851
|
+
gl.bindTexture(gl.TEXTURE_2D, texture);
|
|
852
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
|
|
853
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
|
|
854
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
|
|
855
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
|
|
856
|
+
gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat, 4, 4, 0, format, type, null);
|
|
857
|
+
const fbo = gl.createFramebuffer();
|
|
858
|
+
gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
|
|
859
|
+
gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
|
|
860
|
+
return gl.checkFramebufferStatus(gl.FRAMEBUFFER) === gl.FRAMEBUFFER_COMPLETE;
|
|
956
861
|
}
|
|
957
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: WrSplashCursor, decorators: [{
|
|
958
|
-
type: Component,
|
|
959
|
-
args: [{ selector: 'wr-splash-cursor', template: '<canvas #canvas class="wr-splash-cursor__canvas" aria-hidden="true"></canvas>', encapsulation: ViewEncapsulation.None, host: {
|
|
960
|
-
class: 'wr-splash-cursor',
|
|
961
|
-
'[class.wr-splash-cursor--contained]': '!fullscreen()',
|
|
962
|
-
}, styles: [".wr-splash-cursor{position:fixed;inset:0;z-index:50;display:block;pointer-events:none}.wr-splash-cursor__canvas{display:block;width:100vw;height:100vh;height:100dvh}.wr-splash-cursor--contained{position:absolute;z-index:0}.wr-splash-cursor--contained .wr-splash-cursor__canvas{width:100%;height:100%}\n"] }]
|
|
963
|
-
}], ctorParameters: () => [], propDecorators: { fullscreen: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullscreen", required: false }] }], simResolution: [{ type: i0.Input, args: [{ isSignal: true, alias: "simResolution", required: false }] }], dyeResolution: [{ type: i0.Input, args: [{ isSignal: true, alias: "dyeResolution", required: false }] }], densityDissipation: [{ type: i0.Input, args: [{ isSignal: true, alias: "densityDissipation", required: false }] }], velocityDissipation: [{ type: i0.Input, args: [{ isSignal: true, alias: "velocityDissipation", required: false }] }], pressure: [{ type: i0.Input, args: [{ isSignal: true, alias: "pressure", required: false }] }], pressureIterations: [{ type: i0.Input, args: [{ isSignal: true, alias: "pressureIterations", required: false }] }], curl: [{ type: i0.Input, args: [{ isSignal: true, alias: "curl", required: false }] }], splatRadius: [{ type: i0.Input, args: [{ isSignal: true, alias: "splatRadius", required: false }] }], splatForce: [{ type: i0.Input, args: [{ isSignal: true, alias: "splatForce", required: false }] }], shading: [{ type: i0.Input, args: [{ isSignal: true, alias: "shading", required: false }] }], colorUpdateSpeed: [{ type: i0.Input, args: [{ isSignal: true, alias: "colorUpdateSpeed", required: false }] }], rainbow: [{ type: i0.Input, args: [{ isSignal: true, alias: "rainbow", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], canvasRef: [{ type: i0.ViewChild, args: ['canvas', { isSignal: true }] }] } });
|
|
964
|
-
|
|
965
862
|
/**
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
863
|
+
* @license
|
|
864
|
+
*
|
|
865
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
866
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
867
|
+
*
|
|
868
|
+
* Angular adaptation of the SplashCursor effect by David Haz / reactbits.dev.
|
|
869
|
+
* Original: https://www.reactbits.dev/animations/splash-cursor
|
|
870
|
+
*/
|
|
871
|
+
var WrSplashCursor = class WrSplashCursor {
|
|
872
|
+
fullscreen = input(true, {
|
|
873
|
+
...ngDevMode ? { debugName: "fullscreen" } : /* istanbul ignore next */ {},
|
|
874
|
+
transform: coerceBooleanProperty
|
|
875
|
+
});
|
|
876
|
+
simResolution = input(128, {
|
|
877
|
+
...ngDevMode ? { debugName: "simResolution" } : /* istanbul ignore next */ {},
|
|
878
|
+
transform: numAttr(128)
|
|
879
|
+
});
|
|
880
|
+
dyeResolution = input(1440, {
|
|
881
|
+
...ngDevMode ? { debugName: "dyeResolution" } : /* istanbul ignore next */ {},
|
|
882
|
+
transform: numAttr(1440)
|
|
883
|
+
});
|
|
884
|
+
densityDissipation = input(3.5, {
|
|
885
|
+
...ngDevMode ? { debugName: "densityDissipation" } : /* istanbul ignore next */ {},
|
|
886
|
+
transform: numAttr(3.5)
|
|
887
|
+
});
|
|
888
|
+
velocityDissipation = input(2, {
|
|
889
|
+
...ngDevMode ? { debugName: "velocityDissipation" } : /* istanbul ignore next */ {},
|
|
890
|
+
transform: numAttr(2)
|
|
891
|
+
});
|
|
892
|
+
pressure = input(.1, {
|
|
893
|
+
...ngDevMode ? { debugName: "pressure" } : /* istanbul ignore next */ {},
|
|
894
|
+
transform: numAttr(.1)
|
|
895
|
+
});
|
|
896
|
+
pressureIterations = input(20, {
|
|
897
|
+
...ngDevMode ? { debugName: "pressureIterations" } : /* istanbul ignore next */ {},
|
|
898
|
+
transform: numAttr(20)
|
|
899
|
+
});
|
|
900
|
+
curl = input(3, {
|
|
901
|
+
...ngDevMode ? { debugName: "curl" } : /* istanbul ignore next */ {},
|
|
902
|
+
transform: numAttr(3)
|
|
903
|
+
});
|
|
904
|
+
splatRadius = input(.2, {
|
|
905
|
+
...ngDevMode ? { debugName: "splatRadius" } : /* istanbul ignore next */ {},
|
|
906
|
+
transform: numAttr(.2)
|
|
907
|
+
});
|
|
908
|
+
splatForce = input(6e3, {
|
|
909
|
+
...ngDevMode ? { debugName: "splatForce" } : /* istanbul ignore next */ {},
|
|
910
|
+
transform: numAttr(6e3)
|
|
911
|
+
});
|
|
912
|
+
shading = input(true, {
|
|
913
|
+
...ngDevMode ? { debugName: "shading" } : /* istanbul ignore next */ {},
|
|
914
|
+
transform: coerceBooleanProperty
|
|
915
|
+
});
|
|
916
|
+
colorUpdateSpeed = input(10, {
|
|
917
|
+
...ngDevMode ? { debugName: "colorUpdateSpeed" } : /* istanbul ignore next */ {},
|
|
918
|
+
transform: numAttr(10)
|
|
919
|
+
});
|
|
920
|
+
rainbow = input(true, {
|
|
921
|
+
...ngDevMode ? { debugName: "rainbow" } : /* istanbul ignore next */ {},
|
|
922
|
+
transform: coerceBooleanProperty
|
|
923
|
+
});
|
|
924
|
+
color = input("#ff0000", ...ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []);
|
|
925
|
+
canvasRef = viewChild("canvas", ...ngDevMode ? [{ debugName: "canvasRef" }] : /* istanbul ignore next */ []);
|
|
926
|
+
zone = inject(NgZone);
|
|
927
|
+
platform = inject(WrPlatform);
|
|
928
|
+
isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
|
|
929
|
+
constructor() {
|
|
930
|
+
if (!this.isBrowser) return;
|
|
931
|
+
effect((onCleanup) => {
|
|
932
|
+
const canvas = this.canvasRef()?.nativeElement;
|
|
933
|
+
const config = {
|
|
934
|
+
simResolution: this.simResolution(),
|
|
935
|
+
dyeResolution: this.dyeResolution(),
|
|
936
|
+
densityDissipation: this.densityDissipation(),
|
|
937
|
+
velocityDissipation: this.velocityDissipation(),
|
|
938
|
+
pressure: this.pressure(),
|
|
939
|
+
pressureIterations: this.pressureIterations(),
|
|
940
|
+
curl: this.curl(),
|
|
941
|
+
splatRadius: this.splatRadius(),
|
|
942
|
+
splatForce: this.splatForce(),
|
|
943
|
+
shading: this.shading(),
|
|
944
|
+
colorUpdateSpeed: this.colorUpdateSpeed(),
|
|
945
|
+
rainbow: this.rainbow(),
|
|
946
|
+
color: this.color()
|
|
947
|
+
};
|
|
948
|
+
if (!canvas || this.platform.prefersReducedMotion()) return;
|
|
949
|
+
const teardown = this.zone.runOutsideAngular(() => createFluidSimulation(canvas, config));
|
|
950
|
+
if (teardown) onCleanup(teardown);
|
|
951
|
+
});
|
|
952
|
+
}
|
|
953
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
954
|
+
minVersion: "12.0.0",
|
|
955
|
+
version: "22.2.3",
|
|
956
|
+
ngImport: i0,
|
|
957
|
+
type: WrSplashCursor,
|
|
958
|
+
deps: [],
|
|
959
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
960
|
+
});
|
|
961
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
962
|
+
minVersion: "17.2.0",
|
|
963
|
+
version: "22.2.3",
|
|
964
|
+
type: WrSplashCursor,
|
|
965
|
+
isStandalone: true,
|
|
966
|
+
selector: "wr-splash-cursor",
|
|
967
|
+
inputs: {
|
|
968
|
+
fullscreen: {
|
|
969
|
+
classPropertyName: "fullscreen",
|
|
970
|
+
publicName: "fullscreen",
|
|
971
|
+
isSignal: true,
|
|
972
|
+
isRequired: false,
|
|
973
|
+
transformFunction: null
|
|
974
|
+
},
|
|
975
|
+
simResolution: {
|
|
976
|
+
classPropertyName: "simResolution",
|
|
977
|
+
publicName: "simResolution",
|
|
978
|
+
isSignal: true,
|
|
979
|
+
isRequired: false,
|
|
980
|
+
transformFunction: null
|
|
981
|
+
},
|
|
982
|
+
dyeResolution: {
|
|
983
|
+
classPropertyName: "dyeResolution",
|
|
984
|
+
publicName: "dyeResolution",
|
|
985
|
+
isSignal: true,
|
|
986
|
+
isRequired: false,
|
|
987
|
+
transformFunction: null
|
|
988
|
+
},
|
|
989
|
+
densityDissipation: {
|
|
990
|
+
classPropertyName: "densityDissipation",
|
|
991
|
+
publicName: "densityDissipation",
|
|
992
|
+
isSignal: true,
|
|
993
|
+
isRequired: false,
|
|
994
|
+
transformFunction: null
|
|
995
|
+
},
|
|
996
|
+
velocityDissipation: {
|
|
997
|
+
classPropertyName: "velocityDissipation",
|
|
998
|
+
publicName: "velocityDissipation",
|
|
999
|
+
isSignal: true,
|
|
1000
|
+
isRequired: false,
|
|
1001
|
+
transformFunction: null
|
|
1002
|
+
},
|
|
1003
|
+
pressure: {
|
|
1004
|
+
classPropertyName: "pressure",
|
|
1005
|
+
publicName: "pressure",
|
|
1006
|
+
isSignal: true,
|
|
1007
|
+
isRequired: false,
|
|
1008
|
+
transformFunction: null
|
|
1009
|
+
},
|
|
1010
|
+
pressureIterations: {
|
|
1011
|
+
classPropertyName: "pressureIterations",
|
|
1012
|
+
publicName: "pressureIterations",
|
|
1013
|
+
isSignal: true,
|
|
1014
|
+
isRequired: false,
|
|
1015
|
+
transformFunction: null
|
|
1016
|
+
},
|
|
1017
|
+
curl: {
|
|
1018
|
+
classPropertyName: "curl",
|
|
1019
|
+
publicName: "curl",
|
|
1020
|
+
isSignal: true,
|
|
1021
|
+
isRequired: false,
|
|
1022
|
+
transformFunction: null
|
|
1023
|
+
},
|
|
1024
|
+
splatRadius: {
|
|
1025
|
+
classPropertyName: "splatRadius",
|
|
1026
|
+
publicName: "splatRadius",
|
|
1027
|
+
isSignal: true,
|
|
1028
|
+
isRequired: false,
|
|
1029
|
+
transformFunction: null
|
|
1030
|
+
},
|
|
1031
|
+
splatForce: {
|
|
1032
|
+
classPropertyName: "splatForce",
|
|
1033
|
+
publicName: "splatForce",
|
|
1034
|
+
isSignal: true,
|
|
1035
|
+
isRequired: false,
|
|
1036
|
+
transformFunction: null
|
|
1037
|
+
},
|
|
1038
|
+
shading: {
|
|
1039
|
+
classPropertyName: "shading",
|
|
1040
|
+
publicName: "shading",
|
|
1041
|
+
isSignal: true,
|
|
1042
|
+
isRequired: false,
|
|
1043
|
+
transformFunction: null
|
|
1044
|
+
},
|
|
1045
|
+
colorUpdateSpeed: {
|
|
1046
|
+
classPropertyName: "colorUpdateSpeed",
|
|
1047
|
+
publicName: "colorUpdateSpeed",
|
|
1048
|
+
isSignal: true,
|
|
1049
|
+
isRequired: false,
|
|
1050
|
+
transformFunction: null
|
|
1051
|
+
},
|
|
1052
|
+
rainbow: {
|
|
1053
|
+
classPropertyName: "rainbow",
|
|
1054
|
+
publicName: "rainbow",
|
|
1055
|
+
isSignal: true,
|
|
1056
|
+
isRequired: false,
|
|
1057
|
+
transformFunction: null
|
|
1058
|
+
},
|
|
1059
|
+
color: {
|
|
1060
|
+
classPropertyName: "color",
|
|
1061
|
+
publicName: "color",
|
|
1062
|
+
isSignal: true,
|
|
1063
|
+
isRequired: false,
|
|
1064
|
+
transformFunction: null
|
|
1065
|
+
}
|
|
1066
|
+
},
|
|
1067
|
+
host: {
|
|
1068
|
+
properties: { "class.wr-splash-cursor--contained": "!fullscreen()" },
|
|
1069
|
+
classAttribute: "wr-splash-cursor"
|
|
1070
|
+
},
|
|
1071
|
+
viewQueries: [{
|
|
1072
|
+
propertyName: "canvasRef",
|
|
1073
|
+
first: true,
|
|
1074
|
+
predicate: ["canvas"],
|
|
1075
|
+
descendants: true,
|
|
1076
|
+
isSignal: true
|
|
1077
|
+
}],
|
|
1078
|
+
ngImport: i0,
|
|
1079
|
+
template: "<canvas #canvas class=\"wr-splash-cursor__canvas\" aria-hidden=\"true\"></canvas>",
|
|
1080
|
+
isInline: true,
|
|
1081
|
+
styles: [".wr-splash-cursor{position:fixed;inset:0;z-index:50;display:block;pointer-events:none}.wr-splash-cursor__canvas{display:block;width:100vw;height:100vh;height:100dvh}.wr-splash-cursor--contained{position:absolute;z-index:0}.wr-splash-cursor--contained .wr-splash-cursor__canvas{width:100%;height:100%}\n"],
|
|
1082
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
1083
|
+
});
|
|
1084
|
+
};
|
|
1085
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1086
|
+
minVersion: "12.0.0",
|
|
1087
|
+
version: "22.2.3",
|
|
1088
|
+
ngImport: i0,
|
|
1089
|
+
type: WrSplashCursor,
|
|
1090
|
+
decorators: [{
|
|
1091
|
+
type: Component,
|
|
1092
|
+
args: [{
|
|
1093
|
+
selector: "wr-splash-cursor",
|
|
1094
|
+
template: "<canvas #canvas class=\"wr-splash-cursor__canvas\" aria-hidden=\"true\"></canvas>",
|
|
1095
|
+
encapsulation: ViewEncapsulation.None,
|
|
1096
|
+
host: {
|
|
1097
|
+
class: "wr-splash-cursor",
|
|
1098
|
+
"[class.wr-splash-cursor--contained]": "!fullscreen()"
|
|
1099
|
+
},
|
|
1100
|
+
styles: [".wr-splash-cursor{position:fixed;inset:0;z-index:50;display:block;pointer-events:none}.wr-splash-cursor__canvas{display:block;width:100vw;height:100vh;height:100dvh}.wr-splash-cursor--contained{position:absolute;z-index:0}.wr-splash-cursor--contained .wr-splash-cursor__canvas{width:100%;height:100%}\n"]
|
|
1101
|
+
}]
|
|
1102
|
+
}],
|
|
1103
|
+
ctorParameters: () => [],
|
|
1104
|
+
propDecorators: {
|
|
1105
|
+
fullscreen: [{
|
|
1106
|
+
type: i0.Input,
|
|
1107
|
+
args: [{
|
|
1108
|
+
isSignal: true,
|
|
1109
|
+
alias: "fullscreen",
|
|
1110
|
+
required: false
|
|
1111
|
+
}]
|
|
1112
|
+
}],
|
|
1113
|
+
simResolution: [{
|
|
1114
|
+
type: i0.Input,
|
|
1115
|
+
args: [{
|
|
1116
|
+
isSignal: true,
|
|
1117
|
+
alias: "simResolution",
|
|
1118
|
+
required: false
|
|
1119
|
+
}]
|
|
1120
|
+
}],
|
|
1121
|
+
dyeResolution: [{
|
|
1122
|
+
type: i0.Input,
|
|
1123
|
+
args: [{
|
|
1124
|
+
isSignal: true,
|
|
1125
|
+
alias: "dyeResolution",
|
|
1126
|
+
required: false
|
|
1127
|
+
}]
|
|
1128
|
+
}],
|
|
1129
|
+
densityDissipation: [{
|
|
1130
|
+
type: i0.Input,
|
|
1131
|
+
args: [{
|
|
1132
|
+
isSignal: true,
|
|
1133
|
+
alias: "densityDissipation",
|
|
1134
|
+
required: false
|
|
1135
|
+
}]
|
|
1136
|
+
}],
|
|
1137
|
+
velocityDissipation: [{
|
|
1138
|
+
type: i0.Input,
|
|
1139
|
+
args: [{
|
|
1140
|
+
isSignal: true,
|
|
1141
|
+
alias: "velocityDissipation",
|
|
1142
|
+
required: false
|
|
1143
|
+
}]
|
|
1144
|
+
}],
|
|
1145
|
+
pressure: [{
|
|
1146
|
+
type: i0.Input,
|
|
1147
|
+
args: [{
|
|
1148
|
+
isSignal: true,
|
|
1149
|
+
alias: "pressure",
|
|
1150
|
+
required: false
|
|
1151
|
+
}]
|
|
1152
|
+
}],
|
|
1153
|
+
pressureIterations: [{
|
|
1154
|
+
type: i0.Input,
|
|
1155
|
+
args: [{
|
|
1156
|
+
isSignal: true,
|
|
1157
|
+
alias: "pressureIterations",
|
|
1158
|
+
required: false
|
|
1159
|
+
}]
|
|
1160
|
+
}],
|
|
1161
|
+
curl: [{
|
|
1162
|
+
type: i0.Input,
|
|
1163
|
+
args: [{
|
|
1164
|
+
isSignal: true,
|
|
1165
|
+
alias: "curl",
|
|
1166
|
+
required: false
|
|
1167
|
+
}]
|
|
1168
|
+
}],
|
|
1169
|
+
splatRadius: [{
|
|
1170
|
+
type: i0.Input,
|
|
1171
|
+
args: [{
|
|
1172
|
+
isSignal: true,
|
|
1173
|
+
alias: "splatRadius",
|
|
1174
|
+
required: false
|
|
1175
|
+
}]
|
|
1176
|
+
}],
|
|
1177
|
+
splatForce: [{
|
|
1178
|
+
type: i0.Input,
|
|
1179
|
+
args: [{
|
|
1180
|
+
isSignal: true,
|
|
1181
|
+
alias: "splatForce",
|
|
1182
|
+
required: false
|
|
1183
|
+
}]
|
|
1184
|
+
}],
|
|
1185
|
+
shading: [{
|
|
1186
|
+
type: i0.Input,
|
|
1187
|
+
args: [{
|
|
1188
|
+
isSignal: true,
|
|
1189
|
+
alias: "shading",
|
|
1190
|
+
required: false
|
|
1191
|
+
}]
|
|
1192
|
+
}],
|
|
1193
|
+
colorUpdateSpeed: [{
|
|
1194
|
+
type: i0.Input,
|
|
1195
|
+
args: [{
|
|
1196
|
+
isSignal: true,
|
|
1197
|
+
alias: "colorUpdateSpeed",
|
|
1198
|
+
required: false
|
|
1199
|
+
}]
|
|
1200
|
+
}],
|
|
1201
|
+
rainbow: [{
|
|
1202
|
+
type: i0.Input,
|
|
1203
|
+
args: [{
|
|
1204
|
+
isSignal: true,
|
|
1205
|
+
alias: "rainbow",
|
|
1206
|
+
required: false
|
|
1207
|
+
}]
|
|
1208
|
+
}],
|
|
1209
|
+
color: [{
|
|
1210
|
+
type: i0.Input,
|
|
1211
|
+
args: [{
|
|
1212
|
+
isSignal: true,
|
|
1213
|
+
alias: "color",
|
|
1214
|
+
required: false
|
|
1215
|
+
}]
|
|
1216
|
+
}],
|
|
1217
|
+
canvasRef: [{
|
|
1218
|
+
type: i0.ViewChild,
|
|
1219
|
+
args: ["canvas", { isSignal: true }]
|
|
1220
|
+
}]
|
|
1221
|
+
}
|
|
1222
|
+
});
|
|
969
1223
|
export { WrSplashCursor };
|
|
970
|
-
|
|
1224
|
+
|
|
1225
|
+
//# sourceMappingURL=ngwr-splash-cursor.mjs.map
|