@designbasekorea/ui-wc 0.5.6 → 0.6.1
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/dist/chunks/lottie-35a9b0f5.js +1 -0
- package/dist/esm/components/animation-background/canvas-controller.js +1 -121
- package/dist/esm/components/animation-background/controls.js +1 -180
- package/dist/esm/components/animation-background/graphite-controller.js +1 -196
- package/dist/esm/components/animation-background/graphite-presets.js +1 -42
- package/dist/esm/components/animation-background/graphite-shader.js +1 -111
- package/dist/esm/components/animation-background/layers.js +1 -369
- package/dist/esm/components/animation-background/lumina-presets.js +1 -53
- package/dist/esm/components/animation-background/lumina-shaders.js +1 -181
- package/dist/esm/components/animation-background/lumina-utils.js +1 -60
- package/dist/esm/components/animation-background/particle-defaults.js +1 -36
- package/dist/esm/components/animation-background/renderers.js +1 -167
- package/dist/esm/components/animation-background/shader-controller.js +1 -154
- package/dist/esm/components/color-picker-utils.js +1 -134
- package/dist/esm/components/date-picker-utils.js +1 -140
- package/dist/esm/components/db-accordion.js +1 -304
- package/dist/esm/components/db-ad-banner.js +1 -455
- package/dist/esm/components/db-ai-chat-list.d.ts +43 -0
- package/dist/esm/components/db-ai-chat-list.js +1 -0
- package/dist/esm/components/db-ai-chat.d.ts +159 -0
- package/dist/esm/components/db-ai-chat.js +1 -0
- package/dist/esm/components/db-alert.js +1 -149
- package/dist/esm/components/db-animation-background.js +1 -486
- package/dist/esm/components/db-animation-text.js +1 -601
- package/dist/esm/components/db-app-badge.js +1 -88
- package/dist/esm/components/db-audio-player.js +1 -752
- package/dist/esm/components/db-avatar.js +1 -188
- package/dist/esm/components/db-backdrop.js +1 -139
- package/dist/esm/components/db-badge.js +1 -91
- package/dist/esm/components/db-banner.js +1 -188
- package/dist/esm/components/db-bottom-navigation.js +1 -146
- package/dist/esm/components/db-bottom-sheet.js +1 -481
- package/dist/esm/components/db-breadcrumbs.js +1 -329
- package/dist/esm/components/db-button.js +1 -316
- package/dist/esm/components/db-calendar.js +1 -675
- package/dist/esm/components/db-card.js +1 -265
- package/dist/esm/components/db-carousel.js +1 -264
- package/dist/esm/components/db-chat-composer.d.ts +134 -0
- package/dist/esm/components/db-chat-composer.js +1 -0
- package/dist/esm/components/db-chat-list.d.ts +47 -0
- package/dist/esm/components/db-chat-list.js +1 -0
- package/dist/esm/components/db-chat-message.d.ts +39 -0
- package/dist/esm/components/db-chat-message.js +1 -0
- package/dist/esm/components/db-chat-orb.d.ts +99 -0
- package/dist/esm/components/db-chat-orb.js +1 -0
- package/dist/esm/components/db-chat-room.d.ts +71 -0
- package/dist/esm/components/db-chat-room.js +1 -0
- package/dist/esm/components/db-chat-suggestions.d.ts +44 -0
- package/dist/esm/components/db-chat-suggestions.js +1 -0
- package/dist/esm/components/db-chat-typing.d.ts +22 -0
- package/dist/esm/components/db-chat-typing.js +1 -0
- package/dist/esm/components/db-chat-welcome.d.ts +32 -0
- package/dist/esm/components/db-chat-welcome.js +1 -0
- package/dist/esm/components/db-chat-widget.d.ts +146 -0
- package/dist/esm/components/db-chat-widget.js +1 -0
- package/dist/esm/components/db-checkbox.js +1 -202
- package/dist/esm/components/db-chip.js +1 -104
- package/dist/esm/components/db-code-block.js +1 -304
- package/dist/esm/components/db-color-picker.js +1 -746
- package/dist/esm/components/db-confirm.js +1 -191
- package/dist/esm/components/db-container.js +1 -39
- package/dist/esm/components/db-context-menu.js +1 -265
- package/dist/esm/components/db-countdown.js +1 -146
- package/dist/esm/components/db-cursor-follower.js +1 -173
- package/dist/esm/components/db-date-picker.js +1 -837
- package/dist/esm/components/db-divider.js +1 -66
- package/dist/esm/components/db-download-progress.d.ts +89 -0
- package/dist/esm/components/db-download-progress.js +1 -0
- package/dist/esm/components/db-drawer.js +1 -245
- package/dist/esm/components/db-dropdown.js +1 -493
- package/dist/esm/components/db-dropzone.js +1 -266
- package/dist/esm/components/db-email-verify.d.ts +64 -0
- package/dist/esm/components/db-email-verify.js +1 -0
- package/dist/esm/components/db-empty-state.js +1 -97
- package/dist/esm/components/db-file-uploader.js +1 -256
- package/dist/esm/components/db-floating-action-button.js +1 -139
- package/dist/esm/components/db-footer.js +1 -385
- package/dist/esm/components/db-form.js +1 -566
- package/dist/esm/components/db-gantt.js +1 -882
- package/dist/esm/components/db-gradient.js +1 -133
- package/dist/esm/components/db-grid-background.js +1 -909
- package/dist/esm/components/db-grid.js +1 -73
- package/dist/esm/components/db-icons.d.ts +3 -0
- package/dist/esm/components/db-icons.js +1 -82
- package/dist/esm/components/db-image-list.js +1 -214
- package/dist/esm/components/db-image-placeholder.js +1 -96
- package/dist/esm/components/db-image.js +1 -289
- package/dist/esm/components/db-indicator.js +1 -517
- package/dist/esm/components/db-input.js +1 -420
- package/dist/esm/components/db-kanban.js +1 -538
- package/dist/esm/components/db-label.js +1 -66
- package/dist/esm/components/db-lightbox.js +1 -372
- package/dist/esm/components/db-list.js +1 -340
- package/dist/esm/components/db-logo-svg.js +1 -72
- package/dist/esm/components/db-logo.js +1 -106
- package/dist/esm/components/db-lottie.js +1 -109
- package/dist/esm/components/db-markdown-editor.js +1 -458
- package/dist/esm/components/db-marquee.js +1 -402
- package/dist/esm/components/db-masonry.js +1 -94
- package/dist/esm/components/db-menu-item.js +1 -211
- package/dist/esm/components/db-modal.js +1 -522
- package/dist/esm/components/db-navbar.js +1 -680
- package/dist/esm/components/db-onboarding-modal.js +1 -322
- package/dist/esm/components/db-otp-input.d.ts +53 -0
- package/dist/esm/components/db-otp-input.js +1 -0
- package/dist/esm/components/db-page-header.js +1 -312
- package/dist/esm/components/db-pagination.js +1 -271
- package/dist/esm/components/db-phone-verify.d.ts +63 -0
- package/dist/esm/components/db-phone-verify.js +1 -0
- package/dist/esm/components/db-popover.js +1 -580
- package/dist/esm/components/db-progress-step.js +1 -166
- package/dist/esm/components/db-progress.js +1 -171
- package/dist/esm/components/db-progressbar.js +1 -72
- package/dist/esm/components/db-radio.js +1 -172
- package/dist/esm/components/db-random-gradient.js +1 -121
- package/dist/esm/components/db-range-slider.js +1 -811
- package/dist/esm/components/db-rating.js +1 -325
- package/dist/esm/components/db-reorder.js +1 -286
- package/dist/esm/components/db-resizable-panels.js +1 -282
- package/dist/esm/components/db-scroll-area.js +1 -126
- package/dist/esm/components/db-search-bar.js +1 -668
- package/dist/esm/components/db-section-app-download.js +1 -101
- package/dist/esm/components/db-section-contact.js +1 -102
- package/dist/esm/components/db-section-cta.js +1 -150
- package/dist/esm/components/db-section-faq.js +1 -120
- package/dist/esm/components/db-section-feature-grid.js +1 -137
- package/dist/esm/components/db-section-feature.js +1 -179
- package/dist/esm/components/db-section-hero.js +1 -243
- package/dist/esm/components/db-section-logo-cloud.js +1 -138
- package/dist/esm/components/db-section-pricing.js +1 -166
- package/dist/esm/components/db-section-stats.js +1 -129
- package/dist/esm/components/db-section-testimonials.js +1 -252
- package/dist/esm/components/db-section.js +1 -385
- package/dist/esm/components/db-segment-control.js +1 -231
- package/dist/esm/components/db-select.js +1 -571
- package/dist/esm/components/db-share-icons.js +1 -40
- package/dist/esm/components/db-share.js +1 -489
- package/dist/esm/components/db-sidebar.d.ts +20 -0
- package/dist/esm/components/db-sidebar.js +1 -1068
- package/dist/esm/components/db-skeleton.js +1 -94
- package/dist/esm/components/db-spinner.js +1 -102
- package/dist/esm/components/db-split-view.js +1 -297
- package/dist/esm/components/db-stack.js +1 -46
- package/dist/esm/components/db-stat.js +1 -218
- package/dist/esm/components/db-stepper.js +1 -398
- package/dist/esm/components/db-table.js +1 -412
- package/dist/esm/components/db-tabs.js +1 -335
- package/dist/esm/components/db-testimonial.d.ts +2 -0
- package/dist/esm/components/db-testimonial.js +1 -162
- package/dist/esm/components/db-textarea.js +1 -233
- package/dist/esm/components/db-time-picker.js +1 -523
- package/dist/esm/components/db-timeline.js +1 -174
- package/dist/esm/components/db-toast.js +1 -158
- package/dist/esm/components/db-toggle.js +1 -162
- package/dist/esm/components/db-toolbar.js +1 -94
- package/dist/esm/components/db-tooltip.js +1 -440
- package/dist/esm/components/db-top-banner.js +1 -121
- package/dist/esm/components/db-tutorial.js +1 -324
- package/dist/esm/components/db-two-factor.d.ts +71 -0
- package/dist/esm/components/db-two-factor.js +1 -0
- package/dist/esm/components/db-video-player.js +1 -503
- package/dist/esm/components/db-youtube-player.js +1 -194
- package/dist/esm/components/highlight-code.js +1 -65
- package/dist/esm/components/input-validation.js +1 -50
- package/dist/esm/components/marketing-block-host-utils.js +1 -9
- package/dist/esm/components/number-scrub.js +1 -117
- package/dist/esm/components/random-gradient-palettes.js +1 -67
- package/dist/esm/components/section-block-header-utils.js +1 -48
- package/dist/esm/helpers/confirm.js +1 -52
- package/dist/esm/helpers/toast.js +1 -73
- package/dist/esm/index.d.ts +16 -0
- package/dist/esm/index.js +1 -111
- package/dist/esm/node_modules/prismjs/components/prism-bash.js +1 -235
- package/dist/esm/node_modules/prismjs/components/prism-clike.js +1 -31
- package/dist/esm/node_modules/prismjs/components/prism-css.js +1 -64
- package/dist/esm/node_modules/prismjs/components/prism-javascript.js +1 -172
- package/dist/esm/node_modules/prismjs/components/prism-json.js +1 -27
- package/dist/esm/node_modules/prismjs/components/prism-jsx.js +1 -143
- package/dist/esm/node_modules/prismjs/components/prism-markup.js +1 -186
- package/dist/esm/node_modules/prismjs/components/prism-scss.js +1 -81
- package/dist/esm/node_modules/prismjs/components/prism-tsx.js +1 -15
- package/dist/esm/node_modules/prismjs/components/prism-typescript.js +1 -60
- package/dist/index.cjs +1 -55414
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1125 -2
- package/dist/index.esm.js +1 -38284
- package/dist/react/chunks/lottie-14e7addb.js +1 -0
- package/dist/react/index.cjs +1 -56503
- package/dist/react/index.d.ts +1637 -21
- package/dist/react/index.esm.js +1 -39373
- package/package.json +2 -2
- package/dist/chunks/lottie-e273b936.js +0 -17032
- package/dist/react/chunks/lottie-72a4c6d4.js +0 -17032
|
@@ -1,111 +1 @@
|
|
|
1
|
-
const
|
|
2
|
-
attribute vec4 aVertexPosition;
|
|
3
|
-
void main() {
|
|
4
|
-
gl_Position = aVertexPosition;
|
|
5
|
-
}
|
|
6
|
-
`;
|
|
7
|
-
const GRAPHITE_FS_SOURCE = `
|
|
8
|
-
precision highp float;
|
|
9
|
-
uniform vec2 uResolution;
|
|
10
|
-
uniform float uTime;
|
|
11
|
-
uniform float uSpeed;
|
|
12
|
-
uniform float uIntensity;
|
|
13
|
-
uniform float uGrain;
|
|
14
|
-
uniform float uScale;
|
|
15
|
-
uniform float uWarp;
|
|
16
|
-
uniform vec3 uColor1;
|
|
17
|
-
uniform vec3 uColor2;
|
|
18
|
-
uniform vec3 uColor3;
|
|
19
|
-
|
|
20
|
-
vec4 permute(vec4 x){return mod(((x*34.0)+1.0)*x, 289.0);}
|
|
21
|
-
vec4 taylorInvSqrt(vec4 r){return 1.79284291400159 - 0.85373472095314 * r;}
|
|
22
|
-
vec3 fade(vec3 t) {return t*t*t*(t*(t*6.0-15.0)+10.0);}
|
|
23
|
-
|
|
24
|
-
float cnoise(vec3 P){
|
|
25
|
-
vec3 Pi0 = floor(P);
|
|
26
|
-
vec3 Pi1 = Pi0 + vec3(1.0);
|
|
27
|
-
Pi0 = mod(Pi0, 289.0);
|
|
28
|
-
Pi1 = mod(Pi1, 289.0);
|
|
29
|
-
vec3 Pf0 = fract(P);
|
|
30
|
-
vec3 Pf1 = Pf0 - vec3(1.0);
|
|
31
|
-
vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);
|
|
32
|
-
vec4 iy = vec4(Pi0.yy, Pi1.yy);
|
|
33
|
-
vec4 iz0 = Pi0.zzzz;
|
|
34
|
-
vec4 iz1 = Pi1.zzzz;
|
|
35
|
-
|
|
36
|
-
vec4 ixy = permute(permute(ix) + iy);
|
|
37
|
-
vec4 ixy0 = permute(ixy + iz0);
|
|
38
|
-
vec4 ixy1 = permute(ixy + iz1);
|
|
39
|
-
|
|
40
|
-
vec4 gx0 = ixy0 / 7.0;
|
|
41
|
-
vec4 gy0 = fract(floor(gx0) / 7.0) - 0.5;
|
|
42
|
-
gx0 = fract(gx0);
|
|
43
|
-
vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);
|
|
44
|
-
vec4 sz0 = step(gz0, vec4(0.0));
|
|
45
|
-
gx0 -= sz0 * (step(0.0, gx0) - 0.5);
|
|
46
|
-
gy0 -= sz0 * (step(0.0, gy0) - 0.5);
|
|
47
|
-
|
|
48
|
-
vec4 gx1 = ixy1 / 7.0;
|
|
49
|
-
vec4 gy1 = fract(floor(gx1) / 7.0) - 0.5;
|
|
50
|
-
gx1 = fract(gx1);
|
|
51
|
-
vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);
|
|
52
|
-
vec4 sz1 = step(gz1, vec4(0.0));
|
|
53
|
-
gx1 -= sz1 * (step(0.0, gx1) - 0.5);
|
|
54
|
-
gy1 -= sz1 * (step(0.0, gy1) - 0.5);
|
|
55
|
-
|
|
56
|
-
vec3 g000 = vec3(gx0.x,gy0.x,gz0.x);
|
|
57
|
-
vec3 g100 = vec3(gx0.y,gy0.y,gz0.y);
|
|
58
|
-
vec3 g010 = vec3(gx0.z,gy0.z,gz0.z);
|
|
59
|
-
vec3 g110 = vec3(gx0.w,gy0.w,gz0.w);
|
|
60
|
-
vec3 g001 = vec3(gx1.x,gy1.x,gz1.x);
|
|
61
|
-
vec3 g101 = vec3(gx1.y,gy1.y,gz1.y);
|
|
62
|
-
vec3 g011 = vec3(gx1.z,gy1.z,gz1.z);
|
|
63
|
-
vec3 g111 = vec3(gx1.w,gy1.w,gz1.w);
|
|
64
|
-
|
|
65
|
-
vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));
|
|
66
|
-
g000 *= norm0.x;
|
|
67
|
-
g010 *= norm0.y;
|
|
68
|
-
g100 *= norm0.z;
|
|
69
|
-
g110 *= norm0.w;
|
|
70
|
-
vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));
|
|
71
|
-
g001 *= norm1.x;
|
|
72
|
-
g011 *= norm1.y;
|
|
73
|
-
g101 *= norm1.z;
|
|
74
|
-
g111 *= norm1.w;
|
|
75
|
-
|
|
76
|
-
float n000 = dot(g000, Pf0);
|
|
77
|
-
float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));
|
|
78
|
-
float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));
|
|
79
|
-
float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));
|
|
80
|
-
float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));
|
|
81
|
-
float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));
|
|
82
|
-
float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));
|
|
83
|
-
float n111 = dot(g111, Pf1);
|
|
84
|
-
|
|
85
|
-
vec3 fade_xyz = fade(Pf0);
|
|
86
|
-
vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);
|
|
87
|
-
vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);
|
|
88
|
-
float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);
|
|
89
|
-
return 2.2 * n_xyz;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
void main() {
|
|
93
|
-
vec2 p = gl_FragCoord.xy / uResolution.xy;
|
|
94
|
-
float base = p.x * 0.5 + p.y * 0.5;
|
|
95
|
-
|
|
96
|
-
float n = cnoise(vec3(p * uScale, uTime * uSpeed)) * 0.5 + 0.5;
|
|
97
|
-
float n2 = cnoise(vec3(p * (uScale * 1.5) - (n * uWarp), uTime * (uSpeed * 1.2))) * 0.5 + 0.5;
|
|
98
|
-
|
|
99
|
-
float mask = (base * 0.2 + n * 0.5 + n2 * 0.3) * uIntensity;
|
|
100
|
-
|
|
101
|
-
vec3 color = mix(uColor1, uColor2, smoothstep(0.1, 0.6, mask));
|
|
102
|
-
color = mix(color, uColor3, smoothstep(0.5, 0.9, mask));
|
|
103
|
-
|
|
104
|
-
float grain = fract(sin(dot(p + fract(uTime), vec2(12.9898, 78.233))) * 43758.5453);
|
|
105
|
-
color += (grain - 0.5) * uGrain;
|
|
106
|
-
|
|
107
|
-
gl_FragColor = vec4(color, 1.0);
|
|
108
|
-
}
|
|
109
|
-
`;
|
|
110
|
-
|
|
111
|
-
export { GRAPHITE_FS_SOURCE, GRAPHITE_VS_SOURCE };
|
|
1
|
+
const n="\n attribute vec4 aVertexPosition;\n void main() {\n gl_Position = aVertexPosition;\n }\n",e="\n precision highp float;\n uniform vec2 uResolution;\n uniform float uTime;\n uniform float uSpeed;\n uniform float uIntensity;\n uniform float uGrain;\n uniform float uScale;\n uniform float uWarp;\n uniform vec3 uColor1;\n uniform vec3 uColor2;\n uniform vec3 uColor3;\n\n vec4 permute(vec4 x){return mod(((x*34.0)+1.0)*x, 289.0);}\n vec4 taylorInvSqrt(vec4 r){return 1.79284291400159 - 0.85373472095314 * r;}\n vec3 fade(vec3 t) {return t*t*t*(t*(t*6.0-15.0)+10.0);}\n\n float cnoise(vec3 P){\n vec3 Pi0 = floor(P);\n vec3 Pi1 = Pi0 + vec3(1.0);\n Pi0 = mod(Pi0, 289.0);\n Pi1 = mod(Pi1, 289.0);\n vec3 Pf0 = fract(P);\n vec3 Pf1 = Pf0 - vec3(1.0);\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n\n vec4 gx0 = ixy0 / 7.0;\n vec4 gy0 = fract(floor(gx0) / 7.0) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n\n vec4 gx1 = ixy1 / 7.0;\n vec4 gy1 = fract(floor(gx1) / 7.0) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n\n vec3 g000 = vec3(gx0.x,gy0.x,gz0.x);\n vec3 g100 = vec3(gx0.y,gy0.y,gz0.y);\n vec3 g010 = vec3(gx0.z,gy0.z,gz0.z);\n vec3 g110 = vec3(gx0.w,gy0.w,gz0.w);\n vec3 g001 = vec3(gx1.x,gy1.x,gz1.x);\n vec3 g101 = vec3(gx1.y,gy1.y,gz1.y);\n vec3 g011 = vec3(gx1.z,gy1.z,gz1.z);\n vec3 g111 = vec3(gx1.w,gy1.w,gz1.w);\n\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n }\n\n void main() {\n vec2 p = gl_FragCoord.xy / uResolution.xy;\n float base = p.x * 0.5 + p.y * 0.5;\n\n float n = cnoise(vec3(p * uScale, uTime * uSpeed)) * 0.5 + 0.5;\n float n2 = cnoise(vec3(p * (uScale * 1.5) - (n * uWarp), uTime * (uSpeed * 1.2))) * 0.5 + 0.5;\n\n float mask = (base * 0.2 + n * 0.5 + n2 * 0.3) * uIntensity;\n\n vec3 color = mix(uColor1, uColor2, smoothstep(0.1, 0.6, mask));\n color = mix(color, uColor3, smoothstep(0.5, 0.9, mask));\n\n float grain = fract(sin(dot(p + fract(uTime), vec2(12.9898, 78.233))) * 43758.5453);\n color += (grain - 0.5) * uGrain;\n\n gl_FragColor = vec4(color, 1.0);\n }\n";export{e as GRAPHITE_FS_SOURCE,n as GRAPHITE_VS_SOURCE};
|
|
@@ -1,369 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { getLuminaPresetColors } from './lumina-presets.js';
|
|
3
|
-
import { getGraphitePreset, GRAPHITE_DEFAULT_COLORS, isGraphitePresetId } from './graphite-presets.js';
|
|
4
|
-
import { getFallingParticleDefaults } from './particle-defaults.js';
|
|
5
|
-
import { CanvasAnimationController } from './canvas-controller.js';
|
|
6
|
-
import { ShaderAnimationController } from './shader-controller.js';
|
|
7
|
-
import { GraphiteShaderController } from './graphite-controller.js';
|
|
8
|
-
|
|
9
|
-
const CLASS = 'designbase-wc-animation-background';
|
|
10
|
-
const DEFAULT_ANIMATION_TYPE = 'graphite';
|
|
11
|
-
const ANIMATION_TYPES = new Set([
|
|
12
|
-
'particles',
|
|
13
|
-
'stars',
|
|
14
|
-
'snow',
|
|
15
|
-
'flowers',
|
|
16
|
-
'confetti',
|
|
17
|
-
'aurora',
|
|
18
|
-
'plasma',
|
|
19
|
-
'mesh-flow',
|
|
20
|
-
'fluid',
|
|
21
|
-
'radiant',
|
|
22
|
-
'ethereal',
|
|
23
|
-
'graphite',
|
|
24
|
-
]);
|
|
25
|
-
function normalizeAnimationType(raw) {
|
|
26
|
-
if (!raw || raw === 'gradient')
|
|
27
|
-
return DEFAULT_ANIMATION_TYPE;
|
|
28
|
-
return ANIMATION_TYPES.has(raw)
|
|
29
|
-
? raw
|
|
30
|
-
: DEFAULT_ANIMATION_TYPE;
|
|
31
|
-
}
|
|
32
|
-
function parseColors(raw, fallback) {
|
|
33
|
-
if (!raw)
|
|
34
|
-
return fallback;
|
|
35
|
-
try {
|
|
36
|
-
const parsed = JSON.parse(raw);
|
|
37
|
-
return Array.isArray(parsed) && parsed.length ? parsed : fallback;
|
|
38
|
-
}
|
|
39
|
-
catch {
|
|
40
|
-
return raw.split(',').map((c) => c.trim()).filter(Boolean);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
function parseAnimationBackgroundConfig(el) {
|
|
44
|
-
const type = normalizeAnimationType(el.getAttribute('type'));
|
|
45
|
-
const theme = el.getAttribute('theme') === 'light' ? 'light' : 'dark';
|
|
46
|
-
const intensity = (el.getAttribute('intensity') || 'subtle');
|
|
47
|
-
const defaultColors = ['#667eea', '#764ba2', '#f093fb'];
|
|
48
|
-
const presetAttr = el.getAttribute('preset') || undefined;
|
|
49
|
-
const zoomAttr = el.getAttribute('zoom');
|
|
50
|
-
const isGraphite = type === 'graphite';
|
|
51
|
-
let zoom = Number(zoomAttr || 1);
|
|
52
|
-
if (isGraphite && zoomAttr === null) {
|
|
53
|
-
const presetId = isGraphitePresetId(presetAttr) ? presetAttr : 'graphite';
|
|
54
|
-
zoom = getGraphitePreset(presetId).scale;
|
|
55
|
-
}
|
|
56
|
-
return {
|
|
57
|
-
type,
|
|
58
|
-
theme,
|
|
59
|
-
intensity,
|
|
60
|
-
blur: Number(el.getAttribute('blur') || 80),
|
|
61
|
-
speed: Number(el.getAttribute('speed') || 3000),
|
|
62
|
-
direction: (el.getAttribute('direction') || 'left'),
|
|
63
|
-
colors: parseColors(el.getAttribute('colors'), isGraphite ? [...GRAPHITE_DEFAULT_COLORS] : defaultColors),
|
|
64
|
-
opacity: Number(el.getAttribute('opacity') || 1),
|
|
65
|
-
particleCount: Number(el.getAttribute('particle-count') || (type === 'particles' ? 15 : 50)),
|
|
66
|
-
particleSize: Number(el.getAttribute('particle-size') || 2),
|
|
67
|
-
starCount: Number(el.getAttribute('star-count') || 100),
|
|
68
|
-
starSize: Number(el.getAttribute('star-size') || 1.5),
|
|
69
|
-
clickable: el.hasAttribute('clickable') && el.getAttribute('clickable') !== 'false',
|
|
70
|
-
wind: Number(el.getAttribute('wind') || 0.5),
|
|
71
|
-
noise: Number(el.getAttribute('noise') ?? (isGraphite ? 0.1 : 0.05)),
|
|
72
|
-
showVignette: !el.hasAttribute('show-vignette') || el.getAttribute('show-vignette') !== 'false',
|
|
73
|
-
preset: (presetAttr || (isGraphite ? 'graphite' : undefined)),
|
|
74
|
-
zoom,
|
|
75
|
-
shaderSpeed: Number(el.getAttribute('shader-speed') || 0.4),
|
|
76
|
-
shaderIntensity: Number(el.getAttribute('shader-intensity') || 1.2),
|
|
77
|
-
warp: Number(el.getAttribute('warp') || 1.4),
|
|
78
|
-
disabled: el.hasAttribute('disabled') && el.getAttribute('disabled') !== 'false',
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
function resolveColors(config) {
|
|
82
|
-
const { type, preset, colors } = config;
|
|
83
|
-
if (type === 'graphite') {
|
|
84
|
-
if (preset && isGraphitePresetId(preset))
|
|
85
|
-
return [...getGraphitePreset(preset).colors];
|
|
86
|
-
if (colors.length >= 3)
|
|
87
|
-
return colors.slice(0, 3);
|
|
88
|
-
return [...GRAPHITE_DEFAULT_COLORS];
|
|
89
|
-
}
|
|
90
|
-
if (preset && !isGraphitePresetId(preset))
|
|
91
|
-
return getLuminaPresetColors(preset);
|
|
92
|
-
if (type === 'fluid' && colors.length < 5)
|
|
93
|
-
return FLUID_DEFAULT_COLORS;
|
|
94
|
-
if (type === 'snow' || type === 'flowers' || type === 'confetti') {
|
|
95
|
-
const defaults = getFallingParticleDefaults(type);
|
|
96
|
-
const isGenericDefault = colors.length === 3 && colors[0] === '#667eea' && colors[1] === '#764ba2';
|
|
97
|
-
return isGenericDefault ? defaults : colors;
|
|
98
|
-
}
|
|
99
|
-
return colors;
|
|
100
|
-
}
|
|
101
|
-
function createMeshAuroraLayer(colors, speed, blur, intensity, theme) {
|
|
102
|
-
const root = document.createElement('div');
|
|
103
|
-
root.className = `${CLASS}__aurora-mesh`;
|
|
104
|
-
const baseOpacity = intensity === 'subtle' ? 0.3 : intensity === 'medium' ? 0.6 : 0.8;
|
|
105
|
-
const duration = toAnimationDurationSec(speed, 5, 1.25);
|
|
106
|
-
const palette = colors.length >= 3 ? colors : ['#4f46e5', '#ec4899', '#06b6d4', '#8b5cf6'];
|
|
107
|
-
const blendMode = theme === 'dark' ? 'screen' : 'multiply';
|
|
108
|
-
const filterStyle = `blur(${blur}px)`;
|
|
109
|
-
const blobClass = `${CLASS}__aurora-blob`;
|
|
110
|
-
const blobs = [
|
|
111
|
-
{ backgroundColor: palette[0], top: '-10%', left: '-10%', animationDuration: `${duration}s`, animationDelay: '0s' },
|
|
112
|
-
{ backgroundColor: palette[1], top: '-10%', right: '-10%', animationDuration: `${duration * 1.2}s`, animationDelay: '2s' },
|
|
113
|
-
{ backgroundColor: palette[2], bottom: '-20%', left: '20%', animationDuration: `${duration * 1.5}s`, animationDelay: '4s' },
|
|
114
|
-
];
|
|
115
|
-
if (palette[3]) {
|
|
116
|
-
blobs.push({
|
|
117
|
-
backgroundColor: palette[3],
|
|
118
|
-
bottom: '-10%',
|
|
119
|
-
right: '-10%',
|
|
120
|
-
animationDuration: `${duration * 1.1}s`,
|
|
121
|
-
animationDelay: '1s',
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
blobs.forEach((style) => {
|
|
125
|
-
const blob = document.createElement('div');
|
|
126
|
-
blob.className = blobClass;
|
|
127
|
-
Object.assign(blob.style, {
|
|
128
|
-
filter: filterStyle,
|
|
129
|
-
opacity: String(baseOpacity),
|
|
130
|
-
mixBlendMode: blendMode,
|
|
131
|
-
...style,
|
|
132
|
-
});
|
|
133
|
-
root.appendChild(blob);
|
|
134
|
-
});
|
|
135
|
-
const noise = document.createElement('div');
|
|
136
|
-
noise.className = `${CLASS}__aurora-noise`;
|
|
137
|
-
noise.style.opacity = theme === 'dark' ? '0.03' : '0.05';
|
|
138
|
-
noise.style.backgroundImage = `url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E")`;
|
|
139
|
-
root.appendChild(noise);
|
|
140
|
-
return root;
|
|
141
|
-
}
|
|
142
|
-
function createPlasmaLayer(colors, speed, blur) {
|
|
143
|
-
const root = document.createElement('div');
|
|
144
|
-
root.className = `${CLASS}__plasma`;
|
|
145
|
-
const animId = Math.random().toString(36).slice(2, 11);
|
|
146
|
-
const palette = padColors(colors);
|
|
147
|
-
const c = (idx) => palette[idx % palette.length];
|
|
148
|
-
const luminaSpeed = toLuminaSpeed(speed);
|
|
149
|
-
const duration = LUMINA_ANIMATION_DURATION_SEC / luminaSpeed;
|
|
150
|
-
const style = document.createElement('style');
|
|
151
|
-
style.textContent = `
|
|
152
|
-
@keyframes designbase-wc-plasma-move-1-${animId} {
|
|
153
|
-
0% { transform: translate(0, 0) rotate(0deg) scale(1); }
|
|
154
|
-
25% { transform: translate(10%, 10%) rotate(90deg) scale(1.2); }
|
|
155
|
-
50% { transform: translate(0, 20%) rotate(180deg) scale(1); }
|
|
156
|
-
75% { transform: translate(-10%, 10%) rotate(270deg) scale(0.9); }
|
|
157
|
-
100% { transform: translate(0, 0) rotate(360deg) scale(1); }
|
|
158
|
-
}
|
|
159
|
-
@keyframes designbase-wc-plasma-move-2-${animId} {
|
|
160
|
-
0% { transform: translate(0, 0) rotate(0deg) scale(1.2); }
|
|
161
|
-
33% { transform: translate(-20%, 0) rotate(120deg) scale(1); }
|
|
162
|
-
66% { transform: translate(20%, -10%) rotate(240deg) scale(0.8); }
|
|
163
|
-
100% { transform: translate(0, 0) rotate(360deg) scale(1.2); }
|
|
164
|
-
}
|
|
165
|
-
@keyframes designbase-wc-plasma-move-3-${animId} {
|
|
166
|
-
0% { transform: translate(0, 0) scale(0.8); }
|
|
167
|
-
50% { transform: translate(15%, -15%) scale(1.4); }
|
|
168
|
-
100% { transform: translate(0, 0) scale(0.8); }
|
|
169
|
-
}
|
|
170
|
-
@keyframes designbase-wc-plasma-rotate-${animId} {
|
|
171
|
-
0% { transform: rotate(0deg) scale(1.5); }
|
|
172
|
-
50% { transform: rotate(180deg) scale(2.0); }
|
|
173
|
-
100% { transform: rotate(360deg) scale(1.5); }
|
|
174
|
-
}`;
|
|
175
|
-
root.appendChild(style);
|
|
176
|
-
const base = document.createElement('div');
|
|
177
|
-
base.className = `${CLASS}__plasma-base`;
|
|
178
|
-
base.style.backgroundColor = c(0);
|
|
179
|
-
root.appendChild(base);
|
|
180
|
-
const blobDefs = [
|
|
181
|
-
{ top: '-10%', left: '-10%', width: '70%', height: '70%', background: `radial-gradient(circle, ${c(1)} 0%, transparent 70%)`, animation: `designbase-wc-plasma-move-1-${animId} ${duration}s infinite linear` },
|
|
182
|
-
{ bottom: '-20%', right: '-10%', width: '80%', height: '80%', background: `radial-gradient(circle, ${c(2)} 0%, transparent 70%)`, animation: `designbase-wc-plasma-move-2-${animId} ${duration}s infinite linear` },
|
|
183
|
-
{ top: '20%', left: '20%', width: '60%', height: '60%', background: `radial-gradient(circle, ${c(3)} 0%, transparent 70%)`, animation: `designbase-wc-plasma-rotate-${animId} ${duration}s infinite linear`, extraClass: `${CLASS}__plasma-blob--exclusion` },
|
|
184
|
-
{ top: '40%', right: '20%', width: '40%', height: '40%', background: c(4), animation: `designbase-wc-plasma-move-3-${animId} ${duration}s infinite ease-in-out`, extraClass: `${CLASS}__plasma-blob--accent`, filter: `blur(${blur}px)`, opacity: '0.6' },
|
|
185
|
-
];
|
|
186
|
-
blobDefs.forEach((def) => {
|
|
187
|
-
const blob = document.createElement('div');
|
|
188
|
-
blob.className = `${CLASS}__plasma-blob${def.extraClass ? ` ${def.extraClass}` : ''}`;
|
|
189
|
-
Object.assign(blob.style, {
|
|
190
|
-
filter: def.filter || `blur(${blur}px)`,
|
|
191
|
-
opacity: def.opacity || '0.9',
|
|
192
|
-
...def,
|
|
193
|
-
});
|
|
194
|
-
root.appendChild(blob);
|
|
195
|
-
});
|
|
196
|
-
return root;
|
|
197
|
-
}
|
|
198
|
-
function createLuminaOverlays(noise, showVignette) {
|
|
199
|
-
const fragment = document.createDocumentFragment();
|
|
200
|
-
if (noise > 0) {
|
|
201
|
-
const noiseEl = document.createElement('div');
|
|
202
|
-
noiseEl.className = `${CLASS}__lumina-noise`;
|
|
203
|
-
noiseEl.style.backgroundImage = `url("${LUMINA_NOISE_SVG}")`;
|
|
204
|
-
noiseEl.style.opacity = String(noise);
|
|
205
|
-
fragment.appendChild(noiseEl);
|
|
206
|
-
}
|
|
207
|
-
if (showVignette) {
|
|
208
|
-
const vignette = document.createElement('div');
|
|
209
|
-
vignette.className = `${CLASS}__lumina-vignette`;
|
|
210
|
-
fragment.appendChild(vignette);
|
|
211
|
-
}
|
|
212
|
-
return fragment;
|
|
213
|
-
}
|
|
214
|
-
function syncLuminaOverlays(layersEl, noise, showVignette) {
|
|
215
|
-
let noiseEl = layersEl.querySelector(`.${CLASS}__lumina-noise`);
|
|
216
|
-
let vignetteEl = layersEl.querySelector(`.${CLASS}__lumina-vignette`);
|
|
217
|
-
if (noise > 0) {
|
|
218
|
-
if (!noiseEl) {
|
|
219
|
-
noiseEl = document.createElement('div');
|
|
220
|
-
noiseEl.className = `${CLASS}__lumina-noise`;
|
|
221
|
-
noiseEl.style.backgroundImage = `url("${LUMINA_NOISE_SVG}")`;
|
|
222
|
-
noiseEl.style.mixBlendMode = 'overlay';
|
|
223
|
-
layersEl.appendChild(noiseEl);
|
|
224
|
-
}
|
|
225
|
-
noiseEl.style.opacity = String(noise);
|
|
226
|
-
}
|
|
227
|
-
else {
|
|
228
|
-
noiseEl?.remove();
|
|
229
|
-
}
|
|
230
|
-
if (showVignette) {
|
|
231
|
-
if (!vignetteEl) {
|
|
232
|
-
vignetteEl = document.createElement('div');
|
|
233
|
-
vignetteEl.className = `${CLASS}__lumina-vignette`;
|
|
234
|
-
layersEl.appendChild(vignetteEl);
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
else {
|
|
238
|
-
vignetteEl?.remove();
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
function mountAnimationLayers(layersEl, config) {
|
|
242
|
-
const resolvedColors = resolveColors(config);
|
|
243
|
-
let handle = {};
|
|
244
|
-
if (config.disabled)
|
|
245
|
-
return handle;
|
|
246
|
-
switch (config.type) {
|
|
247
|
-
case 'particles':
|
|
248
|
-
case 'stars':
|
|
249
|
-
case 'snow':
|
|
250
|
-
case 'flowers':
|
|
251
|
-
case 'confetti': {
|
|
252
|
-
const container = document.createElement('div');
|
|
253
|
-
container.className = `${CLASS}__canvas-layer`;
|
|
254
|
-
layersEl.appendChild(container);
|
|
255
|
-
const controller = new CanvasAnimationController(container, {
|
|
256
|
-
type: config.type,
|
|
257
|
-
colors: resolvedColors,
|
|
258
|
-
speed: config.speed,
|
|
259
|
-
particleCount: config.particleCount,
|
|
260
|
-
particleSize: config.particleSize,
|
|
261
|
-
starCount: config.starCount,
|
|
262
|
-
starSize: config.starSize,
|
|
263
|
-
clickable: config.clickable,
|
|
264
|
-
wind: config.wind,
|
|
265
|
-
layerOpacity: config.opacity,
|
|
266
|
-
});
|
|
267
|
-
handle = {
|
|
268
|
-
destroy: () => controller.destroy(),
|
|
269
|
-
update: (next) => {
|
|
270
|
-
const nextColors = resolveColors(next);
|
|
271
|
-
controller.updateOptions({
|
|
272
|
-
colors: nextColors,
|
|
273
|
-
speed: next.speed,
|
|
274
|
-
particleCount: next.particleCount,
|
|
275
|
-
particleSize: next.particleSize,
|
|
276
|
-
starCount: next.starCount,
|
|
277
|
-
starSize: next.starSize,
|
|
278
|
-
clickable: next.clickable,
|
|
279
|
-
wind: next.wind,
|
|
280
|
-
layerOpacity: next.opacity,
|
|
281
|
-
});
|
|
282
|
-
},
|
|
283
|
-
};
|
|
284
|
-
break;
|
|
285
|
-
}
|
|
286
|
-
case 'aurora':
|
|
287
|
-
layersEl.appendChild(createMeshAuroraLayer(resolvedColors, config.speed, config.blur, config.intensity, config.theme));
|
|
288
|
-
break;
|
|
289
|
-
case 'plasma':
|
|
290
|
-
layersEl.appendChild(createPlasmaLayer(resolvedColors, config.speed, config.blur));
|
|
291
|
-
layersEl.appendChild(createLuminaOverlays(config.noise, config.showVignette));
|
|
292
|
-
break;
|
|
293
|
-
case 'mesh-flow':
|
|
294
|
-
case 'fluid':
|
|
295
|
-
case 'radiant':
|
|
296
|
-
case 'ethereal': {
|
|
297
|
-
const shaderContainer = document.createElement('div');
|
|
298
|
-
shaderContainer.className = `${CLASS}__shader-layer`;
|
|
299
|
-
layersEl.appendChild(shaderContainer);
|
|
300
|
-
const controller = new ShaderAnimationController(shaderContainer, {
|
|
301
|
-
variant: config.type,
|
|
302
|
-
colors: resolvedColors,
|
|
303
|
-
speed: config.speed,
|
|
304
|
-
blur: config.blur,
|
|
305
|
-
noise: config.noise,
|
|
306
|
-
zoom: config.zoom,
|
|
307
|
-
});
|
|
308
|
-
layersEl.appendChild(createLuminaOverlays(config.noise, config.showVignette));
|
|
309
|
-
handle = {
|
|
310
|
-
destroy: () => controller.destroy(),
|
|
311
|
-
update: (next) => {
|
|
312
|
-
const nextColors = resolveColors(next);
|
|
313
|
-
controller.updateOptions({
|
|
314
|
-
colors: nextColors,
|
|
315
|
-
speed: next.speed,
|
|
316
|
-
blur: next.blur,
|
|
317
|
-
noise: next.noise,
|
|
318
|
-
zoom: next.zoom,
|
|
319
|
-
});
|
|
320
|
-
},
|
|
321
|
-
};
|
|
322
|
-
break;
|
|
323
|
-
}
|
|
324
|
-
case 'graphite': {
|
|
325
|
-
const shaderContainer = document.createElement('div');
|
|
326
|
-
shaderContainer.className = `${CLASS}__shader-layer`;
|
|
327
|
-
layersEl.appendChild(shaderContainer);
|
|
328
|
-
const controller = new GraphiteShaderController(shaderContainer, {
|
|
329
|
-
colors: resolvedColors,
|
|
330
|
-
shaderSpeed: config.shaderSpeed,
|
|
331
|
-
shaderIntensity: config.shaderIntensity,
|
|
332
|
-
grain: config.noise,
|
|
333
|
-
scale: config.zoom,
|
|
334
|
-
warp: config.warp,
|
|
335
|
-
});
|
|
336
|
-
handle = {
|
|
337
|
-
destroy: () => controller.destroy(),
|
|
338
|
-
update: (next) => {
|
|
339
|
-
const nextColors = resolveColors(next);
|
|
340
|
-
controller.updateOptions({
|
|
341
|
-
colors: nextColors,
|
|
342
|
-
shaderSpeed: next.shaderSpeed,
|
|
343
|
-
shaderIntensity: next.shaderIntensity,
|
|
344
|
-
grain: next.noise,
|
|
345
|
-
scale: next.zoom,
|
|
346
|
-
warp: next.warp,
|
|
347
|
-
});
|
|
348
|
-
},
|
|
349
|
-
};
|
|
350
|
-
break;
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
return handle;
|
|
354
|
-
}
|
|
355
|
-
function applyContainerStyles(host, config) {
|
|
356
|
-
const isLumina = isLuminaType(config.type);
|
|
357
|
-
const isGraphite = config.type === 'graphite';
|
|
358
|
-
const backgroundColor = isLumina || isGraphite
|
|
359
|
-
? '#000000'
|
|
360
|
-
: config.theme === 'dark'
|
|
361
|
-
? 'var(--db-surface-base, #0f172a)'
|
|
362
|
-
: 'var(--db-surface-base, #ffffff)';
|
|
363
|
-
host.style.position = 'relative';
|
|
364
|
-
host.style.overflow = 'hidden';
|
|
365
|
-
host.style.backgroundColor = backgroundColor;
|
|
366
|
-
host.style.border = 'none';
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
export { CLASS as ANIMATION_BACKGROUND_CLASS, applyContainerStyles, mountAnimationLayers, parseAnimationBackgroundConfig, syncLuminaOverlays };
|
|
1
|
+
import{LUMINA_NOISE_SVG as e,isLuminaType as t,FLUID_DEFAULT_COLORS as a,padColors as r,toAnimationDurationSec as n,LUMINA_ANIMATION_DURATION_SEC as s,toLuminaSpeed as i}from"./lumina-utils.js";import{getLuminaPresetColors as o}from"./lumina-presets.js";import{getGraphitePreset as l,GRAPHITE_DEFAULT_COLORS as d,isGraphitePresetId as m}from"./graphite-presets.js";import{getFallingParticleDefaults as u}from"./particle-defaults.js";import{CanvasAnimationController as p}from"./canvas-controller.js";import{ShaderAnimationController as g}from"./shader-controller.js";import{GraphiteShaderController as b}from"./graphite-controller.js";const f="designbase-wc-animation-background",h="graphite",y=new Set(["particles","stars","snow","flowers","confetti","aurora","plasma","mesh-flow","fluid","radiant","ethereal","graphite"]);function parseColors(e,t){if(!e)return t;try{const a=JSON.parse(e);return Array.isArray(a)&&a.length?a:t}catch{return e.split(",").map(e=>e.trim()).filter(Boolean)}}function parseAnimationBackgroundConfig(e){const t=function normalizeAnimationType(e){return e&&"gradient"!==e&&y.has(e)?e:h}(e.getAttribute("type")),a="light"===e.getAttribute("theme")?"light":"dark",r=e.getAttribute("intensity")||"subtle",n=e.getAttribute("preset")||void 0,s=e.getAttribute("zoom"),i="graphite"===t;let o=Number(s||1);if(i&&null===s){const e=m(n)?n:"graphite";o=l(e).scale}return{type:t,theme:a,intensity:r,blur:Number(e.getAttribute("blur")||80),speed:Number(e.getAttribute("speed")||3e3),direction:e.getAttribute("direction")||"left",colors:parseColors(e.getAttribute("colors"),i?[...d]:["#667eea","#764ba2","#f093fb"]),opacity:Number(e.getAttribute("opacity")||1),particleCount:Number(e.getAttribute("particle-count")||("particles"===t?15:50)),particleSize:Number(e.getAttribute("particle-size")||2),starCount:Number(e.getAttribute("star-count")||100),starSize:Number(e.getAttribute("star-size")||1.5),clickable:e.hasAttribute("clickable")&&"false"!==e.getAttribute("clickable"),wind:Number(e.getAttribute("wind")||.5),noise:Number(e.getAttribute("noise")??(i?.1:.05)),showVignette:!e.hasAttribute("show-vignette")||"false"!==e.getAttribute("show-vignette"),preset:n||(i?"graphite":void 0),zoom:o,shaderSpeed:Number(e.getAttribute("shader-speed")||.4),shaderIntensity:Number(e.getAttribute("shader-intensity")||1.2),warp:Number(e.getAttribute("warp")||1.4),disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled")}}function resolveColors(e){const{type:t,preset:r,colors:n}=e;if("graphite"===t)return r&&m(r)?[...l(r).colors]:n.length>=3?n.slice(0,3):[...d];if(r&&!m(r))return o(r);if("fluid"===t&&n.length<5)return a;if("snow"===t||"flowers"===t||"confetti"===t){const e=u(t);return 3===n.length&&"#667eea"===n[0]&&"#764ba2"===n[1]?e:n}return n}function createLuminaOverlays(t,a){const r=document.createDocumentFragment();if(t>0){const a=document.createElement("div");a.className=`${f}__lumina-noise`,a.style.backgroundImage=`url("${e}")`,a.style.opacity=String(t),r.appendChild(a)}if(a){const e=document.createElement("div");e.className=`${f}__lumina-vignette`,r.appendChild(e)}return r}function syncLuminaOverlays(t,a,r){let n=t.querySelector(`.${f}__lumina-noise`),s=t.querySelector(`.${f}__lumina-vignette`);a>0?(n||(n=document.createElement("div"),n.className=`${f}__lumina-noise`,n.style.backgroundImage=`url("${e}")`,n.style.mixBlendMode="overlay",t.appendChild(n)),n.style.opacity=String(a)):n?.remove(),r?s||(s=document.createElement("div"),s.className=`${f}__lumina-vignette`,t.appendChild(s)):s?.remove()}function mountAnimationLayers(e,t){const a=resolveColors(t);let o={};if(t.disabled)return o;switch(t.type){case"particles":case"stars":case"snow":case"flowers":case"confetti":{const r=document.createElement("div");r.className=`${f}__canvas-layer`,e.appendChild(r);const n=new p(r,{type:t.type,colors:a,speed:t.speed,particleCount:t.particleCount,particleSize:t.particleSize,starCount:t.starCount,starSize:t.starSize,clickable:t.clickable,wind:t.wind,layerOpacity:t.opacity});o={destroy:()=>n.destroy(),update:e=>{const t=resolveColors(e);n.updateOptions({colors:t,speed:e.speed,particleCount:e.particleCount,particleSize:e.particleSize,starCount:e.starCount,starSize:e.starSize,clickable:e.clickable,wind:e.wind,layerOpacity:e.opacity})}};break}case"aurora":e.appendChild(function createMeshAuroraLayer(e,t,a,r,s){const i=document.createElement("div");i.className=`${f}__aurora-mesh`;const o="subtle"===r?.3:"medium"===r?.6:.8,l=n(t,5,1.25),d=e.length>=3?e:["#4f46e5","#ec4899","#06b6d4","#8b5cf6"],m="dark"===s?"screen":"multiply",u=`blur(${a}px)`,p=`${f}__aurora-blob`,g=[{backgroundColor:d[0],top:"-10%",left:"-10%",animationDuration:`${l}s`,animationDelay:"0s"},{backgroundColor:d[1],top:"-10%",right:"-10%",animationDuration:1.2*l+"s",animationDelay:"2s"},{backgroundColor:d[2],bottom:"-20%",left:"20%",animationDuration:1.5*l+"s",animationDelay:"4s"}];d[3]&&g.push({backgroundColor:d[3],bottom:"-10%",right:"-10%",animationDuration:1.1*l+"s",animationDelay:"1s"}),g.forEach(e=>{const t=document.createElement("div");t.className=p,Object.assign(t.style,{filter:u,opacity:String(o),mixBlendMode:m,...e}),i.appendChild(t)});const b=document.createElement("div");return b.className=`${f}__aurora-noise`,b.style.opacity="dark"===s?"0.03":"0.05",b.style.backgroundImage="url(\"data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E\")",i.appendChild(b),i}(a,t.speed,t.blur,t.intensity,t.theme));break;case"plasma":e.appendChild(function createPlasmaLayer(e,t,a){const n=document.createElement("div");n.className=`${f}__plasma`;const o=Math.random().toString(36).slice(2,11),l=r(e),c=e=>l[e%l.length],d=i(t),m=s/d,u=document.createElement("style");u.textContent=`\n @keyframes designbase-wc-plasma-move-1-${o} {\n 0% { transform: translate(0, 0) rotate(0deg) scale(1); }\n 25% { transform: translate(10%, 10%) rotate(90deg) scale(1.2); }\n 50% { transform: translate(0, 20%) rotate(180deg) scale(1); }\n 75% { transform: translate(-10%, 10%) rotate(270deg) scale(0.9); }\n 100% { transform: translate(0, 0) rotate(360deg) scale(1); }\n }\n @keyframes designbase-wc-plasma-move-2-${o} {\n 0% { transform: translate(0, 0) rotate(0deg) scale(1.2); }\n 33% { transform: translate(-20%, 0) rotate(120deg) scale(1); }\n 66% { transform: translate(20%, -10%) rotate(240deg) scale(0.8); }\n 100% { transform: translate(0, 0) rotate(360deg) scale(1.2); }\n }\n @keyframes designbase-wc-plasma-move-3-${o} {\n 0% { transform: translate(0, 0) scale(0.8); }\n 50% { transform: translate(15%, -15%) scale(1.4); }\n 100% { transform: translate(0, 0) scale(0.8); }\n }\n @keyframes designbase-wc-plasma-rotate-${o} {\n 0% { transform: rotate(0deg) scale(1.5); }\n 50% { transform: rotate(180deg) scale(2.0); }\n 100% { transform: rotate(360deg) scale(1.5); }\n }`,n.appendChild(u);const p=document.createElement("div");return p.className=`${f}__plasma-base`,p.style.backgroundColor=c(0),n.appendChild(p),[{top:"-10%",left:"-10%",width:"70%",height:"70%",background:`radial-gradient(circle, ${c(1)} 0%, transparent 70%)`,animation:`designbase-wc-plasma-move-1-${o} ${m}s infinite linear`},{bottom:"-20%",right:"-10%",width:"80%",height:"80%",background:`radial-gradient(circle, ${c(2)} 0%, transparent 70%)`,animation:`designbase-wc-plasma-move-2-${o} ${m}s infinite linear`},{top:"20%",left:"20%",width:"60%",height:"60%",background:`radial-gradient(circle, ${c(3)} 0%, transparent 70%)`,animation:`designbase-wc-plasma-rotate-${o} ${m}s infinite linear`,extraClass:`${f}__plasma-blob--exclusion`},{top:"40%",right:"20%",width:"40%",height:"40%",background:c(4),animation:`designbase-wc-plasma-move-3-${o} ${m}s infinite ease-in-out`,extraClass:`${f}__plasma-blob--accent`,filter:`blur(${a}px)`,opacity:"0.6"}].forEach(e=>{const t=document.createElement("div");t.className=`${f}__plasma-blob${e.extraClass?` ${e.extraClass}`:""}`,Object.assign(t.style,{filter:e.filter||`blur(${a}px)`,opacity:e.opacity||"0.9",...e}),n.appendChild(t)}),n}(a,t.speed,t.blur)),e.appendChild(createLuminaOverlays(t.noise,t.showVignette));break;case"mesh-flow":case"fluid":case"radiant":case"ethereal":{const r=document.createElement("div");r.className=`${f}__shader-layer`,e.appendChild(r);const n=new g(r,{variant:t.type,colors:a,speed:t.speed,blur:t.blur,noise:t.noise,zoom:t.zoom});e.appendChild(createLuminaOverlays(t.noise,t.showVignette)),o={destroy:()=>n.destroy(),update:e=>{const t=resolveColors(e);n.updateOptions({colors:t,speed:e.speed,blur:e.blur,noise:e.noise,zoom:e.zoom})}};break}case"graphite":{const r=document.createElement("div");r.className=`${f}__shader-layer`,e.appendChild(r);const n=new b(r,{colors:a,shaderSpeed:t.shaderSpeed,shaderIntensity:t.shaderIntensity,grain:t.noise,scale:t.zoom,warp:t.warp});o={destroy:()=>n.destroy(),update:e=>{const t=resolveColors(e);n.updateOptions({colors:t,shaderSpeed:e.shaderSpeed,shaderIntensity:e.shaderIntensity,grain:e.noise,scale:e.zoom,warp:e.warp})}};break}}return o}function applyContainerStyles(e,a){const r=t(a.type),n="graphite"===a.type,s=r||n?"#000000":"dark"===a.theme?"var(--db-surface-base, #0f172a)":"var(--db-surface-base, #ffffff)";e.style.position="relative",e.style.overflow="hidden",e.style.backgroundColor=s,e.style.border="none"}export{f as ANIMATION_BACKGROUND_CLASS,applyContainerStyles,mountAnimationLayers,parseAnimationBackgroundConfig,syncLuminaOverlays};
|
|
@@ -1,53 +1 @@
|
|
|
1
|
-
const
|
|
2
|
-
{
|
|
3
|
-
id: 'neon_dream',
|
|
4
|
-
name: 'Neon Dream',
|
|
5
|
-
colors: ['#7000FF', '#FF00AA', '#3300FF', '#FFCC00', '#00FFFF'],
|
|
6
|
-
},
|
|
7
|
-
{
|
|
8
|
-
id: 'sunset_bliss',
|
|
9
|
-
name: 'Sunset Bliss',
|
|
10
|
-
colors: ['#FF9900', '#FF00CC', '#6600FF', '#FF5500', '#220055'],
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
id: 'deep_ocean',
|
|
14
|
-
name: 'Deep Ocean',
|
|
15
|
-
colors: ['#001133', '#0044FF', '#00DDFF', '#00FFAA', '#000066'],
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
id: 'forest_mist',
|
|
19
|
-
name: 'Forest Mist',
|
|
20
|
-
colors: ['#002200', '#00FF44', '#AAFF00', '#006622', '#CCFFCC'],
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
id: 'northern_lights',
|
|
24
|
-
name: 'Northern Lights',
|
|
25
|
-
colors: ['#000000', '#00FF99', '#AA00FF', '#0044FF', '#FFFFFF'],
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
id: 'monochrome_fog',
|
|
29
|
-
name: 'Monochrome Fog',
|
|
30
|
-
colors: ['#000000', '#333333', '#888888', '#CCCCCC', '#FFFFFF'],
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
id: 'cotton_candy',
|
|
34
|
-
name: 'Cotton Candy',
|
|
35
|
-
colors: ['#FFC0CB', '#87CEFA', '#E0FFFF', '#DDA0DD', '#FF69B4'],
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
id: 'cyber_glitch',
|
|
39
|
-
name: 'Cyber Glitch',
|
|
40
|
-
colors: ['#1A1A1D', '#C3073F', '#6F2232', '#950740', '#4E4E50'],
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
id: 'golden_hour',
|
|
44
|
-
name: 'Golden Hour',
|
|
45
|
-
colors: ['#FF4E50', '#FC913A', '#F9D423', '#EDE574', '#E1F5C4'],
|
|
46
|
-
},
|
|
47
|
-
];
|
|
48
|
-
function getLuminaPresetColors(presetId) {
|
|
49
|
-
const preset = LUMINA_COLOR_PRESETS.find((p) => p.id === presetId);
|
|
50
|
-
return preset?.colors ?? LUMINA_COLOR_PRESETS[0].colors;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export { LUMINA_COLOR_PRESETS, getLuminaPresetColors };
|
|
1
|
+
const F=[{id:"neon_dream",name:"Neon Dream",colors:["#7000FF","#FF00AA","#3300FF","#FFCC00","#00FFFF"]},{id:"sunset_bliss",name:"Sunset Bliss",colors:["#FF9900","#FF00CC","#6600FF","#FF5500","#220055"]},{id:"deep_ocean",name:"Deep Ocean",colors:["#001133","#0044FF","#00DDFF","#00FFAA","#000066"]},{id:"forest_mist",name:"Forest Mist",colors:["#002200","#00FF44","#AAFF00","#006622","#CCFFCC"]},{id:"northern_lights",name:"Northern Lights",colors:["#000000","#00FF99","#AA00FF","#0044FF","#FFFFFF"]},{id:"monochrome_fog",name:"Monochrome Fog",colors:["#000000","#333333","#888888","#CCCCCC","#FFFFFF"]},{id:"cotton_candy",name:"Cotton Candy",colors:["#FFC0CB","#87CEFA","#E0FFFF","#DDA0DD","#FF69B4"]},{id:"cyber_glitch",name:"Cyber Glitch",colors:["#1A1A1D","#C3073F","#6F2232","#950740","#4E4E50"]},{id:"golden_hour",name:"Golden Hour",colors:["#FF4E50","#FC913A","#F9D423","#EDE574","#E1F5C4"]}];function getLuminaPresetColors(o){const e=F.find(F=>F.id===o);return e?.colors??F[0].colors}export{F as LUMINA_COLOR_PRESETS,getLuminaPresetColors};
|