fancy-ui-react 0.2.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/LICENSE +21 -0
- package/PORTING.md +118 -0
- package/README.md +643 -0
- package/dist/cameleon/FancyProvider.d.ts +11 -0
- package/dist/cameleon/FancyProvider.js +42 -0
- package/dist/cameleon/context.d.ts +22 -0
- package/dist/cameleon/context.js +16 -0
- package/dist/cameleon/index.d.ts +31 -0
- package/dist/cameleon/index.js +39 -0
- package/dist/cameleon/primitives/Badge.d.ts +10 -0
- package/dist/cameleon/primitives/Badge.js +12 -0
- package/dist/cameleon/primitives/Button.d.ts +11 -0
- package/dist/cameleon/primitives/Button.js +43 -0
- package/dist/cameleon/primitives/Checkbox.d.ts +10 -0
- package/dist/cameleon/primitives/Checkbox.js +39 -0
- package/dist/cameleon/primitives/Input.d.ts +10 -0
- package/dist/cameleon/primitives/Input.js +13 -0
- package/dist/cameleon/primitives/Radio.d.ts +12 -0
- package/dist/cameleon/primitives/Radio.js +29 -0
- package/dist/cameleon/primitives/Select.d.ts +10 -0
- package/dist/cameleon/primitives/Select.js +27 -0
- package/dist/cameleon/primitives/Slider.d.ts +7 -0
- package/dist/cameleon/primitives/Slider.js +22 -0
- package/dist/cameleon/primitives/Switch.d.ts +9 -0
- package/dist/cameleon/primitives/Switch.js +33 -0
- package/dist/cameleon/primitives/Textarea.d.ts +9 -0
- package/dist/cameleon/primitives/Textarea.js +13 -0
- package/dist/cameleon/primitives/Tooltip.d.ts +14 -0
- package/dist/cameleon/primitives/Tooltip.js +15 -0
- package/dist/cameleon/primitives/index.d.ts +10 -0
- package/dist/cameleon/skins/aurora/index.d.ts +2 -0
- package/dist/cameleon/skins/aurora/index.js +16 -0
- package/dist/cameleon/skins/aurora/meta.d.ts +3 -0
- package/dist/cameleon/skins/aurora/meta.js +61 -0
- package/dist/cameleon/skins/aurora/recipes.d.ts +24 -0
- package/dist/cameleon/skins/aurora/recipes.js +124 -0
- package/dist/cameleon/skins/aurora/tokens.d.ts +6 -0
- package/dist/cameleon/skins/aurora/tokens.js +18 -0
- package/dist/cameleon/skins/brutal/index.d.ts +2 -0
- package/dist/cameleon/skins/brutal/index.js +35 -0
- package/dist/cameleon/skins/brutal/meta.d.ts +3 -0
- package/dist/cameleon/skins/brutal/meta.js +73 -0
- package/dist/cameleon/skins/brutal/ornaments.d.ts +7 -0
- package/dist/cameleon/skins/brutal/ornaments.js +18 -0
- package/dist/cameleon/skins/brutal/recipes.d.ts +23 -0
- package/dist/cameleon/skins/brutal/recipes.js +113 -0
- package/dist/cameleon/skins/brutal/tokens.d.ts +8 -0
- package/dist/cameleon/skins/brutal/tokens.js +23 -0
- package/dist/cameleon/skins/default.d.ts +2 -0
- package/dist/cameleon/skins/default.js +79 -0
- package/dist/cameleon/skins/glass/index.d.ts +2 -0
- package/dist/cameleon/skins/glass/index.js +16 -0
- package/dist/cameleon/skins/glass/meta.d.ts +3 -0
- package/dist/cameleon/skins/glass/meta.js +63 -0
- package/dist/cameleon/skins/glass/recipes.d.ts +24 -0
- package/dist/cameleon/skins/glass/recipes.js +124 -0
- package/dist/cameleon/skins/glass/tokens.d.ts +5 -0
- package/dist/cameleon/skins/glass/tokens.js +18 -0
- package/dist/cameleon/skins/retro-os/index.d.ts +2 -0
- package/dist/cameleon/skins/retro-os/index.js +24 -0
- package/dist/cameleon/skins/retro-os/meta.d.ts +3 -0
- package/dist/cameleon/skins/retro-os/meta.js +61 -0
- package/dist/cameleon/skins/retro-os/ornaments.d.ts +9 -0
- package/dist/cameleon/skins/retro-os/ornaments.js +28 -0
- package/dist/cameleon/skins/retro-os/recipes.d.ts +35 -0
- package/dist/cameleon/skins/retro-os/recipes.js +126 -0
- package/dist/cameleon/skins/retro-os/tokens.d.ts +16 -0
- package/dist/cameleon/skins/retro-os/tokens.js +23 -0
- package/dist/cameleon/skins/terminal/index.d.ts +2 -0
- package/dist/cameleon/skins/terminal/index.js +24 -0
- package/dist/cameleon/skins/terminal/meta.d.ts +3 -0
- package/dist/cameleon/skins/terminal/meta.js +70 -0
- package/dist/cameleon/skins/terminal/ornaments.d.ts +7 -0
- package/dist/cameleon/skins/terminal/ornaments.js +8 -0
- package/dist/cameleon/skins/terminal/recipes.d.ts +25 -0
- package/dist/cameleon/skins/terminal/recipes.js +125 -0
- package/dist/cameleon/skins/terminal/tokens.d.ts +5 -0
- package/dist/cameleon/skins/terminal/tokens.js +18 -0
- package/dist/cameleon/types.d.ts +133 -0
- package/dist/components/agent-plan/AgentPlan.d.ts +25 -0
- package/dist/components/agent-plan/AgentPlan.js +181 -0
- package/dist/components/agent-plan/index.d.ts +2 -0
- package/dist/components/ai-data-table/AiDataTable.d.ts +54 -0
- package/dist/components/ai-data-table/AiDataTable.js +110 -0
- package/dist/components/ai-data-table/index.d.ts +2 -0
- package/dist/components/alert-dialog/AlertDialog.d.ts +35 -0
- package/dist/components/alert-dialog/AlertDialog.js +109 -0
- package/dist/components/alert-dialog/index.d.ts +2 -0
- package/dist/components/animated-beam/AnimatedBeam.d.ts +39 -0
- package/dist/components/animated-beam/AnimatedBeam.js +192 -0
- package/dist/components/animated-beam/index.d.ts +2 -0
- package/dist/components/animated-testimonials/AnimatedTestimonials.d.ts +32 -0
- package/dist/components/animated-testimonials/AnimatedTestimonials.js +172 -0
- package/dist/components/animated-testimonials/index.d.ts +2 -0
- package/dist/components/animated-tooltip/AnimatedTooltip.d.ts +13 -0
- package/dist/components/animated-tooltip/AnimatedTooltip.js +137 -0
- package/dist/components/animated-tooltip/index.d.ts +2 -0
- package/dist/components/apple-card-carousel/AppleCard.d.ts +30 -0
- package/dist/components/apple-card-carousel/AppleCard.js +219 -0
- package/dist/components/apple-card-carousel/AppleCardCarousel.d.ts +14 -0
- package/dist/components/apple-card-carousel/AppleCardCarousel.js +30 -0
- package/dist/components/apple-card-carousel/index.d.ts +4 -0
- package/dist/components/approval-card/ApprovalCard.d.ts +57 -0
- package/dist/components/approval-card/ApprovalCard.js +153 -0
- package/dist/components/approval-card/index.d.ts +2 -0
- package/dist/components/artifact-card/ArtifactCard.d.ts +44 -0
- package/dist/components/artifact-card/ArtifactCard.js +204 -0
- package/dist/components/artifact-card/index.d.ts +2 -0
- package/dist/components/autocomplete/Autocomplete.d.ts +36 -0
- package/dist/components/autocomplete/Autocomplete.js +186 -0
- package/dist/components/autocomplete/AutocompletePanel.d.ts +12 -0
- package/dist/components/autocomplete/AutocompletePanel.js +123 -0
- package/dist/components/autocomplete/index.d.ts +4 -0
- package/dist/components/autocomplete/match.d.ts +6 -0
- package/dist/components/autocomplete/match.js +10 -0
- package/dist/components/autocomplete/types.d.ts +52 -0
- package/dist/components/autocomplete/types.js +6 -0
- package/dist/components/bento-grid/BentoGrid.d.ts +6 -0
- package/dist/components/bento-grid/BentoGrid.js +19 -0
- package/dist/components/bento-grid/BentoGridCard.d.ts +11 -0
- package/dist/components/bento-grid/BentoGridCard.js +49 -0
- package/dist/components/bento-grid/BentoGridItem.d.ts +9 -0
- package/dist/components/bento-grid/BentoGridItem.js +33 -0
- package/dist/components/bento-grid/index.d.ts +6 -0
- package/dist/components/bg-falling-stars/FallingStarsBg.d.ts +24 -0
- package/dist/components/bg-falling-stars/FallingStarsBg.js +134 -0
- package/dist/components/bg-falling-stars/index.d.ts +2 -0
- package/dist/components/bg-stars/StarsBackground.d.ts +40 -0
- package/dist/components/bg-stars/StarsBackground.js +188 -0
- package/dist/components/bg-stars/index.d.ts +2 -0
- package/dist/components/blur-reveal/BlurReveal.d.ts +19 -0
- package/dist/components/blur-reveal/BlurReveal.js +50 -0
- package/dist/components/blur-reveal/index.d.ts +2 -0
- package/dist/components/book/Book.d.ts +13 -0
- package/dist/components/book/Book.js +94 -0
- package/dist/components/book/BookDescription.d.ts +6 -0
- package/dist/components/book/BookDescription.js +9 -0
- package/dist/components/book/BookHeader.d.ts +6 -0
- package/dist/components/book/BookHeader.js +9 -0
- package/dist/components/book/BookTitle.d.ts +6 -0
- package/dist/components/book/BookTitle.js +9 -0
- package/dist/components/book/index.d.ts +132 -0
- package/dist/components/book/index.js +48 -0
- package/dist/components/border-beam/BorderBeam.d.ts +25 -0
- package/dist/components/border-beam/BorderBeam.js +45 -0
- package/dist/components/border-beam/index.d.ts +2 -0
- package/dist/components/box-reveal/BoxReveal.d.ts +20 -0
- package/dist/components/box-reveal/BoxReveal.js +58 -0
- package/dist/components/box-reveal/index.d.ts +2 -0
- package/dist/components/breadcrumb/Breadcrumb.d.ts +49 -0
- package/dist/components/breadcrumb/Breadcrumb.js +61 -0
- package/dist/components/breadcrumb/index.d.ts +2 -0
- package/dist/components/button/Button.d.ts +44 -0
- package/dist/components/button/Button.js +120 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button/types.d.ts +4 -0
- package/dist/components/button-group/ButtonGroup.d.ts +23 -0
- package/dist/components/button-group/ButtonGroup.js +30 -0
- package/dist/components/button-group/index.d.ts +4 -0
- package/dist/components/button-group/types.d.ts +34 -0
- package/dist/components/button-group/types.js +7 -0
- package/dist/components/card-3d/CardBody.d.ts +8 -0
- package/dist/components/card-3d/CardBody.js +9 -0
- package/dist/components/card-3d/CardContainer.d.ts +19 -0
- package/dist/components/card-3d/CardContainer.js +61 -0
- package/dist/components/card-3d/CardItem.d.ts +22 -0
- package/dist/components/card-3d/CardItem.js +29 -0
- package/dist/components/card-3d/index.d.ts +6 -0
- package/dist/components/card-spotlight/CardSpotlight.d.ts +16 -0
- package/dist/components/card-spotlight/CardSpotlight.js +65 -0
- package/dist/components/card-spotlight/index.d.ts +2 -0
- package/dist/components/chat-error/ChatError.d.ts +32 -0
- package/dist/components/chat-error/ChatError.js +75 -0
- package/dist/components/chat-error/index.d.ts +2 -0
- package/dist/components/chat-message/ChatMessage.d.ts +43 -0
- package/dist/components/chat-message/ChatMessage.js +127 -0
- package/dist/components/chat-message/ChatMessageAction.d.ts +20 -0
- package/dist/components/chat-message/ChatMessageAction.js +58 -0
- package/dist/components/chat-message/ChatMessageActions.d.ts +14 -0
- package/dist/components/chat-message/ChatMessageActions.js +30 -0
- package/dist/components/chat-message/ChatMessageBranches.d.ts +15 -0
- package/dist/components/chat-message/ChatMessageBranches.js +93 -0
- package/dist/components/chat-message/index.d.ts +10 -0
- package/dist/components/chat-message/types.d.ts +38 -0
- package/dist/components/chat-message/types.js +7 -0
- package/dist/components/chat-panel/ChatEmptyState.d.ts +17 -0
- package/dist/components/chat-panel/ChatEmptyState.js +42 -0
- package/dist/components/chat-panel/ChatPanel.d.ts +31 -0
- package/dist/components/chat-panel/ChatPanel.js +163 -0
- package/dist/components/chat-panel/index.d.ts +4 -0
- package/dist/components/checkbox/Checkbox.d.ts +64 -0
- package/dist/components/checkbox/Checkbox.js +123 -0
- package/dist/components/checkbox/index.d.ts +2 -0
- package/dist/components/code-diff/CodeDiff.d.ts +39 -0
- package/dist/components/code-diff/CodeDiff.js +213 -0
- package/dist/components/code-diff/index.d.ts +2 -0
- package/dist/components/colourful-text/ColourfulText.d.ts +28 -0
- package/dist/components/colourful-text/ColourfulText.js +73 -0
- package/dist/components/colourful-text/index.d.ts +2 -0
- package/dist/components/combobox/Combobox.d.ts +53 -0
- package/dist/components/combobox/Combobox.js +248 -0
- package/dist/components/combobox/ComboboxPanel.d.ts +28 -0
- package/dist/components/combobox/ComboboxPanel.js +110 -0
- package/dist/components/combobox/index.d.ts +4 -0
- package/dist/components/combobox/match.d.ts +15 -0
- package/dist/components/combobox/match.js +14 -0
- package/dist/components/combobox/types.d.ts +60 -0
- package/dist/components/combobox/types.js +6 -0
- package/dist/components/command-menu/CommandMenu.d.ts +37 -0
- package/dist/components/command-menu/CommandMenu.js +386 -0
- package/dist/components/command-menu/index.d.ts +3 -0
- package/dist/components/command-menu/match.d.ts +19 -0
- package/dist/components/command-menu/match.js +45 -0
- package/dist/components/command-menu/types.d.ts +19 -0
- package/dist/components/compare/Compare.d.ts +31 -0
- package/dist/components/compare/Compare.js +300 -0
- package/dist/components/compare/StarField.d.ts +22 -0
- package/dist/components/compare/StarField.js +66 -0
- package/dist/components/compare/index.d.ts +4 -0
- package/dist/components/composer/Composer.d.ts +56 -0
- package/dist/components/composer/Composer.js +155 -0
- package/dist/components/composer/ComposerAttachment.d.ts +14 -0
- package/dist/components/composer/ComposerAttachment.js +127 -0
- package/dist/components/composer/ComposerAttachments.d.ts +18 -0
- package/dist/components/composer/ComposerAttachments.js +85 -0
- package/dist/components/composer/ComposerCommandMenu.d.ts +37 -0
- package/dist/components/composer/ComposerCommandMenu.js +208 -0
- package/dist/components/composer/ComposerInput.d.ts +22 -0
- package/dist/components/composer/ComposerInput.js +96 -0
- package/dist/components/composer/ComposerModelPicker.d.ts +32 -0
- package/dist/components/composer/ComposerModelPicker.js +223 -0
- package/dist/components/composer/ComposerSubmit.d.ts +16 -0
- package/dist/components/composer/ComposerSubmit.js +52 -0
- package/dist/components/composer/ComposerToolbar.d.ts +38 -0
- package/dist/components/composer/ComposerToolbar.js +9 -0
- package/dist/components/composer/caret.d.ts +69 -0
- package/dist/components/composer/caret.js +112 -0
- package/dist/components/composer/index.d.ts +18 -0
- package/dist/components/composer/types.d.ts +86 -0
- package/dist/components/composer/types.js +7 -0
- package/dist/components/confetti/Confetti.d.ts +37 -0
- package/dist/components/confetti/Confetti.js +45 -0
- package/dist/components/confetti/ConfettiButton.d.ts +23 -0
- package/dist/components/confetti/ConfettiButton.js +29 -0
- package/dist/components/confetti/context.d.ts +21 -0
- package/dist/components/confetti/context.js +6 -0
- package/dist/components/confetti/index.d.ts +4 -0
- package/dist/components/container-scroll/ContainerScroll.d.ts +10 -0
- package/dist/components/container-scroll/ContainerScroll.js +74 -0
- package/dist/components/container-scroll/index.d.ts +2 -0
- package/dist/components/container-text-flip/ContainerTextFlip.d.ts +9 -0
- package/dist/components/container-text-flip/ContainerTextFlip.js +58 -0
- package/dist/components/container-text-flip/index.d.ts +2 -0
- package/dist/components/context-menu/ContextMenu.d.ts +39 -0
- package/dist/components/context-menu/ContextMenu.js +105 -0
- package/dist/components/context-menu/ContextMenuContent.d.ts +27 -0
- package/dist/components/context-menu/ContextMenuContent.js +97 -0
- package/dist/components/context-menu/ContextMenuTrigger.d.ts +26 -0
- package/dist/components/context-menu/ContextMenuTrigger.js +37 -0
- package/dist/components/context-menu/index.d.ts +20 -0
- package/dist/components/context-menu/types.d.ts +52 -0
- package/dist/components/context-menu/types.js +17 -0
- package/dist/components/context-ring/ContextRing.d.ts +33 -0
- package/dist/components/context-ring/ContextRing.js +257 -0
- package/dist/components/context-ring/index.d.ts +2 -0
- package/dist/components/copy-button/CopyButton.d.ts +39 -0
- package/dist/components/copy-button/CopyButton.js +124 -0
- package/dist/components/copy-button/index.d.ts +2 -0
- package/dist/components/date-picker/DatePicker.d.ts +58 -0
- package/dist/components/date-picker/DatePicker.js +331 -0
- package/dist/components/date-picker/date-utils.d.ts +39 -0
- package/dist/components/date-picker/date-utils.js +85 -0
- package/dist/components/date-picker/index.d.ts +2 -0
- package/dist/components/dialog/Dialog.d.ts +29 -0
- package/dist/components/dialog/Dialog.js +105 -0
- package/dist/components/dialog/DialogSurface.d.ts +2 -0
- package/dist/components/dialog/DialogSurface.js +98 -0
- package/dist/components/dialog/index.d.ts +2 -0
- package/dist/components/dialog/types.d.ts +61 -0
- package/dist/components/dim-siblings/DimSiblings.d.ts +30 -0
- package/dist/components/dim-siblings/DimSiblings.js +47 -0
- package/dist/components/dim-siblings/index.d.ts +2 -0
- package/dist/components/direction-aware-hover/DirectionAwareHover.d.ts +10 -0
- package/dist/components/direction-aware-hover/DirectionAwareHover.js +185 -0
- package/dist/components/direction-aware-hover/index.d.ts +2 -0
- package/dist/components/displacement-text/DisplacementText.d.ts +26 -0
- package/dist/components/displacement-text/DisplacementText.js +185 -0
- package/dist/components/displacement-text/index.d.ts +2 -0
- package/dist/components/dock/Dock.d.ts +28 -0
- package/dist/components/dock/Dock.js +80 -0
- package/dist/components/dock/DockIcon.d.ts +17 -0
- package/dist/components/dock/DockIcon.js +38 -0
- package/dist/components/dock/DockSeparator.d.ts +6 -0
- package/dist/components/dock/DockSeparator.js +20 -0
- package/dist/components/dock/index.d.ts +7 -0
- package/dist/components/dock/types.d.ts +47 -0
- package/dist/components/dock/types.js +15 -0
- package/dist/components/drawer/Drawer.d.ts +34 -0
- package/dist/components/drawer/Drawer.js +237 -0
- package/dist/components/drawer/index.d.ts +2 -0
- package/dist/components/dropdown-menu/DropdownMenu.d.ts +38 -0
- package/dist/components/dropdown-menu/DropdownMenu.js +99 -0
- package/dist/components/dropdown-menu/DropdownMenuContent.d.ts +15 -0
- package/dist/components/dropdown-menu/DropdownMenuContent.js +111 -0
- package/dist/components/dropdown-menu/DropdownMenuItem.d.ts +26 -0
- package/dist/components/dropdown-menu/DropdownMenuItem.js +74 -0
- package/dist/components/dropdown-menu/DropdownMenuLabel.d.ts +15 -0
- package/dist/components/dropdown-menu/DropdownMenuLabel.js +18 -0
- package/dist/components/dropdown-menu/DropdownMenuSeparator.d.ts +6 -0
- package/dist/components/dropdown-menu/DropdownMenuSeparator.js +15 -0
- package/dist/components/dropdown-menu/DropdownMenuSub.d.ts +10 -0
- package/dist/components/dropdown-menu/DropdownMenuSub.js +110 -0
- package/dist/components/dropdown-menu/DropdownMenuSubContent.d.ts +15 -0
- package/dist/components/dropdown-menu/DropdownMenuSubContent.js +139 -0
- package/dist/components/dropdown-menu/DropdownMenuSubTrigger.d.ts +17 -0
- package/dist/components/dropdown-menu/DropdownMenuSubTrigger.js +104 -0
- package/dist/components/dropdown-menu/DropdownMenuTrigger.d.ts +16 -0
- package/dist/components/dropdown-menu/DropdownMenuTrigger.js +67 -0
- package/dist/components/dropdown-menu/index.d.ts +20 -0
- package/dist/components/dropdown-menu/menu-shared.d.ts +39 -0
- package/dist/components/dropdown-menu/menu-shared.js +48 -0
- package/dist/components/dropdown-menu/types.d.ts +159 -0
- package/dist/components/dropdown-menu/types.js +32 -0
- package/dist/components/editorial-engine/EditorialEngine.d.ts +21 -0
- package/dist/components/editorial-engine/EditorialEngine.js +68 -0
- package/dist/components/editorial-engine/engine.d.ts +7 -0
- package/dist/components/editorial-engine/engine.js +558 -0
- package/dist/components/editorial-engine/index.d.ts +2 -0
- package/dist/components/file-upload/FileUpload.d.ts +63 -0
- package/dist/components/file-upload/FileUpload.js +438 -0
- package/dist/components/file-upload/index.d.ts +2 -0
- package/dist/components/fireworks-hdr/FireworksHdr.d.ts +56 -0
- package/dist/components/fireworks-hdr/FireworksHdr.js +426 -0
- package/dist/components/fireworks-hdr/dev.d.ts +1 -0
- package/dist/components/fireworks-hdr/dev.js +8 -0
- package/dist/components/fireworks-hdr/fireworks-shared.d.ts +444 -0
- package/dist/components/fireworks-hdr/fireworks-shared.js +1205 -0
- package/dist/components/fireworks-hdr/index.d.ts +4 -0
- package/dist/components/fireworks-hdr/webgl2-renderer.d.ts +20 -0
- package/dist/components/fireworks-hdr/webgl2-renderer.js +517 -0
- package/dist/components/fireworks-hdr/webgpu-renderer.d.ts +51 -0
- package/dist/components/fireworks-hdr/webgpu-renderer.js +461 -0
- package/dist/components/fireworks-hdr/webgpu-types.d.ts +159 -0
- package/dist/components/flickering-grid/FlickeringGrid.d.ts +33 -0
- package/dist/components/flickering-grid/FlickeringGrid.js +154 -0
- package/dist/components/flickering-grid/index.d.ts +2 -0
- package/dist/components/flip-card/FlipCard.d.ts +8 -0
- package/dist/components/flip-card/FlipCard.js +35 -0
- package/dist/components/flip-card/index.d.ts +2 -0
- package/dist/components/flip-words/FlipWords.d.ts +16 -0
- package/dist/components/flip-words/FlipWords.js +82 -0
- package/dist/components/flip-words/index.d.ts +2 -0
- package/dist/components/fluid-cursor/FluidCursor.d.ts +61 -0
- package/dist/components/fluid-cursor/FluidCursor.js +1479 -0
- package/dist/components/fluid-cursor/fluid-shared.d.ts +74 -0
- package/dist/components/fluid-cursor/fluid-shared.js +120 -0
- package/dist/components/fluid-cursor/index.d.ts +8 -0
- package/dist/components/fluid-cursor/webgpu-engine.d.ts +36 -0
- package/dist/components/fluid-cursor/webgpu-engine.js +922 -0
- package/dist/components/focus/Focus.d.ts +24 -0
- package/dist/components/focus/Focus.js +103 -0
- package/dist/components/focus/index.d.ts +2 -0
- package/dist/components/form-field/FormField.d.ts +46 -0
- package/dist/components/form-field/FormField.js +151 -0
- package/dist/components/form-field/index.d.ts +2 -0
- package/dist/components/frosted-glass/FrostedGlass.d.ts +48 -0
- package/dist/components/frosted-glass/FrostedGlass.js +89 -0
- package/dist/components/frosted-glass/index.d.ts +2 -0
- package/dist/components/glare-card/GlareCard.d.ts +8 -0
- package/dist/components/glare-card/GlareCard.js +103 -0
- package/dist/components/glare-card/index.d.ts +2 -0
- package/dist/components/glow-border/GlowBorder.d.ts +8 -0
- package/dist/components/glow-border/GlowBorder.js +39 -0
- package/dist/components/glow-border/index.d.ts +2 -0
- package/dist/components/glowing-effect/GlowingEffect.d.ts +23 -0
- package/dist/components/glowing-effect/GlowingEffect.js +157 -0
- package/dist/components/glowing-effect/index.d.ts +2 -0
- package/dist/components/gradient-button/GradientButton.d.ts +28 -0
- package/dist/components/gradient-button/GradientButton.js +66 -0
- package/dist/components/gradient-button/index.d.ts +2 -0
- package/dist/components/hover-card/HoverCard.d.ts +57 -0
- package/dist/components/hover-card/HoverCard.js +139 -0
- package/dist/components/hover-card/index.d.ts +2 -0
- package/dist/components/hyper-text/HyperText.d.ts +25 -0
- package/dist/components/hyper-text/HyperText.js +102 -0
- package/dist/components/hyper-text/index.d.ts +2 -0
- package/dist/components/icon-button/IconButton.d.ts +46 -0
- package/dist/components/icon-button/IconButton.js +62 -0
- package/dist/components/icon-button/index.d.ts +2 -0
- package/dist/components/image-generation/ImageGeneration.d.ts +33 -0
- package/dist/components/image-generation/ImageGeneration.js +131 -0
- package/dist/components/image-generation/index.d.ts +2 -0
- package/dist/components/image-trail-cursor/ImageTrailCursor.d.ts +15 -0
- package/dist/components/image-trail-cursor/ImageTrailCursor.js +75 -0
- package/dist/components/image-trail-cursor/index.d.ts +3 -0
- package/dist/components/image-trail-cursor/trail-variants.d.ts +112 -0
- package/dist/components/image-trail-cursor/trail-variants.js +787 -0
- package/dist/components/inline-citation/InlineCitation.d.ts +23 -0
- package/dist/components/inline-citation/InlineCitation.js +179 -0
- package/dist/components/inline-citation/index.d.ts +2 -0
- package/dist/components/input/Input.d.ts +41 -0
- package/dist/components/input/Input.js +74 -0
- package/dist/components/input/index.d.ts +2 -0
- package/dist/components/interactive-grid-pattern/InteractiveGridPattern.d.ts +17 -0
- package/dist/components/interactive-grid-pattern/InteractiveGridPattern.js +89 -0
- package/dist/components/interactive-grid-pattern/index.d.ts +2 -0
- package/dist/components/interactive-hover-button/InteractiveHoverButton.d.ts +18 -0
- package/dist/components/interactive-hover-button/InteractiveHoverButton.js +66 -0
- package/dist/components/interactive-hover-button/index.d.ts +2 -0
- package/dist/components/label/Label.d.ts +18 -0
- package/dist/components/label/Label.js +28 -0
- package/dist/components/label/index.d.ts +2 -0
- package/dist/components/letter-pullup/LetterPullup.d.ts +16 -0
- package/dist/components/letter-pullup/LetterPullup.js +27 -0
- package/dist/components/letter-pullup/index.d.ts +2 -0
- package/dist/components/line-hover-link/LineHoverLink.d.ts +33 -0
- package/dist/components/line-hover-link/LineHoverLink.js +69 -0
- package/dist/components/line-hover-link/index.d.ts +2 -0
- package/dist/components/line-reveal/LineReveal.d.ts +31 -0
- package/dist/components/line-reveal/LineReveal.js +117 -0
- package/dist/components/line-reveal/index.d.ts +2 -0
- package/dist/components/line-shadow-text/LineShadowText.d.ts +18 -0
- package/dist/components/line-shadow-text/LineShadowText.js +26 -0
- package/dist/components/line-shadow-text/index.d.ts +2 -0
- package/dist/components/link/Link.d.ts +30 -0
- package/dist/components/link/Link.js +82 -0
- package/dist/components/link/index.d.ts +2 -0
- package/dist/components/liquid-glass/LiquidGlass.d.ts +49 -0
- package/dist/components/liquid-glass/LiquidGlass.js +165 -0
- package/dist/components/liquid-glass/index.d.ts +2 -0
- package/dist/components/liquid-text/LiquidText.d.ts +35 -0
- package/dist/components/liquid-text/LiquidText.js +882 -0
- package/dist/components/liquid-text/index.d.ts +2 -0
- package/dist/components/logo-cloud/AnimatedLogoCloud.d.ts +13 -0
- package/dist/components/logo-cloud/AnimatedLogoCloud.js +38 -0
- package/dist/components/logo-cloud/IconLogoCloud.d.ts +10 -0
- package/dist/components/logo-cloud/IconLogoCloud.js +20 -0
- package/dist/components/logo-cloud/StaticLogoCloud.d.ts +28 -0
- package/dist/components/logo-cloud/StaticLogoCloud.js +45 -0
- package/dist/components/logo-cloud/index.d.ts +6 -0
- package/dist/components/magnetic/Magnetic.d.ts +35 -0
- package/dist/components/magnetic/Magnetic.js +113 -0
- package/dist/components/magnetic/index.d.ts +2 -0
- package/dist/components/marquee/Marquee.d.ts +16 -0
- package/dist/components/marquee/Marquee.js +39 -0
- package/dist/components/marquee/ReviewCard.d.ts +8 -0
- package/dist/components/marquee/ReviewCard.js +17 -0
- package/dist/components/marquee/index.d.ts +4 -0
- package/dist/components/matrix-rain/MatrixRain.d.ts +35 -0
- package/dist/components/matrix-rain/MatrixRain.js +130 -0
- package/dist/components/matrix-rain/index.d.ts +2 -0
- package/dist/components/meteors/Meteors.d.ts +21 -0
- package/dist/components/meteors/Meteors.js +45 -0
- package/dist/components/meteors/index.d.ts +2 -0
- package/dist/components/mosaic-glow/MosaicGlow.d.ts +47 -0
- package/dist/components/mosaic-glow/MosaicGlow.js +438 -0
- package/dist/components/mosaic-glow/index.d.ts +2 -0
- package/dist/components/mosaic-glow/mosaic-glow-core.d.ts +94 -0
- package/dist/components/mosaic-glow/mosaic-glow-core.js +190 -0
- package/dist/components/navbar/Navbar.d.ts +25 -0
- package/dist/components/navbar/Navbar.js +27 -0
- package/dist/components/navbar/NavbarLink.d.ts +37 -0
- package/dist/components/navbar/NavbarLink.js +48 -0
- package/dist/components/navbar/index.d.ts +4 -0
- package/dist/components/navigation-menu/NavigationMenu.d.ts +28 -0
- package/dist/components/navigation-menu/NavigationMenu.js +202 -0
- package/dist/components/navigation-menu/NavigationMenuContent.d.ts +8 -0
- package/dist/components/navigation-menu/NavigationMenuContent.js +77 -0
- package/dist/components/navigation-menu/NavigationMenuItem.d.ts +20 -0
- package/dist/components/navigation-menu/NavigationMenuItem.js +18 -0
- package/dist/components/navigation-menu/NavigationMenuLink.d.ts +31 -0
- package/dist/components/navigation-menu/NavigationMenuLink.js +41 -0
- package/dist/components/navigation-menu/NavigationMenuList.d.ts +8 -0
- package/dist/components/navigation-menu/NavigationMenuList.js +33 -0
- package/dist/components/navigation-menu/NavigationMenuTrigger.d.ts +8 -0
- package/dist/components/navigation-menu/NavigationMenuTrigger.js +90 -0
- package/dist/components/navigation-menu/index.d.ts +14 -0
- package/dist/components/navigation-menu/types.d.ts +107 -0
- package/dist/components/navigation-menu/types.js +32 -0
- package/dist/components/neon-border/NeonBorder.d.ts +22 -0
- package/dist/components/neon-border/NeonBorder.js +50 -0
- package/dist/components/neon-border/index.d.ts +2 -0
- package/dist/components/noise-reveal/NoiseReveal.d.ts +29 -0
- package/dist/components/noise-reveal/NoiseReveal.js +329 -0
- package/dist/components/noise-reveal/index.d.ts +2 -0
- package/dist/components/number-input/NumberInput.d.ts +40 -0
- package/dist/components/number-input/NumberInput.js +207 -0
- package/dist/components/number-input/index.d.ts +2 -0
- package/dist/components/number-ticker/NumberTicker.d.ts +22 -0
- package/dist/components/number-ticker/NumberTicker.js +106 -0
- package/dist/components/number-ticker/index.d.ts +2 -0
- package/dist/components/pagination/Pagination.d.ts +43 -0
- package/dist/components/pagination/Pagination.js +156 -0
- package/dist/components/pagination/index.d.ts +2 -0
- package/dist/components/pagination/pagination-range.d.ts +11 -0
- package/dist/components/pagination/pagination-range.js +35 -0
- package/dist/components/password-input/PasswordInput.d.ts +56 -0
- package/dist/components/password-input/PasswordInput.js +246 -0
- package/dist/components/password-input/index.d.ts +2 -0
- package/dist/components/pixel-loader/PixelLoader.d.ts +18 -0
- package/dist/components/pixel-loader/PixelLoader.js +56 -0
- package/dist/components/pixel-loader/index.d.ts +2 -0
- package/dist/components/popover/Popover.d.ts +49 -0
- package/dist/components/popover/Popover.js +81 -0
- package/dist/components/popover/PopoverContent.d.ts +21 -0
- package/dist/components/popover/PopoverContent.js +78 -0
- package/dist/components/popover/index.d.ts +6 -0
- package/dist/components/popover/types.d.ts +64 -0
- package/dist/components/popover/types.js +17 -0
- package/dist/components/presence/Presence.d.ts +40 -0
- package/dist/components/presence/Presence.js +49 -0
- package/dist/components/presence/index.d.ts +2 -0
- package/dist/components/pressable/Pressable.d.ts +27 -0
- package/dist/components/pressable/Pressable.js +86 -0
- package/dist/components/pressable/index.d.ts +2 -0
- package/dist/components/prompt-suggestions/PromptSuggestions.d.ts +25 -0
- package/dist/components/prompt-suggestions/PromptSuggestions.js +68 -0
- package/dist/components/prompt-suggestions/index.d.ts +2 -0
- package/dist/components/pulse-beam/PulseBeam.d.ts +44 -0
- package/dist/components/pulse-beam/PulseBeam.js +197 -0
- package/dist/components/pulse-beam/index.d.ts +2 -0
- package/dist/components/pulse-beam/pulse-beam-data.d.ts +81 -0
- package/dist/components/pulse-beam/pulse-beam-data.js +306 -0
- package/dist/components/pulse-beam/pulse-beam-loop.d.ts +26 -0
- package/dist/components/pulse-beam/pulse-beam-loop.js +58 -0
- package/dist/components/radio-group/RadioGroup.d.ts +56 -0
- package/dist/components/radio-group/RadioGroup.js +82 -0
- package/dist/components/radio-group/RadioGroupItem.d.ts +21 -0
- package/dist/components/radio-group/RadioGroupItem.js +47 -0
- package/dist/components/radio-group/index.d.ts +6 -0
- package/dist/components/radio-group/types.d.ts +50 -0
- package/dist/components/radio-group/types.js +7 -0
- package/dist/components/rainbow-button/RainbowButton.d.ts +21 -0
- package/dist/components/rainbow-button/RainbowButton.js +59 -0
- package/dist/components/rainbow-button/index.d.ts +2 -0
- package/dist/components/reasoning-panel/ReasoningPanel.d.ts +38 -0
- package/dist/components/reasoning-panel/ReasoningPanel.js +172 -0
- package/dist/components/reasoning-panel/index.d.ts +2 -0
- package/dist/components/recommendation-card/RecommendationCard.d.ts +53 -0
- package/dist/components/recommendation-card/RecommendationCard.js +234 -0
- package/dist/components/recommendation-card/index.d.ts +2 -0
- package/dist/components/reveal/Reveal.d.ts +36 -0
- package/dist/components/reveal/Reveal.js +138 -0
- package/dist/components/reveal/index.d.ts +2 -0
- package/dist/components/ripple/Ripple.d.ts +11 -0
- package/dist/components/ripple/Ripple.js +45 -0
- package/dist/components/ripple/index.d.ts +2 -0
- package/dist/components/ripple-button/RippleButton.d.ts +17 -0
- package/dist/components/ripple-button/RippleButton.js +77 -0
- package/dist/components/ripple-button/index.d.ts +2 -0
- package/dist/components/scroll-anchor/ScrollAnchor.d.ts +33 -0
- package/dist/components/scroll-anchor/ScrollAnchor.js +99 -0
- package/dist/components/scroll-anchor/index.d.ts +2 -0
- package/dist/components/scroll-progress/ScrollProgress.d.ts +39 -0
- package/dist/components/scroll-progress/ScrollProgress.js +118 -0
- package/dist/components/scroll-progress/index.d.ts +2 -0
- package/dist/components/search-input/SearchInput.d.ts +56 -0
- package/dist/components/search-input/SearchInput.js +192 -0
- package/dist/components/search-input/index.d.ts +2 -0
- package/dist/components/select/Select.d.ts +44 -0
- package/dist/components/select/Select.js +255 -0
- package/dist/components/select/SelectPanel.d.ts +33 -0
- package/dist/components/select/SelectPanel.js +108 -0
- package/dist/components/select/index.d.ts +3 -0
- package/dist/components/select/types.d.ts +83 -0
- package/dist/components/select/types.js +8 -0
- package/dist/components/sheet/Sheet.d.ts +40 -0
- package/dist/components/sheet/Sheet.js +183 -0
- package/dist/components/sheet/index.d.ts +2 -0
- package/dist/components/shimmer-button/ShimmerButton.d.ts +26 -0
- package/dist/components/shimmer-button/ShimmerButton.js +69 -0
- package/dist/components/shimmer-button/index.d.ts +2 -0
- package/dist/components/sidebar/Sidebar.d.ts +17 -0
- package/dist/components/sidebar/Sidebar.js +27 -0
- package/dist/components/sidebar/SidebarFooter.d.ts +10 -0
- package/dist/components/sidebar/SidebarFooter.js +31 -0
- package/dist/components/sidebar/SidebarGroup.d.ts +10 -0
- package/dist/components/sidebar/SidebarGroup.js +28 -0
- package/dist/components/sidebar/SidebarItem.d.ts +33 -0
- package/dist/components/sidebar/SidebarItem.js +81 -0
- package/dist/components/sidebar/SidebarSeparator.d.ts +5 -0
- package/dist/components/sidebar/SidebarSeparator.js +13 -0
- package/dist/components/sidebar/index.d.ts +12 -0
- package/dist/components/sidebar/types.d.ts +36 -0
- package/dist/components/sidebar/types.js +7 -0
- package/dist/components/skeleton/Skeleton.d.ts +35 -0
- package/dist/components/skeleton/Skeleton.js +106 -0
- package/dist/components/skeleton/index.d.ts +2 -0
- package/dist/components/slider/Slider.d.ts +32 -0
- package/dist/components/slider/Slider.js +119 -0
- package/dist/components/slider/index.d.ts +2 -0
- package/dist/components/smooth-cursor/SmoothCursor.d.ts +18 -0
- package/dist/components/smooth-cursor/SmoothCursor.js +186 -0
- package/dist/components/smooth-cursor/index.d.ts +2 -0
- package/dist/components/sources/SourceCard.d.ts +21 -0
- package/dist/components/sources/SourceCard.js +48 -0
- package/dist/components/sources/Sources.d.ts +31 -0
- package/dist/components/sources/Sources.js +39 -0
- package/dist/components/sources/SourcesList.d.ts +13 -0
- package/dist/components/sources/SourcesList.js +42 -0
- package/dist/components/sources/SourcesTrigger.d.ts +11 -0
- package/dist/components/sources/SourcesTrigger.js +50 -0
- package/dist/components/sources/index.d.ts +10 -0
- package/dist/components/sources/types.d.ts +45 -0
- package/dist/components/sources/types.js +7 -0
- package/dist/components/sparkles/Sparkles.d.ts +35 -0
- package/dist/components/sparkles/Sparkles.js +112 -0
- package/dist/components/sparkles/index.d.ts +2 -0
- package/dist/components/sparkles-text/SparklesText.d.ts +28 -0
- package/dist/components/sparkles-text/SparklesText.js +84 -0
- package/dist/components/sparkles-text/index.d.ts +2 -0
- package/dist/components/status-morph/StatusMorph.d.ts +47 -0
- package/dist/components/status-morph/StatusMorph.js +110 -0
- package/dist/components/status-morph/index.d.ts +2 -0
- package/dist/components/stepper/Step.d.ts +24 -0
- package/dist/components/stepper/Step.js +152 -0
- package/dist/components/stepper/Stepper.d.ts +38 -0
- package/dist/components/stepper/Stepper.js +79 -0
- package/dist/components/stepper/index.d.ts +6 -0
- package/dist/components/stepper/types.d.ts +66 -0
- package/dist/components/stepper/types.js +7 -0
- package/dist/components/sticky-scroll/StickyScroll.d.ts +40 -0
- package/dist/components/sticky-scroll/StickyScroll.js +163 -0
- package/dist/components/sticky-scroll/index.d.ts +2 -0
- package/dist/components/streaming-text/StreamingText.d.ts +20 -0
- package/dist/components/streaming-text/StreamingText.js +32 -0
- package/dist/components/streaming-text/index.d.ts +2 -0
- package/dist/components/subagent-list/SubagentList.d.ts +28 -0
- package/dist/components/subagent-list/SubagentList.js +167 -0
- package/dist/components/subagent-list/index.d.ts +2 -0
- package/dist/components/switch/Switch.d.ts +55 -0
- package/dist/components/switch/Switch.js +77 -0
- package/dist/components/switch/index.d.ts +2 -0
- package/dist/components/tabs/Tabs.d.ts +43 -0
- package/dist/components/tabs/Tabs.js +123 -0
- package/dist/components/tabs/TabsContent.d.ts +26 -0
- package/dist/components/tabs/TabsContent.js +64 -0
- package/dist/components/tabs/TabsList.d.ts +16 -0
- package/dist/components/tabs/TabsList.js +152 -0
- package/dist/components/tabs/TabsTrigger.d.ts +19 -0
- package/dist/components/tabs/TabsTrigger.js +138 -0
- package/dist/components/tabs/index.d.ts +10 -0
- package/dist/components/tabs/types.d.ts +94 -0
- package/dist/components/tabs/types.js +7 -0
- package/dist/components/terminal-block/TerminalBlock.d.ts +27 -0
- package/dist/components/terminal-block/TerminalBlock.js +120 -0
- package/dist/components/terminal-block/ansi.d.ts +30 -0
- package/dist/components/terminal-block/ansi.js +114 -0
- package/dist/components/terminal-block/index.d.ts +2 -0
- package/dist/components/terminal-text/TerminalText.d.ts +11 -0
- package/dist/components/terminal-text/TerminalText.js +140 -0
- package/dist/components/terminal-text/index.d.ts +2 -0
- package/dist/components/text-generate-effect/TextGenerateEffect.d.ts +9 -0
- package/dist/components/text-generate-effect/TextGenerateEffect.js +58 -0
- package/dist/components/text-generate-effect/index.d.ts +2 -0
- package/dist/components/text-reveal-card/TextRevealCard.d.ts +21 -0
- package/dist/components/text-reveal-card/TextRevealCard.js +107 -0
- package/dist/components/text-reveal-card/TextRevealStars.d.ts +25 -0
- package/dist/components/text-reveal-card/TextRevealStars.js +59 -0
- package/dist/components/text-reveal-card/index.d.ts +4 -0
- package/dist/components/text-roll/TextRoll.d.ts +43 -0
- package/dist/components/text-roll/TextRoll.js +242 -0
- package/dist/components/text-roll/index.d.ts +2 -0
- package/dist/components/text-roll/roll-transitions.d.ts +74 -0
- package/dist/components/text-roll/roll-transitions.js +31 -0
- package/dist/components/textarea/Textarea.d.ts +48 -0
- package/dist/components/textarea/Textarea.js +129 -0
- package/dist/components/textarea/index.d.ts +2 -0
- package/dist/components/thinking-indicator/ThinkingIndicator.d.ts +26 -0
- package/dist/components/thinking-indicator/ThinkingIndicator.js +60 -0
- package/dist/components/thinking-indicator/index.d.ts +2 -0
- package/dist/components/thread-list/ThreadList.d.ts +44 -0
- package/dist/components/thread-list/ThreadList.js +178 -0
- package/dist/components/thread-list/index.d.ts +2 -0
- package/dist/components/time-picker/TimePicker.d.ts +44 -0
- package/dist/components/time-picker/TimePicker.js +254 -0
- package/dist/components/time-picker/TimePickerPanel.d.ts +30 -0
- package/dist/components/time-picker/TimePickerPanel.js +94 -0
- package/dist/components/time-picker/index.d.ts +2 -0
- package/dist/components/time-picker/time-utils.d.ts +33 -0
- package/dist/components/time-picker/time-utils.js +65 -0
- package/dist/components/time-picker/types.d.ts +53 -0
- package/dist/components/time-picker/types.js +10 -0
- package/dist/components/timeline/Timeline.d.ts +18 -0
- package/dist/components/timeline/Timeline.js +96 -0
- package/dist/components/timeline/index.d.ts +2 -0
- package/dist/components/toast/Toast.d.ts +16 -0
- package/dist/components/toast/Toast.js +99 -0
- package/dist/components/toast/Toaster.d.ts +19 -0
- package/dist/components/toast/Toaster.js +147 -0
- package/dist/components/toast/index.d.ts +6 -0
- package/dist/components/toast/store.d.ts +102 -0
- package/dist/components/toast/store.js +118 -0
- package/dist/components/toggle/Toggle.d.ts +28 -0
- package/dist/components/toggle/Toggle.js +69 -0
- package/dist/components/toggle/index.d.ts +2 -0
- package/dist/components/toggle-group/ToggleGroup.d.ts +42 -0
- package/dist/components/toggle-group/ToggleGroup.js +150 -0
- package/dist/components/toggle-group/ToggleGroupItem.d.ts +21 -0
- package/dist/components/toggle-group/ToggleGroupItem.js +100 -0
- package/dist/components/toggle-group/index.d.ts +6 -0
- package/dist/components/toggle-group/types.d.ts +75 -0
- package/dist/components/toggle-group/types.js +7 -0
- package/dist/components/tool-call/ToolCall.d.ts +39 -0
- package/dist/components/tool-call/ToolCall.js +195 -0
- package/dist/components/tool-call/index.d.ts +2 -0
- package/dist/components/tool-timeline/ToolTimeline.d.ts +31 -0
- package/dist/components/tool-timeline/ToolTimeline.js +99 -0
- package/dist/components/tool-timeline/index.d.ts +2 -0
- package/dist/components/tooltip/Tooltip.d.ts +36 -0
- package/dist/components/tooltip/Tooltip.js +214 -0
- package/dist/components/tooltip/index.d.ts +2 -0
- package/dist/components/tracing-beam/TracingBeam.d.ts +11 -0
- package/dist/components/tracing-beam/TracingBeam.js +163 -0
- package/dist/components/tracing-beam/index.d.ts +2 -0
- package/dist/components/typing-indicator/TypingIndicator.d.ts +17 -0
- package/dist/components/typing-indicator/TypingIndicator.js +47 -0
- package/dist/components/typing-indicator/index.d.ts +2 -0
- package/dist/components/voice-input/VoiceInput.d.ts +60 -0
- package/dist/components/voice-input/VoiceInput.js +268 -0
- package/dist/components/voice-input/index.d.ts +2 -0
- package/dist/components/web-search/WebSearch.d.ts +37 -0
- package/dist/components/web-search/WebSearch.js +135 -0
- package/dist/components/web-search/index.d.ts +2 -0
- package/dist/index.d.ts +148 -0
- package/dist/index.js +489 -0
- package/dist/internals/Portal.d.ts +35 -0
- package/dist/internals/Portal.js +37 -0
- package/dist/internals/StreamText.d.ts +20 -0
- package/dist/internals/StreamText.js +25 -0
- package/dist/internals/ai-types.d.ts +117 -0
- package/dist/internals/anchor-position.d.ts +79 -0
- package/dist/internals/anchor-position.js +154 -0
- package/dist/internals/calendar-core.d.ts +26 -0
- package/dist/internals/calendar-core.js +57 -0
- package/dist/internals/diff.d.ts +38 -0
- package/dist/internals/diff.js +176 -0
- package/dist/internals/dismissable.d.ts +76 -0
- package/dist/internals/dismissable.js +105 -0
- package/dist/internals/dom/context.d.ts +16 -0
- package/dist/internals/dom/context.js +20 -0
- package/dist/internals/dom/ssr.d.ts +21 -0
- package/dist/internals/dom/ssr.js +21 -0
- package/dist/internals/dom/types.d.ts +9 -0
- package/dist/internals/dom/use-composed-refs.d.ts +15 -0
- package/dist/internals/dom/use-composed-refs.js +34 -0
- package/dist/internals/dom/use-element-ref.d.ts +11 -0
- package/dist/internals/dom/use-element-ref.js +12 -0
- package/dist/internals/dom/use-event-callback.d.ts +14 -0
- package/dist/internals/dom/use-event-callback.js +12 -0
- package/dist/internals/dom/use-inert-attribute.d.ts +26 -0
- package/dist/internals/dom/use-inert-attribute.js +22 -0
- package/dist/internals/dom/use-live-ref.d.ts +10 -0
- package/dist/internals/dom/use-live-ref.js +12 -0
- package/dist/internals/field.d.ts +136 -0
- package/dist/internals/field.js +33 -0
- package/dist/internals/float.d.ts +47 -0
- package/dist/internals/float.js +31 -0
- package/dist/internals/focus-trap.d.ts +82 -0
- package/dist/internals/focus-trap.js +145 -0
- package/dist/internals/host.d.ts +38 -0
- package/dist/internals/host.js +24 -0
- package/dist/internals/listbox.d.ts +101 -0
- package/dist/internals/listbox.js +171 -0
- package/dist/internals/markdown/Markdown.d.ts +22 -0
- package/dist/internals/markdown/Markdown.js +53 -0
- package/dist/internals/markdown/MarkdownInline.d.ts +5 -0
- package/dist/internals/markdown/MarkdownInline.js +40 -0
- package/dist/internals/markdown.d.ts +66 -0
- package/dist/internals/markdown.js +467 -0
- package/dist/internals/menu.d.ts +121 -0
- package/dist/internals/menu.js +217 -0
- package/dist/internals/motion/anchored.d.ts +104 -0
- package/dist/internals/motion/anchored.js +44 -0
- package/dist/internals/motion/animate.d.ts +92 -0
- package/dist/internals/motion/animate.js +84 -0
- package/dist/internals/motion/easing.d.ts +20 -0
- package/dist/internals/motion/easing.js +13 -0
- package/dist/internals/motion/haptics.d.ts +42 -0
- package/dist/internals/motion/haptics.js +29 -0
- package/dist/internals/motion/in-view.d.ts +67 -0
- package/dist/internals/motion/in-view.js +97 -0
- package/dist/internals/motion/media-query.d.ts +50 -0
- package/dist/internals/motion/media-query.js +54 -0
- package/dist/internals/motion/presence.d.ts +108 -0
- package/dist/internals/motion/presence.js +197 -0
- package/dist/internals/motion/presets.d.ts +34 -0
- package/dist/internals/motion/presets.js +19 -0
- package/dist/internals/motion/raf.d.ts +35 -0
- package/dist/internals/motion/raf.js +27 -0
- package/dist/internals/motion/stagger.d.ts +32 -0
- package/dist/internals/motion/stagger.js +15 -0
- package/dist/internals/motion/tokens.d.ts +97 -0
- package/dist/internals/motion/tokens.js +18 -0
- package/dist/internals/motion/transitions.d.ts +66 -0
- package/dist/internals/motion/transitions.js +41 -0
- package/dist/internals/motion/types.d.ts +17 -0
- package/dist/internals/relative-time.d.ts +25 -0
- package/dist/internals/relative-time.js +46 -0
- package/dist/internals/scroll-lock.d.ts +26 -0
- package/dist/internals/scroll-lock.js +65 -0
- package/dist/internals/use-anchor-position.d.ts +54 -0
- package/dist/internals/use-anchor-position.js +87 -0
- package/dist/internals/use-autoscroll.d.ts +43 -0
- package/dist/internals/use-autoscroll.js +128 -0
- package/dist/internals/use-copy.d.ts +54 -0
- package/dist/internals/use-copy.js +67 -0
- package/dist/internals/use-elapsed.d.ts +96 -0
- package/dist/internals/use-elapsed.js +195 -0
- package/dist/internals/use-float.d.ts +49 -0
- package/dist/internals/use-float.js +150 -0
- package/dist/internals/use-id.d.ts +22 -0
- package/dist/internals/use-id.js +20 -0
- package/dist/internals/use-text-stream.d.ts +94 -0
- package/dist/internals/use-text-stream.js +133 -0
- package/dist/internals/waveform-core.d.ts +33 -0
- package/dist/internals/waveform-core.js +39 -0
- package/dist/sound/SoundToggle.d.ts +23 -0
- package/dist/sound/SoundToggle.js +96 -0
- package/dist/sound/engine.d.ts +67 -0
- package/dist/sound/engine.js +370 -0
- package/dist/sound/index.d.ts +7 -0
- package/dist/sound/sound-feedback.d.ts +77 -0
- package/dist/sound/sound-feedback.js +152 -0
- package/dist/sound/sound.d.ts +98 -0
- package/dist/sound/sound.js +309 -0
- package/dist/sound/themes.d.ts +19 -0
- package/dist/sound/themes.js +355 -0
- package/dist/sound/types.d.ts +125 -0
- package/dist/sound/types.js +54 -0
- package/dist/sound/use-sound.d.ts +53 -0
- package/dist/sound/use-sound.js +82 -0
- package/dist/styles.css +7975 -0
- package/dist/utils.d.ts +3 -0
- package/dist/utils.js +8 -0
- package/package.json +96 -0
- package/tailwind.css +132 -0
|
@@ -0,0 +1,1205 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const STRIDE = 17;
|
|
3
|
+
const F = {
|
|
4
|
+
posX: 0,
|
|
5
|
+
posY: 1,
|
|
6
|
+
velX: 2,
|
|
7
|
+
velY: 3,
|
|
8
|
+
age: 4,
|
|
9
|
+
ttl: 5,
|
|
10
|
+
size: 6,
|
|
11
|
+
r: 7,
|
|
12
|
+
g: 8,
|
|
13
|
+
b: 9,
|
|
14
|
+
brightness: 10,
|
|
15
|
+
type: 11,
|
|
16
|
+
seed: 12,
|
|
17
|
+
targetX: 13,
|
|
18
|
+
targetY: 14,
|
|
19
|
+
dragScale: 15,
|
|
20
|
+
/**
|
|
21
|
+
* Per-particle depth dim in (0,1] — the launch's `depth` folded into a
|
|
22
|
+
* single multiplier applied to the resolved brightness every frame (§3.6).
|
|
23
|
+
* Defaults to 1 for every spawn (see `appendParticle`), so only depth-aware
|
|
24
|
+
* spawns need to write it.
|
|
25
|
+
*/
|
|
26
|
+
depthDim: 16
|
|
27
|
+
};
|
|
28
|
+
const TYPE = {
|
|
29
|
+
ROCKET: 0,
|
|
30
|
+
SPARK: 1,
|
|
31
|
+
EMBER: 2,
|
|
32
|
+
SMOKE: 3,
|
|
33
|
+
FLASH: 4,
|
|
34
|
+
SEEKER: 5
|
|
35
|
+
};
|
|
36
|
+
const G = 3.6;
|
|
37
|
+
const DT_MAX = 0.033;
|
|
38
|
+
const LAUNCH_Y = [1.02, 1.08];
|
|
39
|
+
const LAUNCH_X = [0.08, 0.92];
|
|
40
|
+
const EXPOSURE_AMBIENT = 2.2;
|
|
41
|
+
const SDR_KNEE_START = 0.8;
|
|
42
|
+
const SDR_CORE_SCALE = 1.4;
|
|
43
|
+
const SDR_SAT_BOOST = 0.12;
|
|
44
|
+
const STRETCH = 0.01;
|
|
45
|
+
const B_FLASH_INTRO = 3.4;
|
|
46
|
+
const B_FLASH_AMBIENT = 2.1;
|
|
47
|
+
const B_SPARK_FRESH = 2.2;
|
|
48
|
+
const B_SPARK_STEADY = 0.9;
|
|
49
|
+
const B_SPARK_TERMINAL = 0.15;
|
|
50
|
+
const B_ASCENT_HEAD = 2.8;
|
|
51
|
+
const B_ASCENT_TAIL = 0.45;
|
|
52
|
+
const B_EMBER_MEAN = 0.35;
|
|
53
|
+
const B_SMOKE_MIN = 0.05;
|
|
54
|
+
const B_SMOKE_MAX = 0.12;
|
|
55
|
+
const B_GLYPH_HOLD = 1.3;
|
|
56
|
+
const B_GLYPH_RELEASE = 2.6;
|
|
57
|
+
const CRACKLE_HZ = 24;
|
|
58
|
+
const PALETTE_HEX = ["#42cfff", "#3d5bff", "#a142ff", "#ff2fd6"];
|
|
59
|
+
const COOL_END_HEX = "#ffcf9c";
|
|
60
|
+
const MAGNESIUM_HEX = "#f4f8ff";
|
|
61
|
+
const COMET_HEAD_HEX = "#fff2e0";
|
|
62
|
+
const SMOKE_HEX = "#0a0b10";
|
|
63
|
+
const SHELL_JITTER_DEG = 7;
|
|
64
|
+
const SPARK_JITTER_DEG = 3;
|
|
65
|
+
const ROCKET_WOBBLE_AMP = 0.045;
|
|
66
|
+
const ROCKET_WOBBLE_HZ = 11;
|
|
67
|
+
const HUE_ARRIVES_AT = 0.34;
|
|
68
|
+
const COOL_START = 0.72;
|
|
69
|
+
const CRACKLE_FRAC = 0.06;
|
|
70
|
+
const DEPTH_DIM = 0.45;
|
|
71
|
+
const DEPTH_SIZE = 0.5;
|
|
72
|
+
const DEPTH_CHROMA = 0.35;
|
|
73
|
+
const DEPTH_RADIUS = 0.25;
|
|
74
|
+
const WIND_X = [0.02, 0.05];
|
|
75
|
+
const WIND_Y = [0.01, 0.02];
|
|
76
|
+
const WIND_SCALE = {
|
|
77
|
+
[TYPE.ROCKET]: 0.05,
|
|
78
|
+
[TYPE.SPARK]: 0.3,
|
|
79
|
+
[TYPE.EMBER]: 0.7,
|
|
80
|
+
[TYPE.SMOKE]: 1,
|
|
81
|
+
[TYPE.FLASH]: 0,
|
|
82
|
+
[TYPE.SEEKER]: 0.4
|
|
83
|
+
};
|
|
84
|
+
const GRAV_SCALE = {
|
|
85
|
+
[TYPE.ROCKET]: 1,
|
|
86
|
+
[TYPE.SPARK]: 0.15,
|
|
87
|
+
[TYPE.EMBER]: 0.3,
|
|
88
|
+
[TYPE.SMOKE]: -0.05,
|
|
89
|
+
[TYPE.FLASH]: 0,
|
|
90
|
+
[TYPE.SEEKER]: 0
|
|
91
|
+
// gravity is phase-driven for seekers
|
|
92
|
+
};
|
|
93
|
+
const DRAG = {
|
|
94
|
+
[TYPE.ROCKET]: 0.6,
|
|
95
|
+
[TYPE.SPARK]: 2.2,
|
|
96
|
+
[TYPE.EMBER]: 2.4,
|
|
97
|
+
[TYPE.SMOKE]: 3,
|
|
98
|
+
[TYPE.FLASH]: 0,
|
|
99
|
+
[TYPE.SEEKER]: 1.2
|
|
100
|
+
};
|
|
101
|
+
const BURST_SPEED_K = 3;
|
|
102
|
+
const QUALITY = {
|
|
103
|
+
high: { maxParticles: 4096, trailRate: 180 },
|
|
104
|
+
mid: { maxParticles: 2560, trailRate: 120 },
|
|
105
|
+
low: { maxParticles: 1280, trailRate: 60 }
|
|
106
|
+
};
|
|
107
|
+
const SHELL = {
|
|
108
|
+
peony: {
|
|
109
|
+
counts: { high: 320, mid: 200, low: 120 },
|
|
110
|
+
emberFrac: 0.15,
|
|
111
|
+
smoke: 1,
|
|
112
|
+
radius: [0.1, 0.2],
|
|
113
|
+
builder: "sphere"
|
|
114
|
+
},
|
|
115
|
+
willow: {
|
|
116
|
+
counts: { high: 200, mid: 130, low: 80 },
|
|
117
|
+
emberFrac: 0.8,
|
|
118
|
+
smoke: 1,
|
|
119
|
+
radius: [0.14, 0.22],
|
|
120
|
+
builder: "willow"
|
|
121
|
+
},
|
|
122
|
+
ring: {
|
|
123
|
+
counts: { high: 180, mid: 120, low: 70 },
|
|
124
|
+
emberFrac: 0.1,
|
|
125
|
+
smoke: 0,
|
|
126
|
+
radius: [0.12, 0.2],
|
|
127
|
+
builder: "ring"
|
|
128
|
+
},
|
|
129
|
+
glyph: {
|
|
130
|
+
counts: { high: 0, mid: 0, low: 0 },
|
|
131
|
+
// driven by glyphPoints + garnish
|
|
132
|
+
emberFrac: 0,
|
|
133
|
+
smoke: 1,
|
|
134
|
+
radius: [0.14, 0.14],
|
|
135
|
+
builder: "glyph"
|
|
136
|
+
},
|
|
137
|
+
// Pattern shells: the figure IS the shell, so they run denser than a peony of
|
|
138
|
+
// the same radius (an outline needs particles per unit of arc, not per unit of
|
|
139
|
+
// volume) and suppress everything that would blur it.
|
|
140
|
+
heart: {
|
|
141
|
+
counts: { high: 260, mid: 170, low: 100 },
|
|
142
|
+
emberFrac: 0.05,
|
|
143
|
+
smoke: 1,
|
|
144
|
+
radius: [0.13, 0.2],
|
|
145
|
+
builder: "outline",
|
|
146
|
+
outline: heartOutline,
|
|
147
|
+
crisp: true
|
|
148
|
+
},
|
|
149
|
+
star: {
|
|
150
|
+
counts: { high: 240, mid: 160, low: 95 },
|
|
151
|
+
emberFrac: 0.05,
|
|
152
|
+
smoke: 1,
|
|
153
|
+
radius: [0.13, 0.2],
|
|
154
|
+
builder: "outline",
|
|
155
|
+
outline: starOutline(5, 0.45),
|
|
156
|
+
crisp: true
|
|
157
|
+
},
|
|
158
|
+
// Caller-supplied figure — see LaunchOptions.shapePoints.
|
|
159
|
+
shape: {
|
|
160
|
+
counts: { high: 260, mid: 170, low: 100 },
|
|
161
|
+
emberFrac: 0.05,
|
|
162
|
+
smoke: 1,
|
|
163
|
+
radius: [0.13, 0.2],
|
|
164
|
+
builder: "outline",
|
|
165
|
+
crisp: true
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
const AMBIENT_RADIUS_MAX = 0.2;
|
|
169
|
+
const AMBIENT_ZONES = [
|
|
170
|
+
{ rect: { x0: 0.04, y0: 0.08, x1: 0.34, y1: 0.4 }, weight: 0.28 },
|
|
171
|
+
// UL
|
|
172
|
+
{ rect: { x0: 0.66, y0: 0.08, x1: 0.96, y1: 0.4 }, weight: 0.28 },
|
|
173
|
+
// UR
|
|
174
|
+
{ rect: { x0: 0.34, y0: 0.05, x1: 0.66, y1: 0.24 }, weight: 0.18 },
|
|
175
|
+
// TC
|
|
176
|
+
{ rect: { x0: 0.02, y0: 0.34, x1: 0.2, y1: 0.62 }, weight: 0.13 },
|
|
177
|
+
// LM
|
|
178
|
+
{ rect: { x0: 0.8, y0: 0.34, x1: 0.98, y1: 0.62 }, weight: 0.13 }
|
|
179
|
+
// RM
|
|
180
|
+
];
|
|
181
|
+
const KEEP_CLEAR_DESKTOP = { x0: 0.28, y0: 0.3, x1: 0.72, y1: 0.82 };
|
|
182
|
+
const KEEP_CLEAR_DIM = 0.35;
|
|
183
|
+
function fract(x) {
|
|
184
|
+
return x - Math.floor(x);
|
|
185
|
+
}
|
|
186
|
+
function hash11(x) {
|
|
187
|
+
return fract(Math.sin(x * 127.1) * 43758.5453);
|
|
188
|
+
}
|
|
189
|
+
function flickerNoise(seed, ageSec, freqHz) {
|
|
190
|
+
const t = ageSec * freqHz;
|
|
191
|
+
const i = Math.floor(t);
|
|
192
|
+
const f = t - i;
|
|
193
|
+
const a = hash11(seed + i);
|
|
194
|
+
const b = hash11(seed + i + 1);
|
|
195
|
+
const u = f * f * (3 - 2 * f);
|
|
196
|
+
return a + (b - a) * u;
|
|
197
|
+
}
|
|
198
|
+
function smoothstep(edge0, edge1, x) {
|
|
199
|
+
const t = Math.max(0, Math.min(1, (x - edge0) / (edge1 - edge0)));
|
|
200
|
+
return t * t * (3 - 2 * t);
|
|
201
|
+
}
|
|
202
|
+
function deathGate(lifeT) {
|
|
203
|
+
return smoothstep(1, 0.9, lifeT);
|
|
204
|
+
}
|
|
205
|
+
function srgbToLinear(c) {
|
|
206
|
+
return c <= 0.04045 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
|
|
207
|
+
}
|
|
208
|
+
function hexToLinearRgb(hex) {
|
|
209
|
+
const m = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
210
|
+
if (!m) return { r: 1, g: 1, b: 1 };
|
|
211
|
+
return {
|
|
212
|
+
r: srgbToLinear(parseInt(m[1], 16) / 255),
|
|
213
|
+
g: srgbToLinear(parseInt(m[2], 16) / 255),
|
|
214
|
+
b: srgbToLinear(parseInt(m[3], 16) / 255)
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
const _okA = { L: 0, a: 0, b: 0 };
|
|
218
|
+
const _okB = { L: 0, a: 0, b: 0 };
|
|
219
|
+
const _okMix = { L: 0, a: 0, b: 0 };
|
|
220
|
+
const _sparkHue = { r: 0, g: 0, b: 0 };
|
|
221
|
+
function linearToOklabInto(c, out) {
|
|
222
|
+
const l = 0.4122214708 * c.r + 0.5363325363 * c.g + 0.0514459929 * c.b;
|
|
223
|
+
const m = 0.2119034982 * c.r + 0.6806995451 * c.g + 0.1073969566 * c.b;
|
|
224
|
+
const s = 0.0883024619 * c.r + 0.2817188376 * c.g + 0.6299787005 * c.b;
|
|
225
|
+
const l_ = Math.cbrt(l);
|
|
226
|
+
const m_ = Math.cbrt(m);
|
|
227
|
+
const s_ = Math.cbrt(s);
|
|
228
|
+
out.L = 0.2104542553 * l_ + 0.793617785 * m_ - 0.0040720468 * s_;
|
|
229
|
+
out.a = 1.9779984951 * l_ - 2.428592205 * m_ + 0.4505937099 * s_;
|
|
230
|
+
out.b = 0.0259040371 * l_ + 0.7827717662 * m_ - 0.808675766 * s_;
|
|
231
|
+
}
|
|
232
|
+
function oklabToLinearInto(o, out) {
|
|
233
|
+
const l_ = o.L + 0.3963377774 * o.a + 0.2158037573 * o.b;
|
|
234
|
+
const m_ = o.L - 0.1055613458 * o.a - 0.0638541728 * o.b;
|
|
235
|
+
const s_ = o.L - 0.0894841775 * o.a - 1.291485548 * o.b;
|
|
236
|
+
const l = l_ * l_ * l_;
|
|
237
|
+
const m = m_ * m_ * m_;
|
|
238
|
+
const s = s_ * s_ * s_;
|
|
239
|
+
out.r = 4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s;
|
|
240
|
+
out.g = -1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s;
|
|
241
|
+
out.b = -0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s;
|
|
242
|
+
}
|
|
243
|
+
function hueRotateInto(c, deg, out) {
|
|
244
|
+
linearToOklabInto(c, _okA);
|
|
245
|
+
const chroma = Math.hypot(_okA.a, _okA.b);
|
|
246
|
+
const h = Math.atan2(_okA.b, _okA.a) + deg * Math.PI / 180;
|
|
247
|
+
_okMix.L = _okA.L;
|
|
248
|
+
_okMix.a = chroma * Math.cos(h);
|
|
249
|
+
_okMix.b = chroma * Math.sin(h);
|
|
250
|
+
oklabToLinearInto(_okMix, out);
|
|
251
|
+
}
|
|
252
|
+
function mixOklabInto(a, b, t, out) {
|
|
253
|
+
linearToOklabInto(a, _okA);
|
|
254
|
+
linearToOklabInto(b, _okB);
|
|
255
|
+
_okMix.L = _okA.L + (_okB.L - _okA.L) * t;
|
|
256
|
+
_okMix.a = _okA.a + (_okB.a - _okA.a) * t;
|
|
257
|
+
_okMix.b = _okA.b + (_okB.b - _okA.b) * t;
|
|
258
|
+
oklabToLinearInto(_okMix, out);
|
|
259
|
+
}
|
|
260
|
+
function linearToOklab(c) {
|
|
261
|
+
const out = { L: 0, a: 0, b: 0 };
|
|
262
|
+
linearToOklabInto(c, out);
|
|
263
|
+
return out;
|
|
264
|
+
}
|
|
265
|
+
function oklabToLinear(o) {
|
|
266
|
+
const out = { r: 0, g: 0, b: 0 };
|
|
267
|
+
oklabToLinearInto(o, out);
|
|
268
|
+
return out;
|
|
269
|
+
}
|
|
270
|
+
function hueRotate(c, deg) {
|
|
271
|
+
const out = { r: 0, g: 0, b: 0 };
|
|
272
|
+
hueRotateInto(c, deg, out);
|
|
273
|
+
return out;
|
|
274
|
+
}
|
|
275
|
+
function scaleChroma(c, k) {
|
|
276
|
+
const o = linearToOklab(c);
|
|
277
|
+
return oklabToLinear({ L: o.L, a: o.a * k, b: o.b * k });
|
|
278
|
+
}
|
|
279
|
+
function mixOklab(a, b, t) {
|
|
280
|
+
const out = { r: 0, g: 0, b: 0 };
|
|
281
|
+
mixOklabInto(a, b, t, out);
|
|
282
|
+
return out;
|
|
283
|
+
}
|
|
284
|
+
function sparkColorAtLifeInto(shellHue, lifeT, whiteHold, seed, out) {
|
|
285
|
+
hueRotateInto(shellHue, (hash11(seed) * 2 - 1) * SPARK_JITTER_DEG, _sparkHue);
|
|
286
|
+
if (lifeT <= whiteHold) {
|
|
287
|
+
out.r = MAGNESIUM.r;
|
|
288
|
+
out.g = MAGNESIUM.g;
|
|
289
|
+
out.b = MAGNESIUM.b;
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
if (lifeT < HUE_ARRIVES_AT) {
|
|
293
|
+
const t2 = (lifeT - whiteHold) / (HUE_ARRIVES_AT - whiteHold);
|
|
294
|
+
mixOklabInto(MAGNESIUM, _sparkHue, Math.min(1, t2), out);
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
if (lifeT < COOL_START) {
|
|
298
|
+
out.r = _sparkHue.r;
|
|
299
|
+
out.g = _sparkHue.g;
|
|
300
|
+
out.b = _sparkHue.b;
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
const t = (lifeT - COOL_START) / (1 - COOL_START);
|
|
304
|
+
mixOklabInto(_sparkHue, COOL_END, Math.min(1, t), out);
|
|
305
|
+
}
|
|
306
|
+
const PALETTE = PALETTE_HEX.map(hexToLinearRgb);
|
|
307
|
+
const COOL_END = hexToLinearRgb(COOL_END_HEX);
|
|
308
|
+
const MAGNESIUM = hexToLinearRgb(MAGNESIUM_HEX);
|
|
309
|
+
const COMET_HEAD = hexToLinearRgb(COMET_HEAD_HEX);
|
|
310
|
+
const SMOKE_COLOR = hexToLinearRgb(SMOKE_HEX);
|
|
311
|
+
const COMET_TRAIL_MIX = 0.25;
|
|
312
|
+
const COMET_TRAIL_HUE = mixOklab(COMET_HEAD, PALETTE[0], COMET_TRAIL_MIX);
|
|
313
|
+
function riseUnderDrag(vu0, g, k) {
|
|
314
|
+
return vu0 / k - g / (k * k) * Math.log(1 + k * vu0 / g);
|
|
315
|
+
}
|
|
316
|
+
function solveLaunch(from, apex, g, flightMs, medium) {
|
|
317
|
+
const k = medium?.drag;
|
|
318
|
+
const aspect = medium?.aspect ?? 1;
|
|
319
|
+
const ax = medium?.windX ?? 0;
|
|
320
|
+
const gEff = Math.max(1e-4, g + (medium?.windY ?? 0));
|
|
321
|
+
const dy = Math.max(0, from.y - apex.y);
|
|
322
|
+
const dx = (apex.x - from.x) * aspect;
|
|
323
|
+
let vu0;
|
|
324
|
+
let fs;
|
|
325
|
+
if (flightMs !== void 0) {
|
|
326
|
+
fs = flightMs / 1e3;
|
|
327
|
+
vu0 = gEff / k * (Math.exp(k * Math.max(0, fs)) - 1);
|
|
328
|
+
} else {
|
|
329
|
+
vu0 = Math.sqrt(2 * gEff * dy);
|
|
330
|
+
for (let i = 0; i < 12; i++) {
|
|
331
|
+
const err = riseUnderDrag(vu0, gEff, k) - dy;
|
|
332
|
+
const slope = vu0 / (gEff + k * vu0);
|
|
333
|
+
if (Math.abs(err) < 1e-9 || slope <= 0) break;
|
|
334
|
+
vu0 = Math.max(0, vu0 - err / slope);
|
|
335
|
+
}
|
|
336
|
+
fs = 1 / k * Math.log(1 + k * vu0 / gEff);
|
|
337
|
+
}
|
|
338
|
+
const safeFs = fs > 1e-4 ? fs : 1e-4;
|
|
339
|
+
const decay = 1 - Math.exp(-k * safeFs);
|
|
340
|
+
const drift = ax / k;
|
|
341
|
+
const vx0 = drift + (dx - drift * safeFs) * k / decay;
|
|
342
|
+
return { v0: { x: vx0, y: -vu0 }, flightMs: fs * 1e3 };
|
|
343
|
+
}
|
|
344
|
+
function sphereBurst(n, seed) {
|
|
345
|
+
const out = [];
|
|
346
|
+
const golden = Math.PI * (3 - Math.sqrt(5));
|
|
347
|
+
const phi0 = hash11(seed) * Math.PI * 2;
|
|
348
|
+
for (let i = 0; i < n; i++) {
|
|
349
|
+
const z = 1 - 2 * (i + 0.5) / n;
|
|
350
|
+
const r = Math.sqrt(Math.max(0, 1 - z * z));
|
|
351
|
+
const phi = phi0 + i * golden;
|
|
352
|
+
out.push({ dir: { x: r * Math.cos(phi), y: r * Math.sin(phi) }, z });
|
|
353
|
+
}
|
|
354
|
+
return out;
|
|
355
|
+
}
|
|
356
|
+
function ringBurst(n, seed) {
|
|
357
|
+
const out = [];
|
|
358
|
+
const a0 = hash11(seed) * Math.PI * 2;
|
|
359
|
+
const tilt = 0.03 * (hash11(seed + 1) * 2 - 1);
|
|
360
|
+
for (let i = 0; i < n; i++) {
|
|
361
|
+
const a = a0 + i / n * Math.PI * 2;
|
|
362
|
+
out.push({ dir: { x: Math.cos(a), y: Math.sin(a) }, z: tilt * Math.cos(a) });
|
|
363
|
+
}
|
|
364
|
+
return out;
|
|
365
|
+
}
|
|
366
|
+
function heartOutline(t) {
|
|
367
|
+
const a = t * Math.PI * 2;
|
|
368
|
+
const s = Math.sin(a);
|
|
369
|
+
return {
|
|
370
|
+
x: 16 * s * s * s / 17,
|
|
371
|
+
y: (13 * Math.cos(a) - 5 * Math.cos(2 * a) - 2 * Math.cos(3 * a) - Math.cos(4 * a)) / 17
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
function starOutline(points = 5, inner = 0.45) {
|
|
375
|
+
const verts = points * 2;
|
|
376
|
+
return (t) => {
|
|
377
|
+
const u = (t % 1 + 1) % 1;
|
|
378
|
+
const scaled = u * verts;
|
|
379
|
+
const i = Math.floor(scaled);
|
|
380
|
+
const f = scaled - i;
|
|
381
|
+
const radiusAt = (k) => k % 2 === 0 ? 1 : inner;
|
|
382
|
+
const angleAt = (k) => k / verts * Math.PI * 2 + Math.PI / 2;
|
|
383
|
+
const a0 = angleAt(i);
|
|
384
|
+
const a1 = angleAt(i + 1);
|
|
385
|
+
const r0 = radiusAt(i);
|
|
386
|
+
const r1 = radiusAt(i + 1);
|
|
387
|
+
const x0 = Math.cos(a0) * r0;
|
|
388
|
+
const y0 = Math.sin(a0) * r0;
|
|
389
|
+
const x1 = Math.cos(a1) * r1;
|
|
390
|
+
const y1 = Math.sin(a1) * r1;
|
|
391
|
+
return { x: lerp(x0, x1, f), y: lerp(y0, y1, f) };
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
function outlineBurst(n, seed, outline, jitter = 0.06) {
|
|
395
|
+
const out = [];
|
|
396
|
+
const phase = hash11(seed) * 0.5;
|
|
397
|
+
for (let i = 0; i < n; i++) {
|
|
398
|
+
const t = (i + phase) / n;
|
|
399
|
+
const p = outline(t);
|
|
400
|
+
const j = 1 + (hash11(seed + i * 1.7) * 2 - 1) * jitter;
|
|
401
|
+
out.push({
|
|
402
|
+
dir: { x: p.x * j, y: -p.y * j },
|
|
403
|
+
// A figure is a plane facing the viewer: keep z shallow so the burst
|
|
404
|
+
// reads flat rather than as a sphere wearing the outline.
|
|
405
|
+
z: (hash11(seed + i + 401) * 2 - 1) * 0.12
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
return out;
|
|
409
|
+
}
|
|
410
|
+
function polygonOutline(points) {
|
|
411
|
+
if (!points.length) return () => ({ x: 0, y: 0 });
|
|
412
|
+
let minX = Infinity;
|
|
413
|
+
let maxX = -Infinity;
|
|
414
|
+
let minY = Infinity;
|
|
415
|
+
let maxY = -Infinity;
|
|
416
|
+
for (const p of points) {
|
|
417
|
+
if (p.x < minX) minX = p.x;
|
|
418
|
+
if (p.x > maxX) maxX = p.x;
|
|
419
|
+
if (p.y < minY) minY = p.y;
|
|
420
|
+
if (p.y > maxY) maxY = p.y;
|
|
421
|
+
}
|
|
422
|
+
const cx = (minX + maxX) / 2;
|
|
423
|
+
const cy = (minY + maxY) / 2;
|
|
424
|
+
let max = 0;
|
|
425
|
+
const centered = points.map((p) => {
|
|
426
|
+
const v = { x: p.x - cx, y: p.y - cy };
|
|
427
|
+
max = Math.max(max, Math.hypot(v.x, v.y));
|
|
428
|
+
return v;
|
|
429
|
+
});
|
|
430
|
+
const scale = max > 1e-6 ? 1 / max : 1;
|
|
431
|
+
const n = centered.length;
|
|
432
|
+
const cumulative = new Array(n + 1);
|
|
433
|
+
cumulative[0] = 0;
|
|
434
|
+
for (let i = 0; i < n; i++) {
|
|
435
|
+
const a = centered[i];
|
|
436
|
+
const b = centered[(i + 1) % n];
|
|
437
|
+
cumulative[i + 1] = cumulative[i] + Math.hypot(b.x - a.x, b.y - a.y);
|
|
438
|
+
}
|
|
439
|
+
const perimeter = cumulative[n];
|
|
440
|
+
return (t) => {
|
|
441
|
+
const u = (t % 1 + 1) % 1;
|
|
442
|
+
if (perimeter <= 1e-9) return { x: centered[0].x * scale, y: centered[0].y * scale };
|
|
443
|
+
const target = u * perimeter;
|
|
444
|
+
let i = 0;
|
|
445
|
+
while (i < n - 1 && cumulative[i + 1] <= target) i++;
|
|
446
|
+
const segLen = cumulative[i + 1] - cumulative[i];
|
|
447
|
+
const f = segLen > 1e-9 ? (target - cumulative[i]) / segLen : 0;
|
|
448
|
+
const a = centered[i];
|
|
449
|
+
const b = centered[(i + 1) % n];
|
|
450
|
+
return { x: lerp(a.x, b.x, f) * scale, y: lerp(a.y, b.y, f) * scale };
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
function willowBurst(n, seed) {
|
|
454
|
+
return sphereBurst(n, seed).map((d) => ({
|
|
455
|
+
dir: { x: d.dir.x, y: d.dir.y * 0.55 - 0.15 },
|
|
456
|
+
z: d.z * 0.7
|
|
457
|
+
}));
|
|
458
|
+
}
|
|
459
|
+
function nextShellHue(state) {
|
|
460
|
+
const cur = state.i;
|
|
461
|
+
let ni = state.i + state.dir;
|
|
462
|
+
if (ni > 3) {
|
|
463
|
+
state.dir = -1;
|
|
464
|
+
ni = state.i - 1;
|
|
465
|
+
} else if (ni < 0) {
|
|
466
|
+
state.dir = 1;
|
|
467
|
+
ni = state.i + 1;
|
|
468
|
+
}
|
|
469
|
+
state.i = ni;
|
|
470
|
+
return cur;
|
|
471
|
+
}
|
|
472
|
+
function shellHueColor(hueIndex, palette, jitterDeg, rng) {
|
|
473
|
+
const base = palette[(hueIndex % palette.length + palette.length) % palette.length];
|
|
474
|
+
const deg = (rng() * 2 - 1) * jitterDeg;
|
|
475
|
+
return hueRotate(base, deg);
|
|
476
|
+
}
|
|
477
|
+
function poissonIntervalMs(meanMs, rng, clampMin, clampMax) {
|
|
478
|
+
const u = rng();
|
|
479
|
+
const x = -2200 * Math.log(1 - Math.min(0.999999, u));
|
|
480
|
+
return Math.min(clampMax, Math.max(clampMin, x));
|
|
481
|
+
}
|
|
482
|
+
const KEEP_CLEAR_MARGIN = 0.02;
|
|
483
|
+
function rectExpandedContains(rect, x, y, margin = KEEP_CLEAR_MARGIN) {
|
|
484
|
+
return x >= rect.x0 - margin && x <= rect.x1 + margin && y >= rect.y0 - margin && y <= rect.y1 + margin;
|
|
485
|
+
}
|
|
486
|
+
function sampleZone(zones, rng, keepClear, maxTries = 8) {
|
|
487
|
+
const total = zones.reduce((s, z) => s + z.weight, 0);
|
|
488
|
+
const pickZone = () => {
|
|
489
|
+
let t = rng() * total;
|
|
490
|
+
for (const z of zones) {
|
|
491
|
+
t -= z.weight;
|
|
492
|
+
if (t <= 0) return z;
|
|
493
|
+
}
|
|
494
|
+
return zones[zones.length - 1];
|
|
495
|
+
};
|
|
496
|
+
const KEEP_MARGIN = KEEP_CLEAR_MARGIN;
|
|
497
|
+
for (let attempt = 0; attempt < maxTries; attempt++) {
|
|
498
|
+
const z = pickZone();
|
|
499
|
+
let x = z.rect.x0 + rng() * (z.rect.x1 - z.rect.x0);
|
|
500
|
+
const y = z.rect.y0 + rng() * (z.rect.y1 - z.rect.y0);
|
|
501
|
+
const depth = rng();
|
|
502
|
+
const mid = (z.rect.x0 + z.rect.x1) / 2;
|
|
503
|
+
const edge = x < mid ? z.rect.x0 : z.rect.x1;
|
|
504
|
+
x = x + (edge - x) * depth * 0.4;
|
|
505
|
+
if (keepClear && rectExpandedContains(keepClear, x, y, KEEP_MARGIN)) continue;
|
|
506
|
+
return { apex: { x, y }, depth };
|
|
507
|
+
}
|
|
508
|
+
const cc = keepClear ? { x: (keepClear.x0 + keepClear.x1) / 2, y: (keepClear.y0 + keepClear.y1) / 2 } : { x: 0.5, y: 0.5 };
|
|
509
|
+
let best = zones[0];
|
|
510
|
+
let bestD = -1;
|
|
511
|
+
for (const z of zones) {
|
|
512
|
+
const zx = (z.rect.x0 + z.rect.x1) / 2;
|
|
513
|
+
const zy = (z.rect.y0 + z.rect.y1) / 2;
|
|
514
|
+
const d = Math.hypot(zx - cc.x, zy - cc.y);
|
|
515
|
+
if (d > bestD) {
|
|
516
|
+
bestD = d;
|
|
517
|
+
best = z;
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
return {
|
|
521
|
+
apex: { x: (best.rect.x0 + best.rect.x1) / 2, y: (best.rect.y0 + best.rect.y1) / 2 },
|
|
522
|
+
depth: rng()
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
function resolveQualityTier(requested, level, dpr, minDim, lowPower = false) {
|
|
526
|
+
if (requested !== "auto") return requested;
|
|
527
|
+
if (minDim > 0 && minDim < 480) return "low";
|
|
528
|
+
const isWebGl = level === "webgl-p3" || level === "webgl-sdr";
|
|
529
|
+
if (lowPower && isWebGl) return "low";
|
|
530
|
+
if (level === "webgpu-hdr") return "high";
|
|
531
|
+
if (level === "webgpu-sdr") return dpr >= 2 ? "high" : "mid";
|
|
532
|
+
return "mid";
|
|
533
|
+
}
|
|
534
|
+
const ADAPTIVE_LADDER = [
|
|
535
|
+
{ renderScale: 1, spawnScale: 1 },
|
|
536
|
+
// 0 — full
|
|
537
|
+
{ renderScale: 0.75, spawnScale: 1 },
|
|
538
|
+
// 1 — GPU: 0.75× accum
|
|
539
|
+
{ renderScale: 0.5, spawnScale: 1 },
|
|
540
|
+
// 2 — GPU: 0.5× accum
|
|
541
|
+
{ renderScale: 0.5, spawnScale: 0.66 },
|
|
542
|
+
// 3 — CPU: 0.66× spawn
|
|
543
|
+
{ renderScale: 0.5, spawnScale: 0.4 }
|
|
544
|
+
// 4 — CPU: 0.4× spawn (floor)
|
|
545
|
+
];
|
|
546
|
+
const ADAPTIVE_DEFAULTS = {
|
|
547
|
+
alpha: 0.1,
|
|
548
|
+
thresholdMs: 24,
|
|
549
|
+
sustainFrames: 60
|
|
550
|
+
};
|
|
551
|
+
function createAdaptiveState() {
|
|
552
|
+
return { emaMs: 0, overCount: 0, step: 0, started: false };
|
|
553
|
+
}
|
|
554
|
+
function adaptiveDowngradeStep(state, frameMs, tuning = ADAPTIVE_DEFAULTS) {
|
|
555
|
+
if (!state.started) {
|
|
556
|
+
state.emaMs = frameMs;
|
|
557
|
+
state.started = true;
|
|
558
|
+
} else {
|
|
559
|
+
state.emaMs += tuning.alpha * (frameMs - state.emaMs);
|
|
560
|
+
}
|
|
561
|
+
if (state.step >= ADAPTIVE_LADDER.length - 1) {
|
|
562
|
+
state.overCount = 0;
|
|
563
|
+
return false;
|
|
564
|
+
}
|
|
565
|
+
if (state.emaMs > tuning.thresholdMs) {
|
|
566
|
+
state.overCount++;
|
|
567
|
+
if (state.overCount >= tuning.sustainFrames) {
|
|
568
|
+
state.step++;
|
|
569
|
+
state.overCount = 0;
|
|
570
|
+
return true;
|
|
571
|
+
}
|
|
572
|
+
} else {
|
|
573
|
+
state.overCount = 0;
|
|
574
|
+
}
|
|
575
|
+
return false;
|
|
576
|
+
}
|
|
577
|
+
function adaptiveLevel(state) {
|
|
578
|
+
return ADAPTIVE_LADDER[Math.min(state.step, ADAPTIVE_LADDER.length - 1)];
|
|
579
|
+
}
|
|
580
|
+
const clamp = (v, lo, hi) => Math.max(lo, Math.min(hi, v));
|
|
581
|
+
const lerp = (a, b, t) => a + (b - a) * t;
|
|
582
|
+
const rand = (rng, lo, hi) => lo + rng() * (hi - lo);
|
|
583
|
+
function createSim(opts) {
|
|
584
|
+
const tier = QUALITY[opts.quality];
|
|
585
|
+
const capacity = tier.maxParticles;
|
|
586
|
+
const palette = opts.palette ?? PALETTE;
|
|
587
|
+
const rng = opts.rng ?? Math.random;
|
|
588
|
+
const pool = new Float32Array(capacity * STRIDE);
|
|
589
|
+
let count = 0;
|
|
590
|
+
let droppedSpawns = 0;
|
|
591
|
+
let aspect = opts.aspect;
|
|
592
|
+
let keepClear = null;
|
|
593
|
+
let spawnScale = 1;
|
|
594
|
+
const sessionWind = opts.wind ?? {
|
|
595
|
+
x: (rng() < 0.5 ? -1 : 1) * rand(rng, WIND_X[0], WIND_X[1]),
|
|
596
|
+
y: (rng() < 0.5 ? -1 : 1) * rand(rng, WIND_Y[0], WIND_Y[1])
|
|
597
|
+
};
|
|
598
|
+
let burstQueue = [];
|
|
599
|
+
let flashQueue = [];
|
|
600
|
+
let sparkQueue = [];
|
|
601
|
+
let seq = 1;
|
|
602
|
+
const stepSeed = () => hash11(seq++ * 0.61803398875);
|
|
603
|
+
function appendParticle(write) {
|
|
604
|
+
if (count >= capacity) {
|
|
605
|
+
droppedSpawns++;
|
|
606
|
+
return false;
|
|
607
|
+
}
|
|
608
|
+
const base = count * STRIDE;
|
|
609
|
+
for (let k = 0; k < STRIDE; k++) pool[base + k] = 0;
|
|
610
|
+
pool[base + F.depthDim] = 1;
|
|
611
|
+
write(base);
|
|
612
|
+
count++;
|
|
613
|
+
return true;
|
|
614
|
+
}
|
|
615
|
+
function setAspect(a) {
|
|
616
|
+
aspect = a;
|
|
617
|
+
}
|
|
618
|
+
function setKeepClear(rect) {
|
|
619
|
+
keepClear = rect;
|
|
620
|
+
}
|
|
621
|
+
function setSpawnScale(scale) {
|
|
622
|
+
spawnScale = Number.isFinite(scale) ? Math.max(0, Math.min(1, scale)) : 1;
|
|
623
|
+
}
|
|
624
|
+
function reset() {
|
|
625
|
+
count = 0;
|
|
626
|
+
droppedSpawns = 0;
|
|
627
|
+
burstQueue = [];
|
|
628
|
+
flashQueue = [];
|
|
629
|
+
sparkQueue = [];
|
|
630
|
+
seq = 1;
|
|
631
|
+
}
|
|
632
|
+
function launch(o) {
|
|
633
|
+
const shell = o.shell ?? "peony";
|
|
634
|
+
const seed = o.seed ?? Math.floor(rng() * 1e6);
|
|
635
|
+
const from = o.from ?? {
|
|
636
|
+
x: clamp(o.apex.x + (rng() * 2 - 1) * 0.04, LAUNCH_X[0], LAUNCH_X[1]),
|
|
637
|
+
y: rand(rng, LAUNCH_Y[0], LAUNCH_Y[1])
|
|
638
|
+
};
|
|
639
|
+
const { v0, flightMs } = solveLaunch(from, o.apex, G * GRAV_SCALE[TYPE.ROCKET], o.flightMs, {
|
|
640
|
+
drag: DRAG[TYPE.ROCKET],
|
|
641
|
+
aspect,
|
|
642
|
+
windX: sessionWind.x * WIND_SCALE[TYPE.ROCKET],
|
|
643
|
+
windY: sessionWind.y * WIND_SCALE[TYPE.ROCKET]
|
|
644
|
+
});
|
|
645
|
+
const hangMs = o.intensity === "intro" ? 140 : rand(rng, 80, 140);
|
|
646
|
+
const breakMs = flightMs + hangMs;
|
|
647
|
+
const colors = resolveColors(o.color, seed);
|
|
648
|
+
const spec = {
|
|
649
|
+
shell,
|
|
650
|
+
colors,
|
|
651
|
+
// The ascent trail is tinted toward THIS shell's hue (§4) — mixed once
|
|
652
|
+
// per launch, not per emitted spark, and never from the default palette.
|
|
653
|
+
trailHue: mixOklab(COMET_HEAD, colors[0], COMET_TRAIL_MIX),
|
|
654
|
+
scale: o.scale ?? 1,
|
|
655
|
+
depth: clamp(o.depth ?? 0, 0, 1),
|
|
656
|
+
seed,
|
|
657
|
+
intensity: o.intensity ?? "ambient",
|
|
658
|
+
glyphPoints: o.glyphPoints,
|
|
659
|
+
// Resolved here, not per particle: normalizing the caller's points is
|
|
660
|
+
// O(n) and the burst is expanded a frame later, once.
|
|
661
|
+
outline: o.shapePoints?.length ? polygonOutline(o.shapePoints) : void 0,
|
|
662
|
+
releaseAtMs: o.releaseAtMs,
|
|
663
|
+
breakMs
|
|
664
|
+
};
|
|
665
|
+
const launchId = registerSpec(spec);
|
|
666
|
+
appendParticle((base) => {
|
|
667
|
+
pool[base + F.posX] = from.x;
|
|
668
|
+
pool[base + F.posY] = from.y;
|
|
669
|
+
pool[base + F.velX] = v0.x;
|
|
670
|
+
pool[base + F.velY] = v0.y;
|
|
671
|
+
pool[base + F.ttl] = breakMs / 1e3;
|
|
672
|
+
pool[base + F.size] = 4e-3;
|
|
673
|
+
pool[base + F.r] = COMET_HEAD.r;
|
|
674
|
+
pool[base + F.g] = COMET_HEAD.g;
|
|
675
|
+
pool[base + F.b] = COMET_HEAD.b;
|
|
676
|
+
pool[base + F.brightness] = B_ASCENT_HEAD;
|
|
677
|
+
pool[base + F.type] = TYPE.ROCKET;
|
|
678
|
+
pool[base + F.seed] = seed;
|
|
679
|
+
pool[base + F.targetX] = launchId;
|
|
680
|
+
pool[base + F.targetY] = 0;
|
|
681
|
+
pool[base + F.dragScale] = 1;
|
|
682
|
+
});
|
|
683
|
+
return { flightMs, breakMs };
|
|
684
|
+
}
|
|
685
|
+
function resolveColors(color, seed) {
|
|
686
|
+
if (Array.isArray(color)) return color.length ? color : [PALETTE[0]];
|
|
687
|
+
if (color) return [color];
|
|
688
|
+
const idx = Math.floor(hash11(seed) * palette.length) % palette.length;
|
|
689
|
+
return [hueRotate(palette[idx], (hash11(seed + 7) * 2 - 1) * SHELL_JITTER_DEG)];
|
|
690
|
+
}
|
|
691
|
+
const specs = /* @__PURE__ */ new Map();
|
|
692
|
+
let specId = 1;
|
|
693
|
+
function registerSpec(spec) {
|
|
694
|
+
const id = specId++;
|
|
695
|
+
specs.set(id, spec);
|
|
696
|
+
return id;
|
|
697
|
+
}
|
|
698
|
+
function spawnFlash(pos, brightness, sizeNorm, hue) {
|
|
699
|
+
flashQueue.push({ pos: { ...pos }, brightness, size: sizeNorm, hue });
|
|
700
|
+
}
|
|
701
|
+
function expandBurst(req) {
|
|
702
|
+
const { origin, spec } = req;
|
|
703
|
+
const recipe = SHELL[spec.shell];
|
|
704
|
+
if (spec.shell === "glyph") {
|
|
705
|
+
expandGlyph(origin, spec);
|
|
706
|
+
return;
|
|
707
|
+
}
|
|
708
|
+
const n = Math.max(1, Math.round(recipe.counts[opts.quality] * spawnScale));
|
|
709
|
+
const radius = rand(seededRng(spec.seed + 3), recipe.radius[0], recipe.radius[1]) * spec.scale * (1 - DEPTH_RADIUS * spec.depth);
|
|
710
|
+
const dim = depthDim(spec.depth);
|
|
711
|
+
const baseSpeed = radius * BURST_SPEED_K;
|
|
712
|
+
const outline = spec.outline ?? recipe.outline;
|
|
713
|
+
let dirs;
|
|
714
|
+
if (recipe.builder === "outline") {
|
|
715
|
+
dirs = outline ? outlineBurst(n, spec.seed, outline) : sphereBurst(n, spec.seed);
|
|
716
|
+
} else if (recipe.builder === "ring") {
|
|
717
|
+
dirs = ringBurst(n, spec.seed);
|
|
718
|
+
} else if (recipe.builder === "willow") {
|
|
719
|
+
dirs = willowBurst(n, spec.seed);
|
|
720
|
+
} else {
|
|
721
|
+
dirs = sphereBurst(n, spec.seed);
|
|
722
|
+
}
|
|
723
|
+
for (let i = 0; i < dirs.length; i++) {
|
|
724
|
+
const { dir, z } = dirs[i];
|
|
725
|
+
const asymAmount = recipe.crisp ? 0.03 : 0.12;
|
|
726
|
+
const asym = 1 + (hash11(spec.seed + i) * 2 - 1) * asymAmount;
|
|
727
|
+
const straggler = !recipe.crisp && hash11(spec.seed + i + 991) < 0.05;
|
|
728
|
+
const speed = baseSpeed * asym * (straggler ? 1.4 : 1);
|
|
729
|
+
const isEmber = hash11(spec.seed + i + 313) < recipe.emberFrac;
|
|
730
|
+
const type = isEmber ? TYPE.EMBER : TYPE.SPARK;
|
|
731
|
+
const crackles = !isEmber && hash11(spec.seed + i + 577) < CRACKLE_FRAC;
|
|
732
|
+
const hue = depthAdjust(pickShellColor(spec, i), spec.depth);
|
|
733
|
+
const ttl = isEmber ? rand(seededRng(spec.seed + i + 17), 1.4, 2.4) : rand(seededRng(spec.seed + i + 17), 0.75, 1.3);
|
|
734
|
+
const size = (isEmber ? rand(seededRng(spec.seed + i + 29), 2e-3, 3e-3) : rand(seededRng(spec.seed + i + 29), 25e-4, 4e-3)) * (1 - DEPTH_SIZE * spec.depth);
|
|
735
|
+
appendParticle((base) => {
|
|
736
|
+
pool[base + F.posX] = origin.x;
|
|
737
|
+
pool[base + F.posY] = origin.y;
|
|
738
|
+
pool[base + F.velX] = dir.x * speed;
|
|
739
|
+
pool[base + F.velY] = dir.y * speed;
|
|
740
|
+
pool[base + F.ttl] = ttl;
|
|
741
|
+
pool[base + F.size] = size;
|
|
742
|
+
pool[base + F.r] = hue.r;
|
|
743
|
+
pool[base + F.g] = hue.g;
|
|
744
|
+
pool[base + F.b] = hue.b;
|
|
745
|
+
pool[base + F.brightness] = B_SPARK_FRESH;
|
|
746
|
+
pool[base + F.type] = type;
|
|
747
|
+
pool[base + F.seed] = spec.seed + i;
|
|
748
|
+
pool[base + F.dragScale] = recipe.crisp ? 1 : straggler ? 0.7 : 0.85 + 0.45 * hash11(spec.seed + i + 233);
|
|
749
|
+
pool[base + F.depthDim] = dim;
|
|
750
|
+
pool[base + F.targetX] = crackles ? 1 : 0;
|
|
751
|
+
pool[base + F.targetY] = z;
|
|
752
|
+
});
|
|
753
|
+
}
|
|
754
|
+
for (let s = 0; s < recipe.smoke; s++) {
|
|
755
|
+
spawnSmoke(origin, spec, s);
|
|
756
|
+
}
|
|
757
|
+
const flashB = spec.intensity === "intro" ? B_FLASH_INTRO : B_FLASH_AMBIENT;
|
|
758
|
+
flashQueue.push({
|
|
759
|
+
pos: { ...origin },
|
|
760
|
+
brightness: flashB,
|
|
761
|
+
size: rand(seededRng(spec.seed + 5), 0.025, 0.05) * (1 - DEPTH_SIZE * spec.depth),
|
|
762
|
+
hue: depthAdjust(spec.colors[0], spec.depth),
|
|
763
|
+
dim
|
|
764
|
+
});
|
|
765
|
+
}
|
|
766
|
+
function expandGlyph(origin, spec) {
|
|
767
|
+
const points = spec.glyphPoints ?? [];
|
|
768
|
+
const releaseDelaySec = Math.max(
|
|
769
|
+
0.3,
|
|
770
|
+
((spec.releaseAtMs ?? spec.breakMs + 1500) - spec.breakMs) / 1e3
|
|
771
|
+
);
|
|
772
|
+
const hue = depthAdjust(spec.colors[0], spec.depth);
|
|
773
|
+
const dim = depthDim(spec.depth);
|
|
774
|
+
for (let i = 0; i < points.length; i++) {
|
|
775
|
+
const p = points[i];
|
|
776
|
+
appendParticle((base) => {
|
|
777
|
+
pool[base + F.posX] = origin.x;
|
|
778
|
+
pool[base + F.posY] = origin.y;
|
|
779
|
+
const dx = (p.x - origin.x) * aspect;
|
|
780
|
+
const dy = p.y - origin.y;
|
|
781
|
+
const d = Math.hypot(dx, dy) || 1e-4;
|
|
782
|
+
const mag = d / 0.08;
|
|
783
|
+
pool[base + F.velX] = dx / d * mag;
|
|
784
|
+
pool[base + F.velY] = dy / d * mag;
|
|
785
|
+
pool[base + F.ttl] = releaseDelaySec + 0.9;
|
|
786
|
+
pool[base + F.size] = 3e-3 * (1 - DEPTH_SIZE * spec.depth);
|
|
787
|
+
pool[base + F.depthDim] = dim;
|
|
788
|
+
pool[base + F.r] = hue.r;
|
|
789
|
+
pool[base + F.g] = hue.g;
|
|
790
|
+
pool[base + F.b] = hue.b;
|
|
791
|
+
pool[base + F.brightness] = B_GLYPH_HOLD;
|
|
792
|
+
pool[base + F.type] = TYPE.SEEKER;
|
|
793
|
+
pool[base + F.seed] = spec.seed + i;
|
|
794
|
+
pool[base + F.targetX] = p.x;
|
|
795
|
+
pool[base + F.targetY] = p.y;
|
|
796
|
+
pool[base + F.dragScale] = releaseDelaySec;
|
|
797
|
+
});
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
function spawnSmoke(origin, spec, s) {
|
|
801
|
+
appendParticle((base) => {
|
|
802
|
+
pool[base + F.posX] = origin.x + (hash11(spec.seed + s + 41) * 2 - 1) * 0.01;
|
|
803
|
+
pool[base + F.posY] = origin.y + (hash11(spec.seed + s + 43) * 2 - 1) * 0.01;
|
|
804
|
+
pool[base + F.velX] = (hash11(spec.seed + s + 47) * 2 - 1) * 0.02;
|
|
805
|
+
pool[base + F.velY] = -0.02;
|
|
806
|
+
pool[base + F.ttl] = rand(seededRng(spec.seed + s + 51), 1.5, 3);
|
|
807
|
+
pool[base + F.size] = 0.01;
|
|
808
|
+
pool[base + F.r] = SMOKE_COLOR.r;
|
|
809
|
+
pool[base + F.g] = SMOKE_COLOR.g;
|
|
810
|
+
pool[base + F.b] = SMOKE_COLOR.b;
|
|
811
|
+
pool[base + F.brightness] = B_SMOKE_MIN;
|
|
812
|
+
pool[base + F.type] = TYPE.SMOKE;
|
|
813
|
+
pool[base + F.seed] = spec.seed + s + 61;
|
|
814
|
+
pool[base + F.dragScale] = 1;
|
|
815
|
+
pool[base + F.depthDim] = depthDim(spec.depth);
|
|
816
|
+
});
|
|
817
|
+
}
|
|
818
|
+
function pickShellColor(spec, i) {
|
|
819
|
+
if (spec.colors.length === 1) return spec.colors[0];
|
|
820
|
+
return hash11(spec.seed + i + 137) < 0.5 ? spec.colors[0] : spec.colors[1];
|
|
821
|
+
}
|
|
822
|
+
function depthAdjust(hue, depth) {
|
|
823
|
+
if (depth <= 0) return hue;
|
|
824
|
+
return scaleChroma(hue, 1 - DEPTH_CHROMA * depth);
|
|
825
|
+
}
|
|
826
|
+
function depthDim(depth) {
|
|
827
|
+
return depth <= 0 ? 1 : 1 - DEPTH_DIM * depth;
|
|
828
|
+
}
|
|
829
|
+
function seededRng(seed) {
|
|
830
|
+
let s = seed;
|
|
831
|
+
return () => {
|
|
832
|
+
s += 1;
|
|
833
|
+
return hash11(s);
|
|
834
|
+
};
|
|
835
|
+
}
|
|
836
|
+
function step(dtSeconds, wind) {
|
|
837
|
+
const dt = Math.min(dtSeconds, DT_MAX);
|
|
838
|
+
const w = wind ?? sessionWind;
|
|
839
|
+
if (burstQueue.length) {
|
|
840
|
+
const q = burstQueue;
|
|
841
|
+
burstQueue = [];
|
|
842
|
+
for (let bi = 0; bi < q.length; bi++) expandBurst(q[bi]);
|
|
843
|
+
}
|
|
844
|
+
if (flashQueue.length) {
|
|
845
|
+
const q = flashQueue;
|
|
846
|
+
flashQueue = [];
|
|
847
|
+
for (let fi = 0; fi < q.length; fi++) {
|
|
848
|
+
const f = q[fi];
|
|
849
|
+
appendParticle((base) => {
|
|
850
|
+
pool[base + F.posX] = f.pos.x;
|
|
851
|
+
pool[base + F.posY] = f.pos.y;
|
|
852
|
+
pool[base + F.ttl] = rand(seededRng(seq++ | 0), 0.06, 0.12);
|
|
853
|
+
pool[base + F.size] = f.size;
|
|
854
|
+
pool[base + F.r] = f.hue.r;
|
|
855
|
+
pool[base + F.g] = f.hue.g;
|
|
856
|
+
pool[base + F.b] = f.hue.b;
|
|
857
|
+
pool[base + F.brightness] = f.brightness;
|
|
858
|
+
pool[base + F.type] = TYPE.FLASH;
|
|
859
|
+
pool[base + F.seed] = stepSeed() * 1e3;
|
|
860
|
+
pool[base + F.depthDim] = f.dim ?? 1;
|
|
861
|
+
});
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
if (sparkQueue.length) {
|
|
865
|
+
const q = sparkQueue;
|
|
866
|
+
sparkQueue = [];
|
|
867
|
+
for (let si = 0; si < q.length; si++) {
|
|
868
|
+
const sp = q[si];
|
|
869
|
+
appendParticle((base) => {
|
|
870
|
+
pool[base + F.posX] = sp.pos.x;
|
|
871
|
+
pool[base + F.posY] = sp.pos.y;
|
|
872
|
+
pool[base + F.velX] = sp.vel.x;
|
|
873
|
+
pool[base + F.velY] = sp.vel.y;
|
|
874
|
+
pool[base + F.ttl] = sp.ttl;
|
|
875
|
+
pool[base + F.size] = sp.size;
|
|
876
|
+
pool[base + F.r] = sp.hue.r;
|
|
877
|
+
pool[base + F.g] = sp.hue.g;
|
|
878
|
+
pool[base + F.b] = sp.hue.b;
|
|
879
|
+
pool[base + F.brightness] = B_ASCENT_TAIL;
|
|
880
|
+
pool[base + F.type] = TYPE.SPARK;
|
|
881
|
+
pool[base + F.seed] = sp.seed;
|
|
882
|
+
pool[base + F.dragScale] = 1;
|
|
883
|
+
});
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
let i = 0;
|
|
887
|
+
while (i < count) {
|
|
888
|
+
const base = i * STRIDE;
|
|
889
|
+
const type = pool[base + F.type];
|
|
890
|
+
if (type === TYPE.ROCKET) {
|
|
891
|
+
emitTrail(base, dt);
|
|
892
|
+
integrate(base, type, dt, w);
|
|
893
|
+
const wob = pool[base + F.seed];
|
|
894
|
+
pool[base + F.posX] = pool[base + F.posX] + Math.sin(pool[base + F.age] * ROCKET_WOBBLE_HZ + hash11(wob) * 6.283) * ROCKET_WOBBLE_AMP * dt;
|
|
895
|
+
} else if (type === TYPE.SEEKER) {
|
|
896
|
+
stepSeeker(base, dt);
|
|
897
|
+
} else {
|
|
898
|
+
integrate(base, type, dt, w);
|
|
899
|
+
if (type === TYPE.SMOKE) stepSmoke(base);
|
|
900
|
+
}
|
|
901
|
+
pool[base + F.age] = pool[base + F.age] + dt;
|
|
902
|
+
const lifeT = pool[base + F.ttl] > 0 ? pool[base + F.age] / pool[base + F.ttl] : 1;
|
|
903
|
+
pool[base + F.brightness] = brightnessCurve(type, base, lifeT) * deathGate(lifeT) * pool[base + F.depthDim];
|
|
904
|
+
if (keepClear !== null && type !== TYPE.ROCKET && type !== TYPE.SEEKER) {
|
|
905
|
+
const px = pool[base + F.posX];
|
|
906
|
+
const py = pool[base + F.posY];
|
|
907
|
+
if (px >= keepClear.x0 && px <= keepClear.x1 && py >= keepClear.y0 && py <= keepClear.y1) {
|
|
908
|
+
pool[base + F.brightness] = pool[base + F.brightness] * KEEP_CLEAR_DIM;
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
let removed = false;
|
|
912
|
+
if (lifeT >= 1) {
|
|
913
|
+
if (type === TYPE.ROCKET) {
|
|
914
|
+
const spec = specs.get(pool[base + F.targetX]);
|
|
915
|
+
if (spec) {
|
|
916
|
+
burstQueue.push({
|
|
917
|
+
origin: { x: pool[base + F.posX], y: pool[base + F.posY] },
|
|
918
|
+
spec
|
|
919
|
+
});
|
|
920
|
+
specs.delete(pool[base + F.targetX]);
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
removed = true;
|
|
924
|
+
}
|
|
925
|
+
if (removed) {
|
|
926
|
+
const last = (count - 1) * STRIDE;
|
|
927
|
+
if (base !== last) pool.copyWithin(base, last, last + STRIDE);
|
|
928
|
+
count--;
|
|
929
|
+
} else {
|
|
930
|
+
i++;
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
function integrate(base, type, dt, w) {
|
|
935
|
+
const ax = w.x * WIND_SCALE[type];
|
|
936
|
+
const ay = G * GRAV_SCALE[type] + w.y * WIND_SCALE[type];
|
|
937
|
+
let vx = pool[base + F.velX] + ax * dt;
|
|
938
|
+
let vy = pool[base + F.velY] + ay * dt;
|
|
939
|
+
const damp = 1 + DRAG[type] * pool[base + F.dragScale] * dt;
|
|
940
|
+
vx /= damp;
|
|
941
|
+
vy /= damp;
|
|
942
|
+
pool[base + F.velX] = vx;
|
|
943
|
+
pool[base + F.velY] = vy;
|
|
944
|
+
pool[base + F.posX] = pool[base + F.posX] + vx / aspect * dt;
|
|
945
|
+
pool[base + F.posY] = pool[base + F.posY] + vy * dt;
|
|
946
|
+
}
|
|
947
|
+
function emitTrail(base, dt) {
|
|
948
|
+
let emit = pool[base + F.targetY] + tier.trailRate * dt;
|
|
949
|
+
const seed = pool[base + F.seed];
|
|
950
|
+
const px = pool[base + F.posX];
|
|
951
|
+
const py = pool[base + F.posY];
|
|
952
|
+
const hue = specs.get(pool[base + F.targetX])?.trailHue ?? COMET_TRAIL_HUE;
|
|
953
|
+
let k = 0;
|
|
954
|
+
while (emit >= 1) {
|
|
955
|
+
emit -= 1;
|
|
956
|
+
const j = hash11(seed + pool[base + F.age] * 1e3 + k);
|
|
957
|
+
sparkQueue.push({
|
|
958
|
+
pos: { x: px, y: py },
|
|
959
|
+
// Wider lateral scatter: a rigidly co-linear trail reads as a drawn
|
|
960
|
+
// beam rather than a comet shedding sparks.
|
|
961
|
+
vel: { x: (j * 2 - 1) * 0.035, y: (hash11(j) * 2 - 1) * 0.02 },
|
|
962
|
+
ttl: rand(seededRng(seed + k + 71), 0.22, 0.45),
|
|
963
|
+
size: 18e-4,
|
|
964
|
+
hue,
|
|
965
|
+
seed: seed + k + 500
|
|
966
|
+
});
|
|
967
|
+
k++;
|
|
968
|
+
}
|
|
969
|
+
pool[base + F.targetY] = emit;
|
|
970
|
+
}
|
|
971
|
+
function stepSeeker(base, dt) {
|
|
972
|
+
const age = pool[base + F.age];
|
|
973
|
+
const releaseDelay = pool[base + F.dragScale];
|
|
974
|
+
const tX = pool[base + F.targetX];
|
|
975
|
+
const tY = pool[base + F.targetY];
|
|
976
|
+
pool[base + F.seed];
|
|
977
|
+
if (age < 0.08) {
|
|
978
|
+
let vx = pool[base + F.velX];
|
|
979
|
+
let vy = pool[base + F.velY];
|
|
980
|
+
const damp = 1 + DRAG[TYPE.SEEKER] * dt;
|
|
981
|
+
vx /= damp;
|
|
982
|
+
vy /= damp;
|
|
983
|
+
pool[base + F.velX] = vx;
|
|
984
|
+
pool[base + F.velY] = vy;
|
|
985
|
+
pool[base + F.posX] = pool[base + F.posX] + vx / aspect * dt;
|
|
986
|
+
pool[base + F.posY] = pool[base + F.posY] + vy * dt;
|
|
987
|
+
} else if (age < releaseDelay) {
|
|
988
|
+
const omega = 6;
|
|
989
|
+
const zeta = 0.9;
|
|
990
|
+
const px = pool[base + F.posX] * aspect;
|
|
991
|
+
const ax = -omega * omega * (px - tX * aspect) - 2 * zeta * omega * pool[base + F.velX];
|
|
992
|
+
const nvx = pool[base + F.velX] + ax * dt;
|
|
993
|
+
pool[base + F.velX] = nvx;
|
|
994
|
+
pool[base + F.posX] = (px + nvx * dt) / aspect;
|
|
995
|
+
const py = pool[base + F.posY];
|
|
996
|
+
const ay = -omega * omega * (py - tY) - 2 * zeta * omega * pool[base + F.velY];
|
|
997
|
+
const nvy = pool[base + F.velY] + ay * dt;
|
|
998
|
+
pool[base + F.velY] = nvy;
|
|
999
|
+
pool[base + F.posY] = py + nvy * dt;
|
|
1000
|
+
} else {
|
|
1001
|
+
const vy = pool[base + F.velY] + G * 1 * dt;
|
|
1002
|
+
pool[base + F.velY] = vy;
|
|
1003
|
+
pool[base + F.posX] = pool[base + F.posX] + pool[base + F.velX] / aspect * dt;
|
|
1004
|
+
pool[base + F.posY] = pool[base + F.posY] + vy * dt;
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
function stepSmoke(base, _dt) {
|
|
1008
|
+
const lifeT = pool[base + F.ttl] > 0 ? pool[base + F.age] / pool[base + F.ttl] : 1;
|
|
1009
|
+
pool[base + F.size] = lerp(0.01, 0.05, Math.min(1, lifeT));
|
|
1010
|
+
}
|
|
1011
|
+
function brightnessCurve(type, base, lifeT) {
|
|
1012
|
+
const seed = pool[base + F.seed];
|
|
1013
|
+
const age = pool[base + F.age];
|
|
1014
|
+
switch (type) {
|
|
1015
|
+
case TYPE.FLASH:
|
|
1016
|
+
return pool[base + F.brightness] > 0 ? Math.max(pool[base + F.brightness], B_FLASH_AMBIENT) * Math.exp(-5.5 * lifeT) : B_FLASH_AMBIENT * Math.exp(-5.5 * lifeT);
|
|
1017
|
+
case TYPE.SPARK: {
|
|
1018
|
+
let b = B_SPARK_STEADY + (B_SPARK_FRESH - B_SPARK_STEADY) * Math.exp(-lifeT * 8);
|
|
1019
|
+
if (lifeT > 0.7) {
|
|
1020
|
+
const u = (lifeT - 0.7) / 0.3;
|
|
1021
|
+
b = Math.max(B_SPARK_TERMINAL, b * (1 - u) * (1 - u) * (1 - u));
|
|
1022
|
+
}
|
|
1023
|
+
if (pool[base + F.targetX] > 0.5) {
|
|
1024
|
+
b *= flickerNoise(seed, age, CRACKLE_HZ) > 0.5 ? 1.9 : 0.25;
|
|
1025
|
+
}
|
|
1026
|
+
return b;
|
|
1027
|
+
}
|
|
1028
|
+
case TYPE.EMBER: {
|
|
1029
|
+
const freq = 8 + 6 * hash11(seed);
|
|
1030
|
+
const mul = 0.6 + 1.4 * flickerNoise(seed, age, freq);
|
|
1031
|
+
return B_EMBER_MEAN * mul * (1 - 0.6 * lifeT);
|
|
1032
|
+
}
|
|
1033
|
+
case TYPE.SMOKE:
|
|
1034
|
+
return lerp(B_SMOKE_MIN, B_SMOKE_MAX, Math.sin(Math.min(1, lifeT) * Math.PI));
|
|
1035
|
+
case TYPE.SEEKER: {
|
|
1036
|
+
const releaseDelay = pool[base + F.dragScale];
|
|
1037
|
+
if (age < releaseDelay) {
|
|
1038
|
+
return B_GLYPH_HOLD * (0.85 + 0.3 * flickerNoise(seed, age, 10));
|
|
1039
|
+
}
|
|
1040
|
+
const rt = (age - releaseDelay) / 0.9;
|
|
1041
|
+
return B_GLYPH_RELEASE * Math.exp(-3 * Math.max(0, rt));
|
|
1042
|
+
}
|
|
1043
|
+
case TYPE.ROCKET:
|
|
1044
|
+
default:
|
|
1045
|
+
return B_ASCENT_HEAD;
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
const _dispHue = { r: 0, g: 0, b: 0 };
|
|
1049
|
+
const _dispColor = { r: 0, g: 0, b: 0 };
|
|
1050
|
+
function writeInstances(out) {
|
|
1051
|
+
let n = 0;
|
|
1052
|
+
for (let idx = 0; idx < count; idx++) {
|
|
1053
|
+
const base = idx * STRIDE;
|
|
1054
|
+
const type = pool[base + F.type];
|
|
1055
|
+
const bright = pool[base + F.brightness];
|
|
1056
|
+
const lifeT = pool[base + F.ttl] > 0 ? pool[base + F.age] / pool[base + F.ttl] : 1;
|
|
1057
|
+
displayColorInto(type, base, lifeT, _dispColor);
|
|
1058
|
+
const o = n * 8;
|
|
1059
|
+
out[o + 0] = pool[base + F.posX];
|
|
1060
|
+
out[o + 1] = pool[base + F.posY];
|
|
1061
|
+
out[o + 2] = pool[base + F.size];
|
|
1062
|
+
out[o + 3] = _dispColor.r * bright;
|
|
1063
|
+
out[o + 4] = _dispColor.g * bright;
|
|
1064
|
+
out[o + 5] = _dispColor.b * bright;
|
|
1065
|
+
out[o + 6] = pool[base + F.velX] * STRETCH;
|
|
1066
|
+
out[o + 7] = pool[base + F.velY] * STRETCH;
|
|
1067
|
+
n++;
|
|
1068
|
+
}
|
|
1069
|
+
return n;
|
|
1070
|
+
}
|
|
1071
|
+
function displayColorInto(type, base, lifeT, out) {
|
|
1072
|
+
_dispHue.r = pool[base + F.r];
|
|
1073
|
+
_dispHue.g = pool[base + F.g];
|
|
1074
|
+
_dispHue.b = pool[base + F.b];
|
|
1075
|
+
const seed = pool[base + F.seed];
|
|
1076
|
+
switch (type) {
|
|
1077
|
+
case TYPE.SPARK: {
|
|
1078
|
+
const whiteHold = 0.04 + 0.07 * hash11(seed);
|
|
1079
|
+
sparkColorAtLifeInto(_dispHue, lifeT, whiteHold, seed, out);
|
|
1080
|
+
return;
|
|
1081
|
+
}
|
|
1082
|
+
case TYPE.EMBER:
|
|
1083
|
+
mixOklabInto(_dispHue, COOL_END, Math.min(1, lifeT) * 0.5, out);
|
|
1084
|
+
return;
|
|
1085
|
+
case TYPE.FLASH:
|
|
1086
|
+
mixOklabInto(MAGNESIUM, _dispHue, Math.min(1, lifeT), out);
|
|
1087
|
+
return;
|
|
1088
|
+
case TYPE.SMOKE:
|
|
1089
|
+
out.r = SMOKE_COLOR.r;
|
|
1090
|
+
out.g = SMOKE_COLOR.g;
|
|
1091
|
+
out.b = SMOKE_COLOR.b;
|
|
1092
|
+
return;
|
|
1093
|
+
case TYPE.SEEKER:
|
|
1094
|
+
case TYPE.ROCKET:
|
|
1095
|
+
default:
|
|
1096
|
+
out.r = _dispHue.r;
|
|
1097
|
+
out.g = _dispHue.g;
|
|
1098
|
+
out.b = _dispHue.b;
|
|
1099
|
+
return;
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
return {
|
|
1103
|
+
launch,
|
|
1104
|
+
spawnFlash,
|
|
1105
|
+
step,
|
|
1106
|
+
writeInstances,
|
|
1107
|
+
setAspect,
|
|
1108
|
+
setKeepClear,
|
|
1109
|
+
setSpawnScale,
|
|
1110
|
+
reset,
|
|
1111
|
+
get count() {
|
|
1112
|
+
return count;
|
|
1113
|
+
},
|
|
1114
|
+
get capacity() {
|
|
1115
|
+
return capacity;
|
|
1116
|
+
},
|
|
1117
|
+
get droppedSpawns() {
|
|
1118
|
+
return droppedSpawns;
|
|
1119
|
+
},
|
|
1120
|
+
get data() {
|
|
1121
|
+
return pool;
|
|
1122
|
+
}
|
|
1123
|
+
};
|
|
1124
|
+
}
|
|
1125
|
+
export {
|
|
1126
|
+
ADAPTIVE_DEFAULTS,
|
|
1127
|
+
ADAPTIVE_LADDER,
|
|
1128
|
+
AMBIENT_RADIUS_MAX,
|
|
1129
|
+
AMBIENT_ZONES,
|
|
1130
|
+
B_ASCENT_HEAD,
|
|
1131
|
+
B_ASCENT_TAIL,
|
|
1132
|
+
B_EMBER_MEAN,
|
|
1133
|
+
B_FLASH_AMBIENT,
|
|
1134
|
+
B_FLASH_INTRO,
|
|
1135
|
+
B_GLYPH_HOLD,
|
|
1136
|
+
B_GLYPH_RELEASE,
|
|
1137
|
+
B_SMOKE_MAX,
|
|
1138
|
+
B_SMOKE_MIN,
|
|
1139
|
+
B_SPARK_FRESH,
|
|
1140
|
+
B_SPARK_STEADY,
|
|
1141
|
+
B_SPARK_TERMINAL,
|
|
1142
|
+
COMET_HEAD_HEX,
|
|
1143
|
+
COMET_TRAIL_MIX,
|
|
1144
|
+
COOL_END_HEX,
|
|
1145
|
+
COOL_START,
|
|
1146
|
+
CRACKLE_FRAC,
|
|
1147
|
+
CRACKLE_HZ,
|
|
1148
|
+
DEPTH_CHROMA,
|
|
1149
|
+
DEPTH_DIM,
|
|
1150
|
+
DEPTH_RADIUS,
|
|
1151
|
+
DEPTH_SIZE,
|
|
1152
|
+
DT_MAX,
|
|
1153
|
+
EXPOSURE_AMBIENT,
|
|
1154
|
+
F,
|
|
1155
|
+
G,
|
|
1156
|
+
HUE_ARRIVES_AT,
|
|
1157
|
+
KEEP_CLEAR_DESKTOP,
|
|
1158
|
+
KEEP_CLEAR_DIM,
|
|
1159
|
+
KEEP_CLEAR_MARGIN,
|
|
1160
|
+
LAUNCH_X,
|
|
1161
|
+
LAUNCH_Y,
|
|
1162
|
+
MAGNESIUM_HEX,
|
|
1163
|
+
PALETTE,
|
|
1164
|
+
PALETTE_HEX,
|
|
1165
|
+
QUALITY,
|
|
1166
|
+
ROCKET_WOBBLE_AMP,
|
|
1167
|
+
ROCKET_WOBBLE_HZ,
|
|
1168
|
+
SDR_CORE_SCALE,
|
|
1169
|
+
SDR_KNEE_START,
|
|
1170
|
+
SDR_SAT_BOOST,
|
|
1171
|
+
SHELL,
|
|
1172
|
+
SHELL_JITTER_DEG,
|
|
1173
|
+
SMOKE_HEX,
|
|
1174
|
+
SPARK_JITTER_DEG,
|
|
1175
|
+
STRETCH,
|
|
1176
|
+
STRIDE,
|
|
1177
|
+
TYPE,
|
|
1178
|
+
adaptiveDowngradeStep,
|
|
1179
|
+
adaptiveLevel,
|
|
1180
|
+
createAdaptiveState,
|
|
1181
|
+
createSim,
|
|
1182
|
+
deathGate,
|
|
1183
|
+
flickerNoise,
|
|
1184
|
+
hash11,
|
|
1185
|
+
heartOutline,
|
|
1186
|
+
hexToLinearRgb,
|
|
1187
|
+
hueRotate,
|
|
1188
|
+
linearToOklab,
|
|
1189
|
+
mixOklab,
|
|
1190
|
+
nextShellHue,
|
|
1191
|
+
oklabToLinear,
|
|
1192
|
+
outlineBurst,
|
|
1193
|
+
poissonIntervalMs,
|
|
1194
|
+
polygonOutline,
|
|
1195
|
+
rectExpandedContains,
|
|
1196
|
+
resolveQualityTier,
|
|
1197
|
+
ringBurst,
|
|
1198
|
+
sampleZone,
|
|
1199
|
+
shellHueColor,
|
|
1200
|
+
smoothstep,
|
|
1201
|
+
solveLaunch,
|
|
1202
|
+
sphereBurst,
|
|
1203
|
+
starOutline,
|
|
1204
|
+
willowBurst
|
|
1205
|
+
};
|