@agent-native/core 0.90.1 → 0.90.2
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/corpus/README.md +1 -1
- package/corpus/core/CHANGELOG.md +14 -0
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/client/AgentPanel.tsx +1 -1
- package/corpus/core/src/client/rich-markdown-editor/useCollabReconcile.ts +11 -6
- package/corpus/core/src/client/use-action.ts +39 -2
- package/corpus/core/src/client/use-db-sync.ts +44 -18
- package/corpus/core/src/db/create-get-db.ts +32 -2
- package/corpus/core/src/server/framework-request-handler.ts +52 -4
- package/corpus/templates/assets/.agents/skills/asset-generation/SKILL.md +5 -0
- package/corpus/templates/assets/.agents/skills/logo-composite/SKILL.md +34 -6
- package/corpus/templates/assets/AGENTS.md +23 -4
- package/corpus/templates/assets/actions/_generation-preset-settings.ts +48 -0
- package/corpus/templates/assets/actions/_helpers.ts +8 -1
- package/corpus/templates/assets/actions/_preset-skeleton-validation.ts +64 -0
- package/corpus/templates/assets/actions/create-generation-preset.ts +11 -3
- package/corpus/templates/assets/actions/generate-image-batch.ts +7 -2
- package/corpus/templates/assets/actions/generate-image.ts +342 -25
- package/corpus/templates/assets/actions/get-library.ts +4 -3
- package/corpus/templates/assets/actions/navigate.ts +2 -1
- package/corpus/templates/assets/actions/refresh-generation-run.ts +5 -1
- package/corpus/templates/assets/actions/update-asset.ts +1 -0
- package/corpus/templates/assets/actions/update-generation-preset.ts +8 -1
- package/corpus/templates/assets/actions/view-screen.ts +8 -1
- package/corpus/templates/assets/app/components/generation/GenerationResults.tsx +9 -1
- package/corpus/templates/assets/app/hooks/use-image-model-menu.ts +1 -0
- package/corpus/templates/assets/app/hooks/use-navigation-state.ts +11 -0
- package/corpus/templates/assets/app/i18n/zh-TW.ts +64 -0
- package/corpus/templates/assets/app/i18n-data.ts +650 -0
- package/corpus/templates/assets/app/routes/asset.$id.tsx +2 -1
- package/corpus/templates/assets/app/routes/brand-kits.$id.tsx +44 -33
- package/corpus/templates/assets/app/routes/brand-kits.$id_.presets.$presetId.tsx +1474 -0
- package/corpus/templates/assets/app/routes/library.tsx +43 -1
- package/corpus/templates/assets/server/lib/generation.ts +366 -44
- package/corpus/templates/assets/server/lib/image-processing.ts +252 -0
- package/corpus/templates/assets/server/lib/preset-skeleton.ts +137 -0
- package/corpus/templates/assets/shared/api.ts +47 -0
- package/corpus/templates/clips/app/components/library/library-layout.tsx +7 -2
- package/corpus/templates/clips/app/components/library/sort-menu.tsx +1 -1
- package/corpus/templates/clips/app/components/recorder/recorder-engine.ts +114 -33
- package/corpus/templates/clips/app/routes/_app.library._index.tsx +27 -1
- package/corpus/templates/clips/app/routes/record.tsx +157 -68
- package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/abort.post.ts +5 -5
- package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/chunk.post.ts +20 -3
- package/corpus/templates/clips/shared/finalize-recovery.ts +23 -3
- package/corpus/templates/content/AGENTS.md +52 -52
- package/corpus/templates/content/actions/_builder-cms-read-client.ts +188 -8
- package/corpus/templates/content/actions/_builder-docs-client.ts +41 -3
- package/corpus/templates/content/actions/_database-source-utils.ts +998 -160
- package/corpus/templates/content/actions/_database-utils.ts +44 -4
- package/corpus/templates/content/actions/_notion-action-utils.ts +6 -2
- package/corpus/templates/content/actions/add-content-database-source-field-property.ts +23 -1
- package/corpus/templates/content/actions/attach-content-database-source.ts +85 -12
- package/corpus/templates/content/actions/change-content-database-source-role.ts +9 -1
- package/corpus/templates/content/actions/delete-content-database.ts +1 -0
- package/corpus/templates/content/actions/get-document.ts +11 -2
- package/corpus/templates/content/actions/list-content-databases.ts +57 -9
- package/corpus/templates/content/actions/prepare-builder-source-review.ts +23 -6
- package/corpus/templates/content/actions/refresh-content-database-source.ts +26 -3
- package/corpus/templates/content/actions/restore-content-database.ts +1 -0
- package/corpus/templates/content/actions/update-document.ts +43 -0
- package/corpus/templates/content/app/components/editor/BuilderBodySyncingNotice.tsx +21 -0
- package/corpus/templates/content/app/components/editor/DocumentDatabase.tsx +0 -1
- package/corpus/templates/content/app/components/editor/DocumentEditor.tsx +70 -28
- package/corpus/templates/content/app/components/editor/DocumentProperties.tsx +69 -17
- package/corpus/templates/content/app/components/editor/VisualEditor.tsx +4 -4
- package/corpus/templates/content/app/components/editor/body-hydration.ts +112 -0
- package/corpus/templates/content/app/components/editor/builder-body-hydration-pump.ts +52 -0
- package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +9076 -2876
- package/corpus/templates/content/app/components/editor/database-sources/BuilderSourceReviewDialog.tsx +41 -1
- package/corpus/templates/content/app/components/editor/extensions/ImageBlock.tsx +36 -11
- package/corpus/templates/content/app/components/editor/previewDocumentSaveController.ts +21 -1
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +11 -1
- package/corpus/templates/content/app/components/sidebar/DocumentTreeItem.tsx +11 -8
- package/corpus/templates/content/app/global.css +41 -0
- package/corpus/templates/content/app/hooks/use-content-database.ts +346 -42
- package/corpus/templates/content/app/hooks/use-db-sync.ts +9 -0
- package/corpus/templates/content/app/hooks/use-documents.ts +47 -0
- package/corpus/templates/content/app/hooks/use-notion.ts +12 -10
- package/corpus/templates/content/app/i18n/zh-TW.ts +35 -0
- package/corpus/templates/content/app/i18n-data.ts +355 -0
- package/corpus/templates/content/app/root.tsx +22 -0
- package/corpus/templates/content/changelog/2026-07-01-builder-database-sources-keep-loading-rows-in-the-background.md +6 -0
- package/corpus/templates/content/changelog/2026-07-01-builder-source-attach-starts-with-usable-rows.md +6 -0
- package/corpus/templates/content/changelog/2026-07-01-builder-source-attachment-now-stays-connected-after-large.md +6 -0
- package/corpus/templates/content/changelog/2026-07-01-builder-source-refreshes-now-show-progress-for-large-docs-blog.md +6 -0
- package/corpus/templates/content/changelog/2026-07-01-database-pages-now-delete-to-trash-without-route-errors.md +6 -0
- package/corpus/templates/content/changelog/2026-07-02-builder-source-refreshes-recover-from-stalled-background-row.md +6 -0
- package/corpus/templates/content/changelog/2026-07-02-builder-sourced-rows-open-with-sync-protection.md +6 -0
- package/corpus/templates/content/changelog/2026-07-02-database-rows-and-pages-open-faster-from-recently-loaded-dat.md +6 -0
- package/corpus/templates/content/changelog/2026-07-02-preview-panels-close-reliably-narrow-sidebar-row-actions-sta.md +6 -0
- package/corpus/templates/content/changelog/2026-07-06-builder-sync-progress-no-longer-shows-continue.md +6 -0
- package/corpus/templates/content/shared/api.ts +13 -0
- package/corpus/templates/content/shared/builder-mdx.ts +16 -3
- package/corpus/templates/design/.agents/skills/design-generation/SKILL.md +23 -13
- package/corpus/templates/design/.agents/skills/responsive-breakpoints/SKILL.md +98 -0
- package/corpus/templates/design/.agents/skills/shader-fills/SKILL.md +162 -0
- package/corpus/templates/design/AGENTS.md +9 -2
- package/corpus/templates/design/actions/add-breakpoint.ts +6 -3
- package/corpus/templates/design/actions/apply-a11y-fix.ts +57 -37
- package/corpus/templates/design/actions/apply-component-prop-edit.ts +41 -20
- package/corpus/templates/design/actions/apply-motion-edit.ts +251 -38
- package/corpus/templates/design/actions/apply-shader-fill.ts +90 -66
- package/corpus/templates/design/actions/apply-visual-edit.ts +282 -55
- package/corpus/templates/design/actions/create-component.ts +29 -60
- package/corpus/templates/design/actions/create-file.ts +9 -2
- package/corpus/templates/design/actions/duplicate-design.ts +31 -2
- package/corpus/templates/design/actions/edit-design.ts +36 -38
- package/corpus/templates/design/actions/generate-design-title.ts +87 -0
- package/corpus/templates/design/actions/generate-design.ts +53 -18
- package/corpus/templates/design/actions/generate-screens.ts +108 -4
- package/corpus/templates/design/actions/get-motion-timeline.ts +35 -7
- package/corpus/templates/design/actions/insert-asset.ts +34 -29
- package/corpus/templates/design/actions/insert-design-native-asset.ts +129 -32
- package/corpus/templates/design/actions/insert-figma-library-asset.ts +35 -30
- package/corpus/templates/design/actions/present-design-variants.ts +7 -2
- package/corpus/templates/design/actions/remove-motion-timeline.ts +31 -36
- package/corpus/templates/design/actions/update-file.ts +190 -75
- package/corpus/templates/design/app/components/design/BreakpointBar.tsx +403 -0
- package/corpus/templates/design/app/components/design/CanvasContextMenu.tsx +469 -222
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +708 -53
- package/corpus/templates/design/app/components/design/DesignExtensionsPanel.tsx +83 -3
- package/corpus/templates/design/app/components/design/EditPanel.tsx +1091 -6948
- package/corpus/templates/design/app/components/design/LayersPanel.tsx +419 -85
- package/corpus/templates/design/app/components/design/MotionDock.tsx +1124 -103
- package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +2610 -1398
- package/corpus/templates/design/app/components/design/ReadOnlyDesignBanner.tsx +22 -0
- package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +2182 -235
- package/corpus/templates/design/app/components/design/bridge/motion-preview.bridge.ts +187 -11
- package/corpus/templates/design/app/components/design/bridge/shader-fill-preview.bridge.ts +376 -1
- package/corpus/templates/design/app/components/design/bridge/shader-runtime.bridge.ts +746 -0
- package/corpus/templates/design/app/components/design/canvas-primitive-style.ts +17 -0
- package/corpus/templates/design/app/components/design/code-workbench/SideBar.tsx +1 -1
- package/corpus/templates/design/app/components/design/code-workbench/explorer/FileTree.tsx +1 -3
- package/corpus/templates/design/app/components/design/code-workbench/quickinput/QuickInput.tsx +1 -1
- package/corpus/templates/design/app/components/design/edit-panel/appearance-properties.tsx +518 -0
- package/corpus/templates/design/app/components/design/edit-panel/code-inspect-helpers.tsx +562 -0
- package/corpus/templates/design/app/components/design/edit-panel/component-section.tsx +763 -0
- package/corpus/templates/design/app/components/design/edit-panel/document-colors.ts +94 -0
- package/corpus/templates/design/app/components/design/edit-panel/effects-properties.tsx +780 -0
- package/corpus/templates/design/app/components/design/edit-panel/element-classification.ts +446 -0
- package/corpus/templates/design/app/components/design/edit-panel/element-identity.ts +79 -0
- package/corpus/templates/design/app/components/design/edit-panel/field-primitives.tsx +315 -0
- package/corpus/templates/design/app/components/design/edit-panel/fill-gradient-helpers.ts +344 -0
- package/corpus/templates/design/app/components/design/edit-panel/fill-properties.tsx +594 -0
- package/corpus/templates/design/app/components/design/edit-panel/frame-presets-panel.tsx +119 -0
- package/corpus/templates/design/app/components/design/edit-panel/inspector-controls.tsx +248 -0
- package/corpus/templates/design/app/components/design/edit-panel/interaction-state-helpers.ts +45 -0
- package/corpus/templates/design/app/components/design/edit-panel/layout-properties.tsx +693 -0
- package/corpus/templates/design/app/components/design/edit-panel/panel-primitives.tsx +724 -0
- package/corpus/templates/design/app/components/design/edit-panel/position-helpers.ts +207 -0
- package/corpus/templates/design/app/components/design/edit-panel/position-layout-properties.tsx +628 -0
- package/corpus/templates/design/app/components/design/edit-panel/selection-helpers.ts +91 -0
- package/corpus/templates/design/app/components/design/edit-panel/stroke-properties.tsx +649 -0
- package/corpus/templates/design/app/components/design/edit-panel/style-change-types.ts +118 -0
- package/corpus/templates/design/app/components/design/edit-panel/style-options.ts +88 -0
- package/corpus/templates/design/app/components/design/edit-panel/transform-helpers.ts +100 -0
- package/corpus/templates/design/app/components/design/edit-panel/typography-helpers.ts +117 -0
- package/corpus/templates/design/app/components/design/edit-panel/typography-properties.tsx +501 -0
- package/corpus/templates/design/app/components/design/inspector/AutoLayoutMatrix.tsx +91 -40
- package/corpus/templates/design/app/components/design/inspector/BreakpointOverrideIndicator.tsx +82 -0
- package/corpus/templates/design/app/components/design/inspector/DesignColorPicker.tsx +189 -87
- package/corpus/templates/design/app/components/design/inspector/GlslShaderPanel.tsx +1097 -0
- package/corpus/templates/design/app/components/design/inspector/GradientEditor.tsx +44 -0
- package/corpus/templates/design/app/components/design/inspector/InteractionStatePanel.tsx +258 -0
- package/corpus/templates/design/app/components/design/inspector/MotionKeyframeDiamond.tsx +144 -0
- package/corpus/templates/design/app/components/design/inspector/ScrubInput.tsx +99 -9
- package/corpus/templates/design/app/components/design/inspector/frame-size-presets.ts +116 -0
- package/corpus/templates/design/app/components/design/inspector/index.ts +26 -0
- package/corpus/templates/design/app/components/design/inspector/scrub-input-utils.ts +29 -0
- package/corpus/templates/design/app/components/design/multi-screen/alt-hover-measurement.ts +171 -0
- package/corpus/templates/design/app/components/design/multi-screen/board-surface-html.ts +220 -0
- package/corpus/templates/design/app/components/design/multi-screen/chrome-transitions.ts +35 -0
- package/corpus/templates/design/app/components/design/multi-screen/cross-screen-drop.ts +134 -0
- package/corpus/templates/design/app/components/design/multi-screen/culling.ts +185 -0
- package/corpus/templates/design/app/components/design/multi-screen/gradient-overlay-geometry.ts +120 -0
- package/corpus/templates/design/app/components/design/multi-screen/types.ts +892 -0
- package/corpus/templates/design/app/components/design/multi-screen/vector-edit-geometry.ts +21 -0
- package/corpus/templates/design/app/components/design/types.ts +15 -0
- package/corpus/templates/design/app/components/editor/PromptDialog.tsx +109 -5
- package/corpus/templates/design/app/global.css +8 -8
- package/corpus/templates/design/app/hooks/useDesignHotkeys.ts +259 -2
- package/corpus/templates/design/app/i18n/zh-TW.ts +163 -9
- package/corpus/templates/design/app/i18n-breakpoints.ts +205 -0
- package/corpus/templates/design/app/i18n-data.ts +1664 -152
- package/corpus/templates/design/app/i18n-motion.ts +563 -0
- package/corpus/templates/design/app/lib/design-import.ts +73 -0
- package/corpus/templates/design/app/pages/Index.tsx +41 -22
- package/corpus/templates/design/changelog/2026-06-29-design-inspector-controls-now-match-figmas-softer-dark-chrome.md +1 -1
- package/corpus/templates/design/changelog/2026-06-30-design-now-has-a-figma-style-left-rail-for-file-agent-assets.md +1 -1
- package/corpus/templates/design/changelog/2026-06-30-design-tools-now-use-a-quieter-figma-style-list-layout.md +1 -1
- package/corpus/templates/design/changelog/2026-06-30-multi-select-outlines-now-stay-consistent-across-all-screens.md +1 -1
- package/corpus/templates/design/changelog/2026-07-03-canvas-interactions-now-match-figma-rotation-aware-resizing-.md +1 -1
- package/corpus/templates/design/changelog/2026-07-03-layers-panel-matches-figma-top-layer-on-top-drag-with-auto-s.md +1 -1
- package/corpus/templates/design/changelog/2026-07-05-designs-get-ai-generated-names-from-your-prompt.md +6 -0
- package/corpus/templates/design/changelog/2026-07-05-local-code-screens-keep-their-connection-when-duplicated-and.md +6 -0
- package/corpus/templates/design/changelog/2026-07-05-press-a-to-draw-screens-on-the-canvas-inside-a-screen-it-dr.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-3d-rotation-and-perspective-controls-on-every-element.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-ai-generated-and-duplicated-screens-now-get-their-editor-sel.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-applying-shaders-and-fills-in-quick-succession-can-no-longer.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-breakpoint-frames-in-the-overview-now-support-click-to-selec.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-breakpoint-segments-in-the-inspector-now-show-a-device-icon-.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-breakpoint-targeting-now-lives-in-one-compact-control-in-the.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-canvas-edits-can-no-longer-be-overwritten-by-stale-collabora.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-canvas-edits-inside-screens-save-reliably-again.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-cleaner-inspector-removed-the-ask-ai-box-from-the-design-tab.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-clicking-empty-canvas-space-now-deselects-an-element-inside-.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-dragging-an-element-onto-a-rectangle-now-nests-it-inside-wit.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-dragging-screens-and-objects-on-the-canvas-is-now-much-smoot.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-drawing-a-shape-or-text-on-the-canvas-no-longer-flashes-away.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-dropping-an-element-between-two-others-inside-a-screen-now-s.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-duplicating-a-screen-now-places-the-copy-exactly-where-you-d.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-edit-gradients-directly-on-elements-inside-screens-scale-str.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-edits-from-collaborators-and-the-agent-now-update-the-canvas.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-fixed-a-bug-where-most-style-position-and-text-edits-briefly.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-fixed-a-confusing-raw-error-message-when-a-file-upload-fails.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-fixed-a-rare-case-where-an-edit-could-be-silently-overwritte.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-fixed-inserted-assets-sometimes-disappearing-reappearing-or-.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-fixed-inspector-value-scrubbing-producing-erratic-numbers-an.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-fixed-padding-gap-and-min-max-size-scrubbing-not-updating-th.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-fixed-text-stroke-color-turning-black-and-glyphs-disappearin.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-fixed-the-collapsed-effects-and-stroke-inspector-sections-sh.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-fixed-the-new-design-dialog-closing-unexpectedly-when-using-.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-fixed-the-typography-section-missing-when-selecting-text-nes.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-full-view-no-longer-flashes-back-to-the-overview-on-entry-no.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-keyframe-animation-timeline-per-property-keyframes-easing-cu.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-moving-restyling-and-scrubbing-values-on-elements-in-ai-gene.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-padding-and-corner-radius-value-scrubbing-now-snaps-to-whole.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-padding-handles-now-only-resize-on-the-handle-line-itself-sh.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-preview-and-edit-hover-focus-and-pressed-states-with-real-cs.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-promoting-an-element-to-a-component-now-works-correctly-for-.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-reduced-url-history-churn-and-selection-overlay-flicker-whil.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-removed-the-decorative-dot-before-screen-names-in-the-overvi.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-responsive-breakpoints-edit-at-any-width-with-cascading-over.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-screen-labels-no-longer-turn-blue-when-you-hover-inside-the-.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-scrolling-a-screen-with-an-element-selected-stays-smooth-on-.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-selecting-multiple-elements-and-dragging-now-moves-the-whole.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-selection-borders-handles-and-value-readouts-now-stay-the-sa.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-selection-handles-and-editing-chrome-now-stay-a-constant-siz.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-shader-fills-and-effects-ai-authored-or-preset-glsl-shaders-.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-text-drawn-on-the-canvas-now-defaults-to-white-and-inter-in-.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-text-dropped-into-a-shape-now-stays-readable-instead-of-disa.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-the-add-tweak-controls-prompt-no-longer-jumps-to-the-corner-.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-the-padding-value-readout-now-stays-visible-while-you-hover-.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-the-selected-element-attachment-now-clears-from-the-chat-com.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-the-zoom-menu-is-more-compact-with-tight-rows-and-right-alig.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-undo-and-redo-no-longer-flash-the-screen-changes-now-apply-i.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-zoom-presets-like-zoom-to-50-now-stay-on-the-focused-screen-.md +6 -0
- package/corpus/templates/design/server/lib/import-design-files.ts +11 -2
- package/corpus/templates/design/server/source-workspace.ts +139 -59
- package/corpus/templates/design/shared/board-file.ts +11 -2
- package/corpus/templates/design/shared/breakpoint-media.ts +543 -0
- package/corpus/templates/design/shared/canvas-math.ts +354 -35
- package/corpus/templates/design/shared/code-layer.ts +277 -8
- package/corpus/templates/design/shared/design-state.ts +11 -4
- package/corpus/templates/design/shared/interaction-states.ts +548 -0
- package/corpus/templates/design/shared/motion-compiler.ts +186 -23
- package/corpus/templates/design/shared/motion-easing.ts +294 -0
- package/corpus/templates/design/shared/motion-timeline.ts +400 -34
- package/corpus/templates/design/shared/prompt-title.ts +95 -0
- package/corpus/templates/design/shared/responsive-classes.ts +448 -10
- package/corpus/templates/design/shared/screen-annotation.ts +46 -0
- package/corpus/templates/design/shared/shader-fills.ts +1009 -0
- package/corpus/templates/design/shared/shader-presets.ts +852 -4
- package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +15 -2
- package/corpus/templates/slides/app/components/editor/ImportButton.tsx +10 -1
- package/corpus/templates/slides/app/lib/upload-response.ts +71 -0
- package/dist/client/AgentPanel.js +1 -1
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/rich-markdown-editor/useCollabReconcile.d.ts.map +1 -1
- package/dist/client/rich-markdown-editor/useCollabReconcile.js +11 -6
- package/dist/client/rich-markdown-editor/useCollabReconcile.js.map +1 -1
- package/dist/client/use-action.d.ts +3 -0
- package/dist/client/use-action.d.ts.map +1 -1
- package/dist/client/use-action.js +34 -3
- package/dist/client/use-action.js.map +1 -1
- package/dist/client/use-db-sync.d.ts +4 -0
- package/dist/client/use-db-sync.d.ts.map +1 -1
- package/dist/client/use-db-sync.js +37 -18
- package/dist/client/use-db-sync.js.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/db/create-get-db.d.ts +25 -0
- package/dist/db/create-get-db.d.ts.map +1 -1
- package/dist/db/create-get-db.js +25 -2
- package/dist/db/create-get-db.js.map +1 -1
- package/dist/observability/routes.d.ts +3 -3
- package/dist/secrets/routes.d.ts +9 -9
- package/dist/server/framework-request-handler.d.ts.map +1 -1
- package/dist/server/framework-request-handler.js +37 -1
- package/dist/server/framework-request-handler.js.map +1 -1
- package/package.json +1 -1
- package/corpus/templates/design/app/components/design/inspector/InspectorAiActions.tsx +0 -153
- package/corpus/templates/design/app/hooks/useAgentEditRequest.ts +0 -133
- package/corpus/templates/design/app/pages/DesignEditor.tsx +0 -22924
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Single source of truth for the
|
|
2
|
+
* Single source of truth for the shader preset catalogs:
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* 1. The 8 curated GPU presets backed by @paper-design/shaders-react
|
|
5
|
+
* (legacy CSS-approximation persist path — `SHADER_PRESETS`).
|
|
6
|
+
* 2. The code-backed GLSL preset library (`GLSL_SHADER_PRESETS`, bottom of
|
|
7
|
+
* this file) — full fragment sources + uniform manifests persisted
|
|
8
|
+
* verbatim into screen HTML per shared/shader-fills.ts, readable and
|
|
9
|
+
* editable in the Code panel. This is the library behind the "Shader"
|
|
10
|
+
* paint type's Presets section and the Shader effect entry.
|
|
11
|
+
*
|
|
12
|
+
* This file intentionally does NOT import @paper-design/shaders-react (and
|
|
13
|
+
* imports only types from shader-fills.ts) so it remains SSR-safe and can be
|
|
14
|
+
* imported in Vitest without a DOM. All legacy param metadata is inlined from
|
|
15
|
+
* the package defaults (v0.0.76).
|
|
7
16
|
*/
|
|
8
17
|
|
|
18
|
+
import type { GlslShaderMode, GlslUniformManifest } from "./shader-fills";
|
|
19
|
+
|
|
9
20
|
// ---------------------------------------------------------------------------
|
|
10
21
|
// Core types
|
|
11
22
|
// ---------------------------------------------------------------------------
|
|
@@ -790,3 +801,840 @@ export function validateDescriptor(descriptor: ShaderDescriptor): {
|
|
|
790
801
|
|
|
791
802
|
return { valid: errors.length === 0, errors };
|
|
792
803
|
}
|
|
804
|
+
|
|
805
|
+
// ===========================================================================
|
|
806
|
+
// Code-backed GLSL preset library
|
|
807
|
+
// ===========================================================================
|
|
808
|
+
//
|
|
809
|
+
// Each preset carries a complete WebGL1 (GLSL ES 1.00) fragment source plus
|
|
810
|
+
// a uniforms manifest matching shared/shader-fills.ts. Applying a preset
|
|
811
|
+
// stamps the source into the screen HTML — after that it is the user's (and
|
|
812
|
+
// the agent's) code: fully editable in the Code panel, knobs driven by the
|
|
813
|
+
// manifest. Fills paint standalone backgrounds; effects render transparent
|
|
814
|
+
// overlays composited above the element's content.
|
|
815
|
+
//
|
|
816
|
+
// Built-ins available to every preset: u_time (seconds), u_resolution (px).
|
|
817
|
+
|
|
818
|
+
export type GlslShaderPresetCategory =
|
|
819
|
+
| "gradient-flow"
|
|
820
|
+
| "waves"
|
|
821
|
+
| "noise"
|
|
822
|
+
| "pattern"
|
|
823
|
+
| "texture"
|
|
824
|
+
| "retro";
|
|
825
|
+
|
|
826
|
+
export const GLSL_SHADER_PRESET_CATEGORY_LABELS: Record<
|
|
827
|
+
GlslShaderPresetCategory,
|
|
828
|
+
string
|
|
829
|
+
> = {
|
|
830
|
+
"gradient-flow": "Gradient flow", // i18n-ignore shader preset category
|
|
831
|
+
waves: "Waves", // i18n-ignore shader preset category
|
|
832
|
+
noise: "Noise", // i18n-ignore shader preset category
|
|
833
|
+
pattern: "Patterns", // i18n-ignore shader preset category
|
|
834
|
+
texture: "Texture", // i18n-ignore shader preset category
|
|
835
|
+
retro: "Retro", // i18n-ignore shader preset category
|
|
836
|
+
};
|
|
837
|
+
|
|
838
|
+
export interface GlslShaderPreset {
|
|
839
|
+
/** Stable kebab-case preset id — seeds new shader ids/names. */
|
|
840
|
+
name: string;
|
|
841
|
+
label: string;
|
|
842
|
+
description: string;
|
|
843
|
+
category: GlslShaderPresetCategory;
|
|
844
|
+
mode: GlslShaderMode;
|
|
845
|
+
/** Static CSS approximation used for preset-grid thumbnails (no WebGL). */
|
|
846
|
+
previewCss: string;
|
|
847
|
+
uniforms: GlslUniformManifest;
|
|
848
|
+
glsl: string;
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
const GLSL_NOISE_HELPERS = `
|
|
852
|
+
float anHash21(vec2 p) {
|
|
853
|
+
p = fract(p * vec2(123.34, 456.21));
|
|
854
|
+
p += dot(p, p + 45.32);
|
|
855
|
+
return fract(p.x * p.y);
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
float anValueNoise(vec2 p) {
|
|
859
|
+
vec2 i = floor(p);
|
|
860
|
+
vec2 f = fract(p);
|
|
861
|
+
vec2 u = f * f * (3.0 - 2.0 * f);
|
|
862
|
+
float a = anHash21(i);
|
|
863
|
+
float b = anHash21(i + vec2(1.0, 0.0));
|
|
864
|
+
float c = anHash21(i + vec2(0.0, 1.0));
|
|
865
|
+
float d = anHash21(i + vec2(1.0, 1.0));
|
|
866
|
+
return mix(mix(a, b, u.x), mix(c, d, u.x), u.y);
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
float anFbm(vec2 p) {
|
|
870
|
+
float v = 0.0;
|
|
871
|
+
float amp = 0.5;
|
|
872
|
+
for (int i = 0; i < 5; i++) {
|
|
873
|
+
v += amp * anValueNoise(p);
|
|
874
|
+
p = p * 2.03 + vec2(17.13, 9.57);
|
|
875
|
+
amp *= 0.5;
|
|
876
|
+
}
|
|
877
|
+
return v;
|
|
878
|
+
}
|
|
879
|
+
`.trim();
|
|
880
|
+
|
|
881
|
+
export const GLSL_SHADER_PRESETS: readonly GlslShaderPreset[] = [
|
|
882
|
+
// ── Fills ─────────────────────────────────────────────────────────────────
|
|
883
|
+
{
|
|
884
|
+
name: "mesh-gradient",
|
|
885
|
+
label: "Mesh Gradient",
|
|
886
|
+
description:
|
|
887
|
+
"Four color points drifting across the surface, blended by distance.",
|
|
888
|
+
category: "gradient-flow",
|
|
889
|
+
mode: "fill",
|
|
890
|
+
previewCss:
|
|
891
|
+
"radial-gradient(circle at 20% 25%, #ff9a9e 0%, transparent 55%), " +
|
|
892
|
+
"radial-gradient(circle at 80% 25%, #a18cd1 0%, transparent 55%), " +
|
|
893
|
+
"radial-gradient(circle at 25% 80%, #fbc2eb 0%, transparent 55%), " +
|
|
894
|
+
"radial-gradient(circle at 80% 75%, #fad0c4 0%, transparent 60%), #a18cd1",
|
|
895
|
+
uniforms: {
|
|
896
|
+
u_color_a: { type: "color", value: "#ff9a9e", label: "Color 1" },
|
|
897
|
+
u_color_b: { type: "color", value: "#a18cd1", label: "Color 2" },
|
|
898
|
+
u_color_c: { type: "color", value: "#fbc2eb", label: "Color 3" },
|
|
899
|
+
u_color_d: { type: "color", value: "#fad0c4", label: "Color 4" },
|
|
900
|
+
u_drift: {
|
|
901
|
+
type: "float",
|
|
902
|
+
value: 0.6,
|
|
903
|
+
min: 0,
|
|
904
|
+
max: 2,
|
|
905
|
+
step: 0.01,
|
|
906
|
+
label: "Drift",
|
|
907
|
+
},
|
|
908
|
+
u_blend: {
|
|
909
|
+
type: "float",
|
|
910
|
+
value: 2.2,
|
|
911
|
+
min: 0.5,
|
|
912
|
+
max: 6,
|
|
913
|
+
step: 0.05,
|
|
914
|
+
label: "Blend",
|
|
915
|
+
},
|
|
916
|
+
},
|
|
917
|
+
glsl: `
|
|
918
|
+
precision highp float;
|
|
919
|
+
uniform vec2 u_resolution;
|
|
920
|
+
uniform float u_time;
|
|
921
|
+
uniform vec3 u_color_a;
|
|
922
|
+
uniform vec3 u_color_b;
|
|
923
|
+
uniform vec3 u_color_c;
|
|
924
|
+
uniform vec3 u_color_d;
|
|
925
|
+
uniform float u_drift;
|
|
926
|
+
uniform float u_blend;
|
|
927
|
+
|
|
928
|
+
void main() {
|
|
929
|
+
vec2 uv = gl_FragCoord.xy / u_resolution;
|
|
930
|
+
float t = u_time * u_drift;
|
|
931
|
+
vec2 p0 = vec2(0.20 + 0.16 * sin(t * 0.60), 0.24 + 0.14 * cos(t * 0.50));
|
|
932
|
+
vec2 p1 = vec2(0.82 + 0.12 * sin(t * 0.44 + 2.1), 0.28 + 0.16 * cos(t * 0.62 + 1.3));
|
|
933
|
+
vec2 p2 = vec2(0.26 + 0.15 * sin(t * 0.52 + 4.2), 0.78 + 0.12 * cos(t * 0.47 + 2.8));
|
|
934
|
+
vec2 p3 = vec2(0.78 + 0.14 * sin(t * 0.58 + 1.7), 0.76 + 0.15 * cos(t * 0.55 + 4.6));
|
|
935
|
+
float w0 = 1.0 / pow(distance(uv, p0) + 0.02, u_blend);
|
|
936
|
+
float w1 = 1.0 / pow(distance(uv, p1) + 0.02, u_blend);
|
|
937
|
+
float w2 = 1.0 / pow(distance(uv, p2) + 0.02, u_blend);
|
|
938
|
+
float w3 = 1.0 / pow(distance(uv, p3) + 0.02, u_blend);
|
|
939
|
+
vec3 color = (u_color_a * w0 + u_color_b * w1 + u_color_c * w2 + u_color_d * w3)
|
|
940
|
+
/ (w0 + w1 + w2 + w3);
|
|
941
|
+
gl_FragColor = vec4(color, 1.0);
|
|
942
|
+
}
|
|
943
|
+
`.trim(),
|
|
944
|
+
},
|
|
945
|
+
{
|
|
946
|
+
name: "glowing-wave",
|
|
947
|
+
label: "Glowing Wave",
|
|
948
|
+
description:
|
|
949
|
+
"Luminous sine waves with adjustable amplitude, frequency, and glow.",
|
|
950
|
+
category: "waves",
|
|
951
|
+
mode: "fill",
|
|
952
|
+
previewCss:
|
|
953
|
+
"linear-gradient(180deg, #05070f 32%, #59d9ff88 48%, #59d9ff 50%, " +
|
|
954
|
+
"#59d9ff88 52%, #05070f 68%)",
|
|
955
|
+
uniforms: {
|
|
956
|
+
u_wave_color: { type: "color", value: "#59d9ff", label: "Wave color" },
|
|
957
|
+
u_bg_color: { type: "color", value: "#05070f", label: "Background" },
|
|
958
|
+
u_amplitude: {
|
|
959
|
+
type: "float",
|
|
960
|
+
value: 0.16,
|
|
961
|
+
min: 0,
|
|
962
|
+
max: 0.5,
|
|
963
|
+
step: 0.005,
|
|
964
|
+
label: "Amplitude",
|
|
965
|
+
},
|
|
966
|
+
u_frequency: {
|
|
967
|
+
type: "float",
|
|
968
|
+
value: 6,
|
|
969
|
+
min: 1,
|
|
970
|
+
max: 20,
|
|
971
|
+
step: 0.1,
|
|
972
|
+
label: "Frequency",
|
|
973
|
+
},
|
|
974
|
+
u_glow: {
|
|
975
|
+
type: "float",
|
|
976
|
+
value: 0.02,
|
|
977
|
+
min: 0.002,
|
|
978
|
+
max: 0.1,
|
|
979
|
+
step: 0.001,
|
|
980
|
+
label: "Glow",
|
|
981
|
+
},
|
|
982
|
+
u_speed: {
|
|
983
|
+
type: "float",
|
|
984
|
+
value: 1,
|
|
985
|
+
min: 0,
|
|
986
|
+
max: 4,
|
|
987
|
+
step: 0.05,
|
|
988
|
+
label: "Speed",
|
|
989
|
+
},
|
|
990
|
+
},
|
|
991
|
+
glsl: `
|
|
992
|
+
precision highp float;
|
|
993
|
+
uniform vec2 u_resolution;
|
|
994
|
+
uniform float u_time;
|
|
995
|
+
uniform vec3 u_wave_color;
|
|
996
|
+
uniform vec3 u_bg_color;
|
|
997
|
+
uniform float u_amplitude;
|
|
998
|
+
uniform float u_frequency;
|
|
999
|
+
uniform float u_glow;
|
|
1000
|
+
uniform float u_speed;
|
|
1001
|
+
|
|
1002
|
+
void main() {
|
|
1003
|
+
vec2 uv = gl_FragCoord.xy / u_resolution;
|
|
1004
|
+
float t = u_time * u_speed;
|
|
1005
|
+
vec3 color = u_bg_color;
|
|
1006
|
+
for (int i = 0; i < 3; i++) {
|
|
1007
|
+
float fi = float(i);
|
|
1008
|
+
float phase = t * (0.7 + fi * 0.25) + fi * 2.4;
|
|
1009
|
+
float y = 0.5
|
|
1010
|
+
+ u_amplitude * sin(uv.x * u_frequency + phase)
|
|
1011
|
+
+ u_amplitude * 0.35 * sin(uv.x * u_frequency * 1.7 - phase * 1.3);
|
|
1012
|
+
float d = abs(uv.y - y);
|
|
1013
|
+
float glow = u_glow / max(d, 0.002);
|
|
1014
|
+
color += u_wave_color * min(glow, 8.0) * (0.6 - fi * 0.18) * 0.55;
|
|
1015
|
+
}
|
|
1016
|
+
gl_FragColor = vec4(clamp(color, 0.0, 1.0), 1.0);
|
|
1017
|
+
}
|
|
1018
|
+
`.trim(),
|
|
1019
|
+
},
|
|
1020
|
+
{
|
|
1021
|
+
name: "water-caustics",
|
|
1022
|
+
label: "Water Caustics",
|
|
1023
|
+
description:
|
|
1024
|
+
"Shimmering underwater light patterns with a loopable phase control.",
|
|
1025
|
+
category: "waves",
|
|
1026
|
+
mode: "fill",
|
|
1027
|
+
previewCss:
|
|
1028
|
+
"radial-gradient(circle at 30% 35%, #7fd4ff55 0%, transparent 45%), " +
|
|
1029
|
+
"radial-gradient(circle at 70% 60%, #7fd4ff33 0%, transparent 40%), #06283d",
|
|
1030
|
+
uniforms: {
|
|
1031
|
+
u_deep_color: { type: "color", value: "#06283d", label: "Water" },
|
|
1032
|
+
u_light_color: { type: "color", value: "#7fd4ff", label: "Light" },
|
|
1033
|
+
u_scale: {
|
|
1034
|
+
type: "float",
|
|
1035
|
+
value: 3,
|
|
1036
|
+
min: 1,
|
|
1037
|
+
max: 10,
|
|
1038
|
+
step: 0.1,
|
|
1039
|
+
label: "Scale",
|
|
1040
|
+
},
|
|
1041
|
+
u_phase: {
|
|
1042
|
+
type: "float",
|
|
1043
|
+
value: 0,
|
|
1044
|
+
min: 0,
|
|
1045
|
+
max: 1,
|
|
1046
|
+
step: 0.01,
|
|
1047
|
+
label: "Phase",
|
|
1048
|
+
},
|
|
1049
|
+
u_speed: {
|
|
1050
|
+
type: "float",
|
|
1051
|
+
value: 0.6,
|
|
1052
|
+
min: 0,
|
|
1053
|
+
max: 3,
|
|
1054
|
+
step: 0.05,
|
|
1055
|
+
label: "Speed",
|
|
1056
|
+
},
|
|
1057
|
+
},
|
|
1058
|
+
glsl: `
|
|
1059
|
+
precision highp float;
|
|
1060
|
+
uniform vec2 u_resolution;
|
|
1061
|
+
uniform float u_time;
|
|
1062
|
+
uniform vec3 u_deep_color;
|
|
1063
|
+
uniform vec3 u_light_color;
|
|
1064
|
+
uniform float u_scale;
|
|
1065
|
+
uniform float u_phase;
|
|
1066
|
+
uniform float u_speed;
|
|
1067
|
+
|
|
1068
|
+
void main() {
|
|
1069
|
+
vec2 uv = gl_FragCoord.xy / u_resolution;
|
|
1070
|
+
vec2 p = uv * u_scale;
|
|
1071
|
+
float t = u_time * u_speed + u_phase * 6.28318;
|
|
1072
|
+
vec2 i0 = p;
|
|
1073
|
+
float c = 0.0;
|
|
1074
|
+
for (int n = 0; n < 4; n++) {
|
|
1075
|
+
float fn = float(n);
|
|
1076
|
+
float tt = t * (1.0 - 0.075 * fn) + fn * 1.7;
|
|
1077
|
+
i0 = p + vec2(cos(tt - i0.x) + sin(tt + i0.y), sin(tt - i0.y) + cos(tt + i0.x));
|
|
1078
|
+
c += 1.0 / max(length(vec2(p.x / (sin(i0.x + tt) + 2.0), p.y / (cos(i0.y + tt) + 2.0))), 0.001);
|
|
1079
|
+
}
|
|
1080
|
+
c /= 4.0;
|
|
1081
|
+
c = 1.17 - pow(abs(c), 1.4);
|
|
1082
|
+
float glow = pow(abs(c), 8.0);
|
|
1083
|
+
vec3 color = u_deep_color + u_light_color * clamp(glow, 0.0, 1.0);
|
|
1084
|
+
gl_FragColor = vec4(clamp(color, 0.0, 1.0), 1.0);
|
|
1085
|
+
}
|
|
1086
|
+
`.trim(),
|
|
1087
|
+
},
|
|
1088
|
+
{
|
|
1089
|
+
name: "fractal-noise",
|
|
1090
|
+
label: "Fractal Noise",
|
|
1091
|
+
description: "Organic domain-warped fBm noise blended between two colors.",
|
|
1092
|
+
category: "noise",
|
|
1093
|
+
mode: "fill",
|
|
1094
|
+
previewCss:
|
|
1095
|
+
"radial-gradient(ellipse at 30% 30%, #e0aaff66 0%, transparent 60%), " +
|
|
1096
|
+
"radial-gradient(ellipse at 75% 70%, #e0aaff44 0%, transparent 55%), #10002b",
|
|
1097
|
+
uniforms: {
|
|
1098
|
+
u_color_a: { type: "color", value: "#10002b", label: "Base" },
|
|
1099
|
+
u_color_b: { type: "color", value: "#e0aaff", label: "Accent" },
|
|
1100
|
+
u_scale: {
|
|
1101
|
+
type: "float",
|
|
1102
|
+
value: 3,
|
|
1103
|
+
min: 0.5,
|
|
1104
|
+
max: 12,
|
|
1105
|
+
step: 0.1,
|
|
1106
|
+
label: "Scale",
|
|
1107
|
+
},
|
|
1108
|
+
u_contrast: {
|
|
1109
|
+
type: "float",
|
|
1110
|
+
value: 1.4,
|
|
1111
|
+
min: 0.2,
|
|
1112
|
+
max: 4,
|
|
1113
|
+
step: 0.05,
|
|
1114
|
+
label: "Contrast",
|
|
1115
|
+
},
|
|
1116
|
+
u_drift: {
|
|
1117
|
+
type: "float",
|
|
1118
|
+
value: 0.15,
|
|
1119
|
+
min: 0,
|
|
1120
|
+
max: 1,
|
|
1121
|
+
step: 0.01,
|
|
1122
|
+
label: "Drift",
|
|
1123
|
+
},
|
|
1124
|
+
},
|
|
1125
|
+
glsl: `
|
|
1126
|
+
precision highp float;
|
|
1127
|
+
uniform vec2 u_resolution;
|
|
1128
|
+
uniform float u_time;
|
|
1129
|
+
uniform vec3 u_color_a;
|
|
1130
|
+
uniform vec3 u_color_b;
|
|
1131
|
+
uniform float u_scale;
|
|
1132
|
+
uniform float u_contrast;
|
|
1133
|
+
uniform float u_drift;
|
|
1134
|
+
|
|
1135
|
+
${GLSL_NOISE_HELPERS}
|
|
1136
|
+
|
|
1137
|
+
void main() {
|
|
1138
|
+
vec2 uv = gl_FragCoord.xy / u_resolution;
|
|
1139
|
+
vec2 p = uv * u_scale + vec2(u_time * u_drift, 0.0);
|
|
1140
|
+
float warp = anFbm(p + vec2(u_time * u_drift * 0.5));
|
|
1141
|
+
float n = anFbm(p + warp * 1.6);
|
|
1142
|
+
n = clamp((n - 0.5) * u_contrast + 0.5, 0.0, 1.0);
|
|
1143
|
+
gl_FragColor = vec4(mix(u_color_a, u_color_b, n), 1.0);
|
|
1144
|
+
}
|
|
1145
|
+
`.trim(),
|
|
1146
|
+
},
|
|
1147
|
+
{
|
|
1148
|
+
name: "clouds",
|
|
1149
|
+
label: "Clouds",
|
|
1150
|
+
description:
|
|
1151
|
+
"Procedural drifting clouds with adjustable coverage and scale.",
|
|
1152
|
+
category: "noise",
|
|
1153
|
+
mode: "fill",
|
|
1154
|
+
previewCss:
|
|
1155
|
+
"radial-gradient(ellipse at 30% 40%, #ffffffcc 0%, transparent 50%), " +
|
|
1156
|
+
"radial-gradient(ellipse at 70% 30%, #ffffff99 0%, transparent 45%), #5aa7e6",
|
|
1157
|
+
uniforms: {
|
|
1158
|
+
u_sky_color: { type: "color", value: "#5aa7e6", label: "Sky" },
|
|
1159
|
+
u_cloud_color: { type: "color", value: "#ffffff", label: "Clouds" },
|
|
1160
|
+
u_cover: {
|
|
1161
|
+
type: "float",
|
|
1162
|
+
value: 0.5,
|
|
1163
|
+
min: 0,
|
|
1164
|
+
max: 1,
|
|
1165
|
+
step: 0.01,
|
|
1166
|
+
label: "Coverage",
|
|
1167
|
+
},
|
|
1168
|
+
u_scale: {
|
|
1169
|
+
type: "float",
|
|
1170
|
+
value: 2.5,
|
|
1171
|
+
min: 0.5,
|
|
1172
|
+
max: 8,
|
|
1173
|
+
step: 0.1,
|
|
1174
|
+
label: "Scale",
|
|
1175
|
+
},
|
|
1176
|
+
u_drift: {
|
|
1177
|
+
type: "float",
|
|
1178
|
+
value: 0.4,
|
|
1179
|
+
min: 0,
|
|
1180
|
+
max: 2,
|
|
1181
|
+
step: 0.01,
|
|
1182
|
+
label: "Drift",
|
|
1183
|
+
},
|
|
1184
|
+
},
|
|
1185
|
+
glsl: `
|
|
1186
|
+
precision highp float;
|
|
1187
|
+
uniform vec2 u_resolution;
|
|
1188
|
+
uniform float u_time;
|
|
1189
|
+
uniform vec3 u_sky_color;
|
|
1190
|
+
uniform vec3 u_cloud_color;
|
|
1191
|
+
uniform float u_cover;
|
|
1192
|
+
uniform float u_scale;
|
|
1193
|
+
uniform float u_drift;
|
|
1194
|
+
|
|
1195
|
+
${GLSL_NOISE_HELPERS}
|
|
1196
|
+
|
|
1197
|
+
void main() {
|
|
1198
|
+
vec2 uv = gl_FragCoord.xy / u_resolution;
|
|
1199
|
+
float aspect = u_resolution.x / max(u_resolution.y, 1.0);
|
|
1200
|
+
vec2 p = vec2(uv.x * aspect, uv.y) * u_scale;
|
|
1201
|
+
p.x += u_time * u_drift * 0.2;
|
|
1202
|
+
float n = anFbm(p + anFbm(p * 1.4 + vec2(u_time * u_drift * 0.05)) * 1.2);
|
|
1203
|
+
float threshold = 1.0 - u_cover;
|
|
1204
|
+
float clouds = smoothstep(threshold - 0.25, threshold + 0.25, n);
|
|
1205
|
+
vec3 color = mix(u_sky_color, u_cloud_color, clouds);
|
|
1206
|
+
gl_FragColor = vec4(color, 1.0);
|
|
1207
|
+
}
|
|
1208
|
+
`.trim(),
|
|
1209
|
+
},
|
|
1210
|
+
{
|
|
1211
|
+
name: "nebula",
|
|
1212
|
+
label: "Nebula",
|
|
1213
|
+
description:
|
|
1214
|
+
"Deep-space gas clouds with twinkling stars and adjustable density.",
|
|
1215
|
+
category: "noise",
|
|
1216
|
+
mode: "fill",
|
|
1217
|
+
previewCss:
|
|
1218
|
+
"radial-gradient(ellipse at 30% 35%, #7b2ff766 0%, transparent 55%), " +
|
|
1219
|
+
"radial-gradient(ellipse at 72% 68%, #f107a344 0%, transparent 50%), #050014",
|
|
1220
|
+
uniforms: {
|
|
1221
|
+
u_color_a: { type: "color", value: "#7b2ff7", label: "Gas 1" },
|
|
1222
|
+
u_color_b: { type: "color", value: "#f107a3", label: "Gas 2" },
|
|
1223
|
+
u_density: {
|
|
1224
|
+
type: "float",
|
|
1225
|
+
value: 0.6,
|
|
1226
|
+
min: 0,
|
|
1227
|
+
max: 1,
|
|
1228
|
+
step: 0.01,
|
|
1229
|
+
label: "Density",
|
|
1230
|
+
},
|
|
1231
|
+
u_stars: {
|
|
1232
|
+
type: "float",
|
|
1233
|
+
value: 0.5,
|
|
1234
|
+
min: 0,
|
|
1235
|
+
max: 1,
|
|
1236
|
+
step: 0.01,
|
|
1237
|
+
label: "Stars",
|
|
1238
|
+
},
|
|
1239
|
+
u_drift: {
|
|
1240
|
+
type: "float",
|
|
1241
|
+
value: 0.08,
|
|
1242
|
+
min: 0,
|
|
1243
|
+
max: 0.5,
|
|
1244
|
+
step: 0.005,
|
|
1245
|
+
label: "Drift",
|
|
1246
|
+
},
|
|
1247
|
+
},
|
|
1248
|
+
glsl: `
|
|
1249
|
+
precision highp float;
|
|
1250
|
+
uniform vec2 u_resolution;
|
|
1251
|
+
uniform float u_time;
|
|
1252
|
+
uniform vec3 u_color_a;
|
|
1253
|
+
uniform vec3 u_color_b;
|
|
1254
|
+
uniform float u_density;
|
|
1255
|
+
uniform float u_stars;
|
|
1256
|
+
uniform float u_drift;
|
|
1257
|
+
|
|
1258
|
+
${GLSL_NOISE_HELPERS}
|
|
1259
|
+
|
|
1260
|
+
void main() {
|
|
1261
|
+
vec2 uv = gl_FragCoord.xy / u_resolution;
|
|
1262
|
+
float aspect = u_resolution.x / max(u_resolution.y, 1.0);
|
|
1263
|
+
vec2 p = vec2(uv.x * aspect, uv.y) * 3.0;
|
|
1264
|
+
vec2 drift = vec2(u_time * u_drift, u_time * u_drift * 0.6);
|
|
1265
|
+
float n1 = anFbm(p + drift);
|
|
1266
|
+
float n2 = anFbm(p * 1.7 - drift + 5.2);
|
|
1267
|
+
vec3 space = vec3(0.02, 0.0, 0.08);
|
|
1268
|
+
vec3 color = space;
|
|
1269
|
+
color += u_color_a * pow(n1, 2.0) * u_density * 1.6;
|
|
1270
|
+
color += u_color_b * pow(n2, 2.4) * u_density * 1.2;
|
|
1271
|
+
float sparkle = anHash21(floor(gl_FragCoord.xy / 2.0));
|
|
1272
|
+
float twinkle = 0.75 + 0.25 * sin(u_time * 3.0 + sparkle * 40.0);
|
|
1273
|
+
float star = step(0.9975, sparkle) * u_stars * twinkle;
|
|
1274
|
+
color += vec3(star);
|
|
1275
|
+
gl_FragColor = vec4(clamp(color, 0.0, 1.0), 1.0);
|
|
1276
|
+
}
|
|
1277
|
+
`.trim(),
|
|
1278
|
+
},
|
|
1279
|
+
{
|
|
1280
|
+
name: "moire",
|
|
1281
|
+
label: "Moiré",
|
|
1282
|
+
description:
|
|
1283
|
+
"Interfering ring fields producing shifting optical moiré patterns.",
|
|
1284
|
+
category: "pattern",
|
|
1285
|
+
mode: "fill",
|
|
1286
|
+
previewCss:
|
|
1287
|
+
"repeating-radial-gradient(circle at 42% 50%, #00f5d4 0 2px, #0f0f0f 2px 7px)",
|
|
1288
|
+
uniforms: {
|
|
1289
|
+
u_color_a: { type: "color", value: "#0f0f0f", label: "Background" },
|
|
1290
|
+
u_color_b: { type: "color", value: "#00f5d4", label: "Lines" },
|
|
1291
|
+
u_frequency: {
|
|
1292
|
+
type: "float",
|
|
1293
|
+
value: 42,
|
|
1294
|
+
min: 5,
|
|
1295
|
+
max: 120,
|
|
1296
|
+
step: 1,
|
|
1297
|
+
label: "Frequency",
|
|
1298
|
+
},
|
|
1299
|
+
u_offset: {
|
|
1300
|
+
type: "vec2",
|
|
1301
|
+
value: [0.12, 0.08],
|
|
1302
|
+
label: "Center offset",
|
|
1303
|
+
},
|
|
1304
|
+
u_speed: {
|
|
1305
|
+
type: "float",
|
|
1306
|
+
value: 0.2,
|
|
1307
|
+
min: 0,
|
|
1308
|
+
max: 2,
|
|
1309
|
+
step: 0.01,
|
|
1310
|
+
label: "Speed",
|
|
1311
|
+
},
|
|
1312
|
+
},
|
|
1313
|
+
glsl: `
|
|
1314
|
+
precision highp float;
|
|
1315
|
+
uniform vec2 u_resolution;
|
|
1316
|
+
uniform float u_time;
|
|
1317
|
+
uniform vec3 u_color_a;
|
|
1318
|
+
uniform vec3 u_color_b;
|
|
1319
|
+
uniform float u_frequency;
|
|
1320
|
+
uniform vec2 u_offset;
|
|
1321
|
+
uniform float u_speed;
|
|
1322
|
+
|
|
1323
|
+
void main() {
|
|
1324
|
+
vec2 uv = gl_FragCoord.xy / u_resolution;
|
|
1325
|
+
float aspect = u_resolution.x / max(u_resolution.y, 1.0);
|
|
1326
|
+
vec2 p = vec2(uv.x * aspect, uv.y);
|
|
1327
|
+
vec2 center = vec2(0.5 * aspect, 0.5);
|
|
1328
|
+
vec2 wobble = 0.02 * vec2(sin(u_time * u_speed * 3.0), cos(u_time * u_speed * 2.3));
|
|
1329
|
+
vec2 c1 = center + u_offset * 0.5 + wobble;
|
|
1330
|
+
vec2 c2 = center - u_offset * 0.5 - wobble;
|
|
1331
|
+
float r1 = sin(distance(p, c1) * u_frequency);
|
|
1332
|
+
float r2 = sin(distance(p, c2) * u_frequency);
|
|
1333
|
+
float v = r1 * r2 * 0.5 + 0.5;
|
|
1334
|
+
v = smoothstep(0.35, 0.65, v);
|
|
1335
|
+
gl_FragColor = vec4(mix(u_color_a, u_color_b, v), 1.0);
|
|
1336
|
+
}
|
|
1337
|
+
`.trim(),
|
|
1338
|
+
},
|
|
1339
|
+
{
|
|
1340
|
+
name: "concentric-rings",
|
|
1341
|
+
label: "Concentric Rings",
|
|
1342
|
+
description:
|
|
1343
|
+
"Bold expanding rings with adjustable count, softness, and center.",
|
|
1344
|
+
category: "pattern",
|
|
1345
|
+
mode: "fill",
|
|
1346
|
+
previewCss:
|
|
1347
|
+
"repeating-radial-gradient(circle at 50% 50%, #ffd166 0 6px, #101418 6px 16px)",
|
|
1348
|
+
uniforms: {
|
|
1349
|
+
u_color_a: { type: "color", value: "#101418", label: "Background" },
|
|
1350
|
+
u_color_b: { type: "color", value: "#ffd166", label: "Rings" },
|
|
1351
|
+
u_rings: {
|
|
1352
|
+
type: "float",
|
|
1353
|
+
value: 14,
|
|
1354
|
+
min: 2,
|
|
1355
|
+
max: 40,
|
|
1356
|
+
step: 1,
|
|
1357
|
+
label: "Rings",
|
|
1358
|
+
},
|
|
1359
|
+
u_center: { type: "vec2", value: [0.5, 0.5], label: "Center" },
|
|
1360
|
+
u_softness: {
|
|
1361
|
+
type: "float",
|
|
1362
|
+
value: 0.25,
|
|
1363
|
+
min: 0.01,
|
|
1364
|
+
max: 0.5,
|
|
1365
|
+
step: 0.01,
|
|
1366
|
+
label: "Softness",
|
|
1367
|
+
},
|
|
1368
|
+
u_speed: {
|
|
1369
|
+
type: "float",
|
|
1370
|
+
value: 0.4,
|
|
1371
|
+
min: -2,
|
|
1372
|
+
max: 2,
|
|
1373
|
+
step: 0.05,
|
|
1374
|
+
label: "Speed",
|
|
1375
|
+
},
|
|
1376
|
+
},
|
|
1377
|
+
glsl: `
|
|
1378
|
+
precision highp float;
|
|
1379
|
+
uniform vec2 u_resolution;
|
|
1380
|
+
uniform float u_time;
|
|
1381
|
+
uniform vec3 u_color_a;
|
|
1382
|
+
uniform vec3 u_color_b;
|
|
1383
|
+
uniform float u_rings;
|
|
1384
|
+
uniform vec2 u_center;
|
|
1385
|
+
uniform float u_softness;
|
|
1386
|
+
uniform float u_speed;
|
|
1387
|
+
|
|
1388
|
+
void main() {
|
|
1389
|
+
vec2 uv = gl_FragCoord.xy / u_resolution;
|
|
1390
|
+
float aspect = u_resolution.x / max(u_resolution.y, 1.0);
|
|
1391
|
+
vec2 p = vec2(uv.x * aspect, uv.y);
|
|
1392
|
+
vec2 c = vec2(u_center.x * aspect, u_center.y);
|
|
1393
|
+
float d = distance(p, c);
|
|
1394
|
+
float v = 0.5 + 0.5 * sin((d * u_rings - u_time * u_speed) * 6.28318);
|
|
1395
|
+
float band = smoothstep(0.5 - u_softness, 0.5 + u_softness, v);
|
|
1396
|
+
gl_FragColor = vec4(mix(u_color_a, u_color_b, band), 1.0);
|
|
1397
|
+
}
|
|
1398
|
+
`.trim(),
|
|
1399
|
+
},
|
|
1400
|
+
{
|
|
1401
|
+
name: "pattern-grid",
|
|
1402
|
+
label: "Pattern Grid",
|
|
1403
|
+
description:
|
|
1404
|
+
"A grid of softly pulsing dots with adjustable cell count and radius.",
|
|
1405
|
+
category: "pattern",
|
|
1406
|
+
mode: "fill",
|
|
1407
|
+
previewCss:
|
|
1408
|
+
"radial-gradient(circle at 8px 8px, #e94560 3px, transparent 3.5px) 0 0 / 16px 16px, #1b1b2f",
|
|
1409
|
+
uniforms: {
|
|
1410
|
+
u_bg_color: { type: "color", value: "#1b1b2f", label: "Background" },
|
|
1411
|
+
u_fg_color: { type: "color", value: "#e94560", label: "Dots" },
|
|
1412
|
+
u_cells: {
|
|
1413
|
+
type: "float",
|
|
1414
|
+
value: 10,
|
|
1415
|
+
min: 2,
|
|
1416
|
+
max: 40,
|
|
1417
|
+
step: 1,
|
|
1418
|
+
label: "Cells",
|
|
1419
|
+
},
|
|
1420
|
+
u_radius: {
|
|
1421
|
+
type: "float",
|
|
1422
|
+
value: 0.28,
|
|
1423
|
+
min: 0.05,
|
|
1424
|
+
max: 0.48,
|
|
1425
|
+
step: 0.01,
|
|
1426
|
+
label: "Dot size",
|
|
1427
|
+
},
|
|
1428
|
+
u_pulse: {
|
|
1429
|
+
type: "float",
|
|
1430
|
+
value: 0.15,
|
|
1431
|
+
min: 0,
|
|
1432
|
+
max: 0.5,
|
|
1433
|
+
step: 0.01,
|
|
1434
|
+
label: "Pulse",
|
|
1435
|
+
},
|
|
1436
|
+
},
|
|
1437
|
+
glsl: `
|
|
1438
|
+
precision highp float;
|
|
1439
|
+
uniform vec2 u_resolution;
|
|
1440
|
+
uniform float u_time;
|
|
1441
|
+
uniform vec3 u_bg_color;
|
|
1442
|
+
uniform vec3 u_fg_color;
|
|
1443
|
+
uniform float u_cells;
|
|
1444
|
+
uniform float u_radius;
|
|
1445
|
+
uniform float u_pulse;
|
|
1446
|
+
|
|
1447
|
+
float anHash21(vec2 p) {
|
|
1448
|
+
p = fract(p * vec2(123.34, 456.21));
|
|
1449
|
+
p += dot(p, p + 45.32);
|
|
1450
|
+
return fract(p.x * p.y);
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
void main() {
|
|
1454
|
+
vec2 uv = gl_FragCoord.xy / u_resolution;
|
|
1455
|
+
float aspect = u_resolution.x / max(u_resolution.y, 1.0);
|
|
1456
|
+
vec2 g = vec2(uv.x * aspect, uv.y) * u_cells;
|
|
1457
|
+
vec2 cell = floor(g);
|
|
1458
|
+
vec2 f = fract(g) - 0.5;
|
|
1459
|
+
float ph = anHash21(cell);
|
|
1460
|
+
float r = u_radius * (1.0 + u_pulse * sin(u_time * 2.0 + ph * 6.28318));
|
|
1461
|
+
float d = length(f);
|
|
1462
|
+
float m = 1.0 - smoothstep(r - 0.03, r + 0.03, d);
|
|
1463
|
+
gl_FragColor = vec4(mix(u_bg_color, u_fg_color, m), 1.0);
|
|
1464
|
+
}
|
|
1465
|
+
`.trim(),
|
|
1466
|
+
},
|
|
1467
|
+
// ── Effects (transparent overlays above the element's content) ───────────
|
|
1468
|
+
{
|
|
1469
|
+
name: "film-grain",
|
|
1470
|
+
label: "Film Grain",
|
|
1471
|
+
description:
|
|
1472
|
+
"Animated photographic grain composited over the layer content.",
|
|
1473
|
+
category: "texture",
|
|
1474
|
+
mode: "effect",
|
|
1475
|
+
previewCss:
|
|
1476
|
+
"repeating-conic-gradient(#0000 0% 25%, #00000018 0% 50%) 0 0 / 4px 4px, #8a8a8a40",
|
|
1477
|
+
uniforms: {
|
|
1478
|
+
u_intensity: {
|
|
1479
|
+
type: "float",
|
|
1480
|
+
value: 0.12,
|
|
1481
|
+
min: 0,
|
|
1482
|
+
max: 0.5,
|
|
1483
|
+
step: 0.01,
|
|
1484
|
+
label: "Intensity",
|
|
1485
|
+
},
|
|
1486
|
+
u_size: {
|
|
1487
|
+
type: "float",
|
|
1488
|
+
value: 1.5,
|
|
1489
|
+
min: 0.5,
|
|
1490
|
+
max: 4,
|
|
1491
|
+
step: 0.1,
|
|
1492
|
+
label: "Grain size",
|
|
1493
|
+
},
|
|
1494
|
+
},
|
|
1495
|
+
glsl: `
|
|
1496
|
+
precision highp float;
|
|
1497
|
+
uniform vec2 u_resolution;
|
|
1498
|
+
uniform float u_time;
|
|
1499
|
+
uniform float u_intensity;
|
|
1500
|
+
uniform float u_size;
|
|
1501
|
+
|
|
1502
|
+
float anHash21(vec2 p) {
|
|
1503
|
+
p = fract(p * vec2(123.34, 456.21));
|
|
1504
|
+
p += dot(p, p + 45.32);
|
|
1505
|
+
return fract(p.x * p.y);
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
void main() {
|
|
1509
|
+
vec2 cell = floor(gl_FragCoord.xy / max(u_size, 0.5));
|
|
1510
|
+
float frame = floor(u_time * 24.0);
|
|
1511
|
+
float n = anHash21(cell + vec2(frame * 0.013, frame * 0.007));
|
|
1512
|
+
float signed = n * 2.0 - 1.0;
|
|
1513
|
+
vec3 color = signed > 0.0 ? vec3(1.0) : vec3(0.0);
|
|
1514
|
+
gl_FragColor = vec4(color, abs(signed) * u_intensity);
|
|
1515
|
+
}
|
|
1516
|
+
`.trim(),
|
|
1517
|
+
},
|
|
1518
|
+
{
|
|
1519
|
+
name: "halftone",
|
|
1520
|
+
label: "Halftone",
|
|
1521
|
+
description:
|
|
1522
|
+
"Vintage print dot screen overlay with adjustable size and angle.",
|
|
1523
|
+
category: "retro",
|
|
1524
|
+
mode: "effect",
|
|
1525
|
+
previewCss:
|
|
1526
|
+
"radial-gradient(circle at 5px 5px, #14213d 2.5px, transparent 3px) 0 0 / 10px 10px",
|
|
1527
|
+
uniforms: {
|
|
1528
|
+
u_color: { type: "color", value: "#14213d", label: "Dot color" },
|
|
1529
|
+
u_size: {
|
|
1530
|
+
type: "float",
|
|
1531
|
+
value: 8,
|
|
1532
|
+
min: 3,
|
|
1533
|
+
max: 30,
|
|
1534
|
+
step: 0.5,
|
|
1535
|
+
label: "Dot size",
|
|
1536
|
+
},
|
|
1537
|
+
u_angle: {
|
|
1538
|
+
type: "float",
|
|
1539
|
+
value: 0.6,
|
|
1540
|
+
min: 0,
|
|
1541
|
+
max: 3.14,
|
|
1542
|
+
step: 0.01,
|
|
1543
|
+
label: "Angle",
|
|
1544
|
+
},
|
|
1545
|
+
u_strength: {
|
|
1546
|
+
type: "float",
|
|
1547
|
+
value: 0.5,
|
|
1548
|
+
min: 0,
|
|
1549
|
+
max: 1,
|
|
1550
|
+
step: 0.01,
|
|
1551
|
+
label: "Strength",
|
|
1552
|
+
},
|
|
1553
|
+
},
|
|
1554
|
+
glsl: `
|
|
1555
|
+
precision highp float;
|
|
1556
|
+
uniform vec2 u_resolution;
|
|
1557
|
+
uniform float u_time;
|
|
1558
|
+
uniform vec3 u_color;
|
|
1559
|
+
uniform float u_size;
|
|
1560
|
+
uniform float u_angle;
|
|
1561
|
+
uniform float u_strength;
|
|
1562
|
+
|
|
1563
|
+
void main() {
|
|
1564
|
+
vec2 p = gl_FragCoord.xy;
|
|
1565
|
+
float s = sin(u_angle);
|
|
1566
|
+
float c = cos(u_angle);
|
|
1567
|
+
vec2 rp = vec2(c * p.x - s * p.y, s * p.x + c * p.y);
|
|
1568
|
+
vec2 f = fract(rp / max(u_size, 1.0)) - 0.5;
|
|
1569
|
+
float ramp = clamp(gl_FragCoord.y / max(u_resolution.y, 1.0), 0.0, 1.0);
|
|
1570
|
+
float r = mix(0.08, 0.62, 1.0 - ramp);
|
|
1571
|
+
float m = 1.0 - smoothstep(r - 0.08, r + 0.08, length(f) * 2.0);
|
|
1572
|
+
gl_FragColor = vec4(u_color, m * u_strength);
|
|
1573
|
+
}
|
|
1574
|
+
`.trim(),
|
|
1575
|
+
},
|
|
1576
|
+
{
|
|
1577
|
+
name: "scanlines",
|
|
1578
|
+
label: "Scanlines",
|
|
1579
|
+
description:
|
|
1580
|
+
"CRT-style scanlines with subtle flicker, composited over content.",
|
|
1581
|
+
category: "retro",
|
|
1582
|
+
mode: "effect",
|
|
1583
|
+
previewCss:
|
|
1584
|
+
"repeating-linear-gradient(180deg, #00000030 0 1px, transparent 1px 4px)",
|
|
1585
|
+
uniforms: {
|
|
1586
|
+
u_color: { type: "color", value: "#000000", label: "Line color" },
|
|
1587
|
+
u_density: {
|
|
1588
|
+
type: "float",
|
|
1589
|
+
value: 220,
|
|
1590
|
+
min: 40,
|
|
1591
|
+
max: 600,
|
|
1592
|
+
step: 5,
|
|
1593
|
+
label: "Density",
|
|
1594
|
+
},
|
|
1595
|
+
u_opacity: {
|
|
1596
|
+
type: "float",
|
|
1597
|
+
value: 0.18,
|
|
1598
|
+
min: 0,
|
|
1599
|
+
max: 0.6,
|
|
1600
|
+
step: 0.01,
|
|
1601
|
+
label: "Opacity",
|
|
1602
|
+
},
|
|
1603
|
+
u_flicker: {
|
|
1604
|
+
type: "float",
|
|
1605
|
+
value: 0.06,
|
|
1606
|
+
min: 0,
|
|
1607
|
+
max: 0.3,
|
|
1608
|
+
step: 0.01,
|
|
1609
|
+
label: "Flicker",
|
|
1610
|
+
},
|
|
1611
|
+
},
|
|
1612
|
+
glsl: `
|
|
1613
|
+
precision highp float;
|
|
1614
|
+
uniform vec2 u_resolution;
|
|
1615
|
+
uniform float u_time;
|
|
1616
|
+
uniform vec3 u_color;
|
|
1617
|
+
uniform float u_density;
|
|
1618
|
+
uniform float u_opacity;
|
|
1619
|
+
uniform float u_flicker;
|
|
1620
|
+
|
|
1621
|
+
void main() {
|
|
1622
|
+
float y = gl_FragCoord.y / max(u_resolution.y, 1.0);
|
|
1623
|
+
float line = 0.5 + 0.5 * sin(y * u_density * 6.28318);
|
|
1624
|
+
float flicker = 1.0 + u_flicker * sin(u_time * 11.0);
|
|
1625
|
+
float a = (1.0 - smoothstep(0.35, 0.75, line)) * u_opacity * flicker;
|
|
1626
|
+
gl_FragColor = vec4(u_color, clamp(a, 0.0, 1.0));
|
|
1627
|
+
}
|
|
1628
|
+
`.trim(),
|
|
1629
|
+
},
|
|
1630
|
+
] as const;
|
|
1631
|
+
|
|
1632
|
+
export const GLSL_SHADER_PRESET_MAP: Record<string, GlslShaderPreset> =
|
|
1633
|
+
Object.fromEntries(GLSL_SHADER_PRESETS.map((p) => [p.name, p]));
|
|
1634
|
+
|
|
1635
|
+
/** Return a GLSL preset by name, or undefined if not found. */
|
|
1636
|
+
export function getGlslShaderPreset(
|
|
1637
|
+
name: string,
|
|
1638
|
+
): GlslShaderPreset | undefined {
|
|
1639
|
+
return GLSL_SHADER_PRESET_MAP[name];
|
|
1640
|
+
}
|