3d-shape-particle-text 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 mukes555
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,84 @@
1
+ # 3d-shape-particle-text
2
+
3
+ A high-performance React component for rendering interactive 3D particle systems that morph between a brain-like structure and custom text. Built with React and Three.js.
4
+
5
+ ## Features
6
+
7
+ - **Particle Morphing**: Smooth transitions between 3D shapes and text.
8
+ - **Interactive**: Responds to mouse hover and rotation.
9
+ - **Customizable**: Configurable colors, particle counts, lightning effects, and more.
10
+ - **Responsive**: Automatically adjusts to container size.
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ npm install 3d-shape-particle-text three
16
+ # or
17
+ yarn add 3d-shape-particle-text three
18
+ ```
19
+
20
+ > **Note**: This package requires `react`, `react-dom`, and `three` as peer dependencies.
21
+
22
+ ## Usage
23
+
24
+ Here is a standard configuration matching the default theme:
25
+
26
+ ```jsx
27
+ import { ShapeParticleText } from '3d-shape-particle-text';
28
+
29
+ function App() {
30
+ return (
31
+ <div style={{ height: '100vh', width: '100%' }}>
32
+ <ShapeParticleText
33
+ text="AI"
34
+ particleCount={26000}
35
+ particleSize={0.01}
36
+ primaryColor={{ r: 0.396, g: 0.239, b: 0.820 }} // #653DD1
37
+ secondaryColor={{ r: 0.537, g: 0.239, b: 0.820 }} // #893DD1
38
+ backgroundColor="#000000"
39
+ lightningColor="#ffffff"
40
+ globeColor="#653DD1"
41
+ morphDuration={2.5}
42
+ rotationSpeed={0.1}
43
+ hoverIntensity={0.05}
44
+ lightningIntensity={1.7}
45
+ zapSpread={0.7}
46
+ zapWidth={0.003}
47
+ globeOpacity={0.15}
48
+ showGlobe={true}
49
+ glowEffect={true}
50
+ />
51
+ </div>
52
+ );
53
+ }
54
+ ```
55
+
56
+ ## Props
57
+
58
+ | Prop | Type | Default | Description |
59
+ | :--- | :--- | :--- | :--- |
60
+ | `text` | `string` | `'AI'` | The text to morph into. |
61
+ | `particleCount` | `number` | `24000` | Total number of particles. |
62
+ | `particleSize` | `number` | `0.01` | Size of individual particles. |
63
+ | `primaryColor` | `object` \| `string` | `{r: 0.396, g: 0.239, b: 0.820}` | Primary color of the brain structure. |
64
+ | `secondaryColor` | `object` \| `string` | `{r: 0.537, g: 0.239, b: 0.820}` | Secondary color for gradients and connections. |
65
+ | `backgroundColor` | `string` | `'#000000'` | Background color of the canvas. |
66
+ | `transparent` | `boolean` | `false` | Whether the canvas background is transparent. |
67
+ | `morphDuration` | `number` | `2.5` | Duration of the morph animation in seconds. |
68
+ | `rotationSpeed` | `number` | `0.4` | Speed of the idle rotation. |
69
+ | `hoverIntensity` | `number` | `0.05` | Intensity of the mouse hover tilt effect. |
70
+ | `lightningIntensity` | `number` | `1.0` | Frequency of lightning effects (0 to disable). |
71
+ | `lightningColor` | `object` \| `string` | `null` | Color of lightning bolts. If null, uses random colors. |
72
+ | `zapSpread` | `number` | `0.7` | Spread amplitude of lightning bolts. |
73
+ | `zapWidth` | `number` | `0.02` | Thickness of lightning bolts. |
74
+ | `cameraDistance` | `number` | `5.5` | Distance of the camera from the center. |
75
+ | `globeOpacity` | `number` | `0.08` | Opacity of the surrounding wireframe globe. |
76
+ | `globeColor` | `object` \| `string` | `null` | Color of the wireframe globe. If null, uses `primaryColor`. |
77
+ | `showGlobe` | `boolean` | `true` | Whether to render the wireframe globe. |
78
+ | `glowEffect` | `boolean` | `true` | Enables additive blending for a glow effect. |
79
+ | `className` | `string` | `''` | Custom CSS class for the container. |
80
+ | `style` | `object` | `{}` | Custom inline styles for the container. |
81
+
82
+ ## License
83
+
84
+ MIT
@@ -0,0 +1,956 @@
1
+ import lt, { useRef as rt, useEffect as dt } from "react";
2
+ import * as f from "three";
3
+ var nt = { exports: {} }, Ae = {};
4
+ /**
5
+ * @license React
6
+ * react-jsx-runtime.production.min.js
7
+ *
8
+ * Copyright (c) Facebook, Inc. and its affiliates.
9
+ *
10
+ * This source code is licensed under the MIT license found in the
11
+ * LICENSE file in the root directory of this source tree.
12
+ */
13
+ var ot;
14
+ function ht() {
15
+ if (ot) return Ae;
16
+ ot = 1;
17
+ var pe = lt, Y = Symbol.for("react.element"), ve = Symbol.for("react.fragment"), P = Object.prototype.hasOwnProperty, j = pe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, me = { key: !0, ref: !0, __self: !0, __source: !0 };
18
+ function oe(N, R, H) {
19
+ var w, M = {}, U = null, se = null;
20
+ H !== void 0 && (U = "" + H), R.key !== void 0 && (U = "" + R.key), R.ref !== void 0 && (se = R.ref);
21
+ for (w in R) P.call(R, w) && !me.hasOwnProperty(w) && (M[w] = R[w]);
22
+ if (N && N.defaultProps) for (w in R = N.defaultProps, R) M[w] === void 0 && (M[w] = R[w]);
23
+ return { $$typeof: Y, type: N, key: U, ref: se, props: M, _owner: j.current };
24
+ }
25
+ return Ae.Fragment = ve, Ae.jsx = oe, Ae.jsxs = oe, Ae;
26
+ }
27
+ var Ce = {};
28
+ /**
29
+ * @license React
30
+ * react-jsx-runtime.development.js
31
+ *
32
+ * Copyright (c) Facebook, Inc. and its affiliates.
33
+ *
34
+ * This source code is licensed under the MIT license found in the
35
+ * LICENSE file in the root directory of this source tree.
36
+ */
37
+ var st;
38
+ function pt() {
39
+ return st || (st = 1, process.env.NODE_ENV !== "production" && function() {
40
+ var pe = lt, Y = Symbol.for("react.element"), ve = Symbol.for("react.portal"), P = Symbol.for("react.fragment"), j = Symbol.for("react.strict_mode"), me = Symbol.for("react.profiler"), oe = Symbol.for("react.provider"), N = Symbol.for("react.context"), R = Symbol.for("react.forward_ref"), H = Symbol.for("react.suspense"), w = Symbol.for("react.suspense_list"), M = Symbol.for("react.memo"), U = Symbol.for("react.lazy"), se = Symbol.for("react.offscreen"), Pe = Symbol.iterator, Fe = "@@iterator";
41
+ function K(e) {
42
+ if (e === null || typeof e != "object")
43
+ return null;
44
+ var t = Pe && e[Pe] || e[Fe];
45
+ return typeof t == "function" ? t : null;
46
+ }
47
+ var Z = pe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
48
+ function _(e) {
49
+ {
50
+ for (var t = arguments.length, r = new Array(t > 1 ? t - 1 : 0), s = 1; s < t; s++)
51
+ r[s - 1] = arguments[s];
52
+ Xe("error", e, r);
53
+ }
54
+ }
55
+ function Xe(e, t, r) {
56
+ {
57
+ var s = Z.ReactDebugCurrentFrame, h = s.getStackAddendum();
58
+ h !== "" && (t += "%s", r = r.concat([h]));
59
+ var d = r.map(function(l) {
60
+ return String(l);
61
+ });
62
+ d.unshift("Warning: " + t), Function.prototype.apply.call(console[e], console, d);
63
+ }
64
+ }
65
+ var Je = !1, De = !1, ge = !1, x = !1, ce = !1, be;
66
+ be = Symbol.for("react.module.reference");
67
+ function at(e) {
68
+ return !!(typeof e == "string" || typeof e == "function" || e === P || e === me || ce || e === j || e === H || e === w || x || e === se || Je || De || ge || typeof e == "object" && e !== null && (e.$$typeof === U || e.$$typeof === M || e.$$typeof === oe || e.$$typeof === N || e.$$typeof === R || // This needs to include all possible module reference object
69
+ // types supported by any Flight configuration anywhere since
70
+ // we don't know which Flight build this will end up being used
71
+ // with.
72
+ e.$$typeof === be || e.getModuleId !== void 0));
73
+ }
74
+ function te(e, t, r) {
75
+ var s = e.displayName;
76
+ if (s)
77
+ return s;
78
+ var h = t.displayName || t.name || "";
79
+ return h !== "" ? r + "(" + h + ")" : r;
80
+ }
81
+ function Q(e) {
82
+ return e.displayName || "Context";
83
+ }
84
+ function g(e) {
85
+ if (e == null)
86
+ return null;
87
+ if (typeof e.tag == "number" && _("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
88
+ return e.displayName || e.name || null;
89
+ if (typeof e == "string")
90
+ return e;
91
+ switch (e) {
92
+ case P:
93
+ return "Fragment";
94
+ case ve:
95
+ return "Portal";
96
+ case me:
97
+ return "Profiler";
98
+ case j:
99
+ return "StrictMode";
100
+ case H:
101
+ return "Suspense";
102
+ case w:
103
+ return "SuspenseList";
104
+ }
105
+ if (typeof e == "object")
106
+ switch (e.$$typeof) {
107
+ case N:
108
+ var t = e;
109
+ return Q(t) + ".Consumer";
110
+ case oe:
111
+ var r = e;
112
+ return Q(r._context) + ".Provider";
113
+ case R:
114
+ return te(e, e.render, "ForwardRef");
115
+ case M:
116
+ var s = e.displayName || null;
117
+ return s !== null ? s : g(e.type) || "Memo";
118
+ case U: {
119
+ var h = e, d = h._payload, l = h._init;
120
+ try {
121
+ return g(l(d));
122
+ } catch {
123
+ return null;
124
+ }
125
+ }
126
+ }
127
+ return null;
128
+ }
129
+ var F = Object.assign, D = 0, le, L, Me, ye, we, W, T;
130
+ function p() {
131
+ }
132
+ p.__reactDisabledLog = !0;
133
+ function it() {
134
+ {
135
+ if (D === 0) {
136
+ le = console.log, L = console.info, Me = console.warn, ye = console.error, we = console.group, W = console.groupCollapsed, T = console.groupEnd;
137
+ var e = {
138
+ configurable: !0,
139
+ enumerable: !0,
140
+ value: p,
141
+ writable: !0
142
+ };
143
+ Object.defineProperties(console, {
144
+ info: e,
145
+ log: e,
146
+ warn: e,
147
+ error: e,
148
+ group: e,
149
+ groupCollapsed: e,
150
+ groupEnd: e
151
+ });
152
+ }
153
+ D++;
154
+ }
155
+ }
156
+ function G() {
157
+ {
158
+ if (D--, D === 0) {
159
+ var e = {
160
+ configurable: !0,
161
+ enumerable: !0,
162
+ writable: !0
163
+ };
164
+ Object.defineProperties(console, {
165
+ log: F({}, e, {
166
+ value: le
167
+ }),
168
+ info: F({}, e, {
169
+ value: L
170
+ }),
171
+ warn: F({}, e, {
172
+ value: Me
173
+ }),
174
+ error: F({}, e, {
175
+ value: ye
176
+ }),
177
+ group: F({}, e, {
178
+ value: we
179
+ }),
180
+ groupCollapsed: F({}, e, {
181
+ value: W
182
+ }),
183
+ groupEnd: F({}, e, {
184
+ value: T
185
+ })
186
+ });
187
+ }
188
+ D < 0 && _("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
189
+ }
190
+ }
191
+ var Te = Z.ReactCurrentDispatcher, Se;
192
+ function xe(e, t, r) {
193
+ {
194
+ if (Se === void 0)
195
+ try {
196
+ throw Error();
197
+ } catch (h) {
198
+ var s = h.stack.trim().match(/\n( *(at )?)/);
199
+ Se = s && s[1] || "";
200
+ }
201
+ return `
202
+ ` + Se + e;
203
+ }
204
+ }
205
+ var q = !1, Ee;
206
+ {
207
+ var Ke = typeof WeakMap == "function" ? WeakMap : Map;
208
+ Ee = new Ke();
209
+ }
210
+ function Le(e, t) {
211
+ if (!e || q)
212
+ return "";
213
+ {
214
+ var r = Ee.get(e);
215
+ if (r !== void 0)
216
+ return r;
217
+ }
218
+ var s;
219
+ q = !0;
220
+ var h = Error.prepareStackTrace;
221
+ Error.prepareStackTrace = void 0;
222
+ var d;
223
+ d = Te.current, Te.current = null, it();
224
+ try {
225
+ if (t) {
226
+ var l = function() {
227
+ throw Error();
228
+ };
229
+ if (Object.defineProperty(l.prototype, "props", {
230
+ set: function() {
231
+ throw Error();
232
+ }
233
+ }), typeof Reflect == "object" && Reflect.construct) {
234
+ try {
235
+ Reflect.construct(l, []);
236
+ } catch (C) {
237
+ s = C;
238
+ }
239
+ Reflect.construct(e, [], l);
240
+ } else {
241
+ try {
242
+ l.call();
243
+ } catch (C) {
244
+ s = C;
245
+ }
246
+ e.call(l.prototype);
247
+ }
248
+ } else {
249
+ try {
250
+ throw Error();
251
+ } catch (C) {
252
+ s = C;
253
+ }
254
+ e();
255
+ }
256
+ } catch (C) {
257
+ if (C && s && typeof C.stack == "string") {
258
+ for (var u = C.stack.split(`
259
+ `), A = s.stack.split(`
260
+ `), b = u.length - 1, y = A.length - 1; b >= 1 && y >= 0 && u[b] !== A[y]; )
261
+ y--;
262
+ for (; b >= 1 && y >= 0; b--, y--)
263
+ if (u[b] !== A[y]) {
264
+ if (b !== 1 || y !== 1)
265
+ do
266
+ if (b--, y--, y < 0 || u[b] !== A[y]) {
267
+ var V = `
268
+ ` + u[b].replace(" at new ", " at ");
269
+ return e.displayName && V.includes("<anonymous>") && (V = V.replace("<anonymous>", e.displayName)), typeof e == "function" && Ee.set(e, V), V;
270
+ }
271
+ while (b >= 1 && y >= 0);
272
+ break;
273
+ }
274
+ }
275
+ } finally {
276
+ q = !1, Te.current = d, G(), Error.prepareStackTrace = h;
277
+ }
278
+ var _e = e ? e.displayName || e.name : "", he = _e ? xe(_e) : "";
279
+ return typeof e == "function" && Ee.set(e, he), he;
280
+ }
281
+ function Ze(e, t, r) {
282
+ return Le(e, !1);
283
+ }
284
+ function We(e) {
285
+ var t = e.prototype;
286
+ return !!(t && t.isReactComponent);
287
+ }
288
+ function ue(e, t, r) {
289
+ if (e == null)
290
+ return "";
291
+ if (typeof e == "function")
292
+ return Le(e, We(e));
293
+ if (typeof e == "string")
294
+ return xe(e);
295
+ switch (e) {
296
+ case H:
297
+ return xe("Suspense");
298
+ case w:
299
+ return xe("SuspenseList");
300
+ }
301
+ if (typeof e == "object")
302
+ switch (e.$$typeof) {
303
+ case R:
304
+ return Ze(e.render);
305
+ case M:
306
+ return ue(e.type, t, r);
307
+ case U: {
308
+ var s = e, h = s._payload, d = s._init;
309
+ try {
310
+ return ue(d(h), t, r);
311
+ } catch {
312
+ }
313
+ }
314
+ }
315
+ return "";
316
+ }
317
+ var re = Object.prototype.hasOwnProperty, fe = {}, X = Z.ReactDebugCurrentFrame;
318
+ function ne(e) {
319
+ if (e) {
320
+ var t = e._owner, r = ue(e.type, e._source, t ? t.type : null);
321
+ X.setExtraStackFrame(r);
322
+ } else
323
+ X.setExtraStackFrame(null);
324
+ }
325
+ function Qe(e, t, r, s, h) {
326
+ {
327
+ var d = Function.call.bind(re);
328
+ for (var l in e)
329
+ if (d(e, l)) {
330
+ var u = void 0;
331
+ try {
332
+ if (typeof e[l] != "function") {
333
+ var A = Error((s || "React class") + ": " + r + " type `" + l + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[l] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
334
+ throw A.name = "Invariant Violation", A;
335
+ }
336
+ u = e[l](t, l, s, r, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
337
+ } catch (b) {
338
+ u = b;
339
+ }
340
+ u && !(u instanceof Error) && (ne(h), _("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", s || "React class", r, l, typeof u), ne(null)), u instanceof Error && !(u.message in fe) && (fe[u.message] = !0, ne(h), _("Failed %s type: %s", r, u.message), ne(null));
341
+ }
342
+ }
343
+ }
344
+ var Ge = Array.isArray;
345
+ function Oe(e) {
346
+ return Ge(e);
347
+ }
348
+ function et(e) {
349
+ {
350
+ var t = typeof Symbol == "function" && Symbol.toStringTag, r = t && e[Symbol.toStringTag] || e.constructor.name || "Object";
351
+ return r;
352
+ }
353
+ }
354
+ function Re(e) {
355
+ try {
356
+ return de(e), !1;
357
+ } catch {
358
+ return !0;
359
+ }
360
+ }
361
+ function de(e) {
362
+ return "" + e;
363
+ }
364
+ function ee(e) {
365
+ if (Re(e))
366
+ return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", et(e)), de(e);
367
+ }
368
+ var je = Z.ReactCurrentOwner, ae = {
369
+ key: !0,
370
+ ref: !0,
371
+ __self: !0,
372
+ __source: !0
373
+ }, Ie, J;
374
+ function Ye(e) {
375
+ if (re.call(e, "ref")) {
376
+ var t = Object.getOwnPropertyDescriptor(e, "ref").get;
377
+ if (t && t.isReactWarning)
378
+ return !1;
379
+ }
380
+ return e.ref !== void 0;
381
+ }
382
+ function $e(e) {
383
+ if (re.call(e, "key")) {
384
+ var t = Object.getOwnPropertyDescriptor(e, "key").get;
385
+ if (t && t.isReactWarning)
386
+ return !1;
387
+ }
388
+ return e.key !== void 0;
389
+ }
390
+ function ke(e, t) {
391
+ typeof e.ref == "string" && je.current;
392
+ }
393
+ function ze(e, t) {
394
+ {
395
+ var r = function() {
396
+ Ie || (Ie = !0, _("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
397
+ };
398
+ r.isReactWarning = !0, Object.defineProperty(e, "key", {
399
+ get: r,
400
+ configurable: !0
401
+ });
402
+ }
403
+ }
404
+ function Be(e, t) {
405
+ {
406
+ var r = function() {
407
+ J || (J = !0, _("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
408
+ };
409
+ r.isReactWarning = !0, Object.defineProperty(e, "ref", {
410
+ get: r,
411
+ configurable: !0
412
+ });
413
+ }
414
+ }
415
+ var Ve = function(e, t, r, s, h, d, l) {
416
+ var u = {
417
+ // This tag allows us to uniquely identify this as a React Element
418
+ $$typeof: Y,
419
+ // Built-in properties that belong on the element
420
+ type: e,
421
+ key: t,
422
+ ref: r,
423
+ props: l,
424
+ // Record the component responsible for creating this element.
425
+ _owner: d
426
+ };
427
+ return u._store = {}, Object.defineProperty(u._store, "validated", {
428
+ configurable: !1,
429
+ enumerable: !1,
430
+ writable: !0,
431
+ value: !1
432
+ }), Object.defineProperty(u, "_self", {
433
+ configurable: !1,
434
+ enumerable: !1,
435
+ writable: !1,
436
+ value: s
437
+ }), Object.defineProperty(u, "_source", {
438
+ configurable: !1,
439
+ enumerable: !1,
440
+ writable: !1,
441
+ value: h
442
+ }), Object.freeze && (Object.freeze(u.props), Object.freeze(u)), u;
443
+ };
444
+ function Ue(e, t, r, s, h) {
445
+ {
446
+ var d, l = {}, u = null, A = null;
447
+ r !== void 0 && (ee(r), u = "" + r), $e(t) && (ee(t.key), u = "" + t.key), Ye(t) && (A = t.ref, ke(t, h));
448
+ for (d in t)
449
+ re.call(t, d) && !ae.hasOwnProperty(d) && (l[d] = t[d]);
450
+ if (e && e.defaultProps) {
451
+ var b = e.defaultProps;
452
+ for (d in b)
453
+ l[d] === void 0 && (l[d] = b[d]);
454
+ }
455
+ if (u || A) {
456
+ var y = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
457
+ u && ze(l, y), A && Be(l, y);
458
+ }
459
+ return Ve(e, u, A, h, s, je.current, l);
460
+ }
461
+ }
462
+ var n = Z.ReactCurrentOwner, a = Z.ReactDebugCurrentFrame;
463
+ function o(e) {
464
+ if (e) {
465
+ var t = e._owner, r = ue(e.type, e._source, t ? t.type : null);
466
+ a.setExtraStackFrame(r);
467
+ } else
468
+ a.setExtraStackFrame(null);
469
+ }
470
+ var c;
471
+ c = !1;
472
+ function i(e) {
473
+ return typeof e == "object" && e !== null && e.$$typeof === Y;
474
+ }
475
+ function m() {
476
+ {
477
+ if (n.current) {
478
+ var e = g(n.current.type);
479
+ if (e)
480
+ return `
481
+
482
+ Check the render method of \`` + e + "`.";
483
+ }
484
+ return "";
485
+ }
486
+ }
487
+ function S(e) {
488
+ return "";
489
+ }
490
+ var v = {};
491
+ function k(e) {
492
+ {
493
+ var t = m();
494
+ if (!t) {
495
+ var r = typeof e == "string" ? e : e.displayName || e.name;
496
+ r && (t = `
497
+
498
+ Check the top-level render call using <` + r + ">.");
499
+ }
500
+ return t;
501
+ }
502
+ }
503
+ function E(e, t) {
504
+ {
505
+ if (!e._store || e._store.validated || e.key != null)
506
+ return;
507
+ e._store.validated = !0;
508
+ var r = k(t);
509
+ if (v[r])
510
+ return;
511
+ v[r] = !0;
512
+ var s = "";
513
+ e && e._owner && e._owner !== n.current && (s = " It was passed a child from " + g(e._owner.type) + "."), o(e), _('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', r, s), o(null);
514
+ }
515
+ }
516
+ function $(e, t) {
517
+ {
518
+ if (typeof e != "object")
519
+ return;
520
+ if (Oe(e))
521
+ for (var r = 0; r < e.length; r++) {
522
+ var s = e[r];
523
+ i(s) && E(s, t);
524
+ }
525
+ else if (i(e))
526
+ e._store && (e._store.validated = !0);
527
+ else if (e) {
528
+ var h = K(e);
529
+ if (typeof h == "function" && h !== e.entries)
530
+ for (var d = h.call(e), l; !(l = d.next()).done; )
531
+ i(l.value) && E(l.value, t);
532
+ }
533
+ }
534
+ }
535
+ function z(e) {
536
+ {
537
+ var t = e.type;
538
+ if (t == null || typeof t == "string")
539
+ return;
540
+ var r;
541
+ if (typeof t == "function")
542
+ r = t.propTypes;
543
+ else if (typeof t == "object" && (t.$$typeof === R || // Note: Memo only checks outer props here.
544
+ // Inner props are checked in the reconciler.
545
+ t.$$typeof === M))
546
+ r = t.propTypes;
547
+ else
548
+ return;
549
+ if (r) {
550
+ var s = g(t);
551
+ Qe(r, e.props, "prop", s, e);
552
+ } else if (t.PropTypes !== void 0 && !c) {
553
+ c = !0;
554
+ var h = g(t);
555
+ _("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", h || "Unknown");
556
+ }
557
+ typeof t.getDefaultProps == "function" && !t.getDefaultProps.isReactClassApproved && _("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
558
+ }
559
+ }
560
+ function ie(e) {
561
+ {
562
+ for (var t = Object.keys(e.props), r = 0; r < t.length; r++) {
563
+ var s = t[r];
564
+ if (s !== "children" && s !== "key") {
565
+ o(e), _("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", s), o(null);
566
+ break;
567
+ }
568
+ }
569
+ e.ref !== null && (o(e), _("Invalid attribute `ref` supplied to `React.Fragment`."), o(null));
570
+ }
571
+ }
572
+ var O = {};
573
+ function I(e, t, r, s, h, d) {
574
+ {
575
+ var l = at(e);
576
+ if (!l) {
577
+ var u = "";
578
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (u += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
579
+ var A = S();
580
+ A ? u += A : u += m();
581
+ var b;
582
+ e === null ? b = "null" : Oe(e) ? b = "array" : e !== void 0 && e.$$typeof === Y ? (b = "<" + (g(e.type) || "Unknown") + " />", u = " Did you accidentally export a JSX literal instead of a component?") : b = typeof e, _("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", b, u);
583
+ }
584
+ var y = Ue(e, t, r, h, d);
585
+ if (y == null)
586
+ return y;
587
+ if (l) {
588
+ var V = t.children;
589
+ if (V !== void 0)
590
+ if (s)
591
+ if (Oe(V)) {
592
+ for (var _e = 0; _e < V.length; _e++)
593
+ $(V[_e], e);
594
+ Object.freeze && Object.freeze(V);
595
+ } else
596
+ _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
597
+ else
598
+ $(V, e);
599
+ }
600
+ if (re.call(t, "key")) {
601
+ var he = g(e), C = Object.keys(t).filter(function(ft) {
602
+ return ft !== "key";
603
+ }), tt = C.length > 0 ? "{key: someKey, " + C.join(": ..., ") + ": ...}" : "{key: someKey}";
604
+ if (!O[he + tt]) {
605
+ var ut = C.length > 0 ? "{" + C.join(": ..., ") + ": ...}" : "{}";
606
+ _(`A props object containing a "key" prop is being spread into JSX:
607
+ let props = %s;
608
+ <%s {...props} />
609
+ React keys must be passed directly to JSX without using spread:
610
+ let props = %s;
611
+ <%s key={someKey} {...props} />`, tt, he, ut, he), O[he + tt] = !0;
612
+ }
613
+ }
614
+ return e === P ? ie(y) : z(y), y;
615
+ }
616
+ }
617
+ function B(e, t, r) {
618
+ return I(e, t, r, !0);
619
+ }
620
+ function qe(e, t, r) {
621
+ return I(e, t, r, !1);
622
+ }
623
+ var Ne = qe, He = B;
624
+ Ce.Fragment = P, Ce.jsx = Ne, Ce.jsxs = He;
625
+ }()), Ce;
626
+ }
627
+ process.env.NODE_ENV === "production" ? nt.exports = ht() : nt.exports = pt();
628
+ var ct = nt.exports;
629
+ const mt = ({
630
+ text: pe = "AI",
631
+ particleCount: Y = 24e3,
632
+ particleSize: ve = 0.01,
633
+ primaryColor: P = { r: 0.396, g: 0.239, b: 0.82 },
634
+ // #653DD1
635
+ secondaryColor: j = { r: 0.537, g: 0.239, b: 0.82 },
636
+ // Purple variant
637
+ backgroundColor: me = "#000000",
638
+ transparent: oe = !1,
639
+ morphDuration: N = 2.5,
640
+ rotationSpeed: R = 0.4,
641
+ hoverIntensity: H = 0.05,
642
+ lightningIntensity: w = 1,
643
+ lightningColor: M = null,
644
+ // Optional hex or {r,g,b} object. If null, uses random colors
645
+ zapSpread: U = 0.7,
646
+ // Amplitude/Spread of lightning
647
+ zapWidth: se = 0.02,
648
+ // Thickness of lightning
649
+ cameraDistance: Pe = 5.5,
650
+ globeOpacity: Fe = 0.08,
651
+ globeColor: K = null,
652
+ // Optional override for globe color
653
+ showGlobe: Z = !0,
654
+ glowEffect: _ = !0,
655
+ className: Xe = "",
656
+ style: Je = {}
657
+ }) => {
658
+ const De = rt(null), ge = rt(null);
659
+ return rt([]), dt(() => {
660
+ const x = De.current;
661
+ if (!x) {
662
+ console.error("ShapeParticleText: Canvas element not found");
663
+ return;
664
+ }
665
+ let ce = !0;
666
+ const be = [];
667
+ return (() => {
668
+ var Ve, Ue;
669
+ if (!ce) return;
670
+ const te = new f.Scene(), Q = new f.PerspectiveCamera(50, x.offsetWidth / x.offsetHeight, 0.1, 1e3);
671
+ let g;
672
+ try {
673
+ const n = {
674
+ alpha: !0,
675
+ antialias: !0,
676
+ powerPreference: "default"
677
+ }, a = x.getContext("webgl2", n) || x.getContext("webgl", n) || x.getContext("experimental-webgl", n);
678
+ if (!a) {
679
+ console.error("ShapeParticleText: WebGL not supported in this environment");
680
+ return;
681
+ }
682
+ const o = (c, i) => {
683
+ const m = Object.getOwnPropertyDescriptor(c, i);
684
+ return m && !m.writable && !m.configurable;
685
+ };
686
+ if (!a.getShaderPrecisionFormat._isPatched) {
687
+ const c = a.getShaderPrecisionFormat, i = function(...m) {
688
+ return { rangeMin: 127, rangeMax: 127, precision: 23 };
689
+ };
690
+ i._isPatched = !0, Object.defineProperty(a, "getShaderPrecisionFormat", {
691
+ value: i,
692
+ configurable: !0
693
+ });
694
+ }
695
+ if (!a.getParameter._isPatched) {
696
+ const c = a.getParameter, i = function(...m) {
697
+ let S = null;
698
+ try {
699
+ S = c.apply(a, m);
700
+ } catch {
701
+ }
702
+ const v = m[0];
703
+ return S ?? (v === 7938 ? "WebGL 1.0 (Three.js Mock)" : v === 35724 ? "WebGL GLSL ES 1.0 (Three.js Mock)" : v === 7936 ? "Three.js Mock Vendor" : v === 7937 ? "Three.js Mock Renderer" : v === 34921 || v === 34930 || v === 35657 || v === 35658 ? 16 : "");
704
+ };
705
+ i._isPatched = !0, Object.defineProperty(a, "getParameter", {
706
+ value: i,
707
+ configurable: !0
708
+ });
709
+ }
710
+ if (!a.getExtension._isPatched) {
711
+ const c = a.getExtension, i = function(...m) {
712
+ let S = null;
713
+ try {
714
+ S = c.apply(a, m);
715
+ } catch {
716
+ }
717
+ return S === null && m[0] === "WEBGL_debug_renderer_info" ? null : S;
718
+ };
719
+ i._isPatched = !0, Object.defineProperty(a, "getExtension", {
720
+ value: i,
721
+ configurable: !0
722
+ });
723
+ }
724
+ g = new f.WebGLRenderer({
725
+ canvas: x,
726
+ context: a,
727
+ precision: "mediump",
728
+ ...n
729
+ }), g.capabilities && (g.capabilities.isWebGL2 || (g.capabilities.isWebGL2 = !0), g.capabilities.precision || (g.capabilities.precision = "mediump"));
730
+ } catch (n) {
731
+ console.warn("ShapeParticleText: Failed to initialize custom context renderer, attempting hard fallback...", n);
732
+ try {
733
+ g = new f.WebGLRenderer({ canvas: x });
734
+ } catch (a) {
735
+ console.error("ShapeParticleText: Fatal error initializing WebGL renderer:", a);
736
+ return;
737
+ }
738
+ }
739
+ g.setSize(x.offsetWidth, x.offsetHeight), g.setPixelRatio(Math.min(window.devicePixelRatio, 2)), g.setClearColor(0, 0);
740
+ let F = null;
741
+ if (Z) {
742
+ const n = new f.SphereGeometry(2, 48, 48);
743
+ let a;
744
+ K ? a = typeof K == "string" ? new f.Color(K) : new f.Color(K.r, K.g, K.b) : a = new f.Color(P.r, P.g, P.b);
745
+ const o = new f.MeshBasicMaterial({
746
+ color: a,
747
+ wireframe: !0,
748
+ transparent: !0,
749
+ opacity: Fe
750
+ });
751
+ F = new f.Mesh(n, o), te.add(F);
752
+ }
753
+ const D = new f.Group(), le = new Float32Array(Y * 3), L = new Float32Array(Y * 3), Me = new Float32Array(Y), ye = [], we = [], W = [], T = [];
754
+ let p = 0;
755
+ for (let n = 0; n < Y; n++) {
756
+ const a = n < Y / 2 ? -1 : 1, o = Math.random() * Math.PI, c = Math.random() * Math.PI * 2, i = 1.4 + Math.random() * 0.3, m = 1.2 + Math.random() * 0.2, S = 1 + Math.random() * 0.2;
757
+ let v = i * Math.sin(o) * Math.cos(c), k = m * Math.sin(o) * Math.sin(c), E = S * Math.cos(o);
758
+ v = v * 0.85 + a * 0.35;
759
+ const $ = (Math.sin(o * 8) * Math.cos(c * 6) + Math.sin(o * 12) * Math.sin(c * 8)) * 0.12, z = Math.sqrt(v * v + k * k + E * E);
760
+ z > 0.1 && (v += $ * (v / z), k += $ * (k / z), E += $ * (E / z));
761
+ const ie = Math.sqrt(v * v + k * k + E * E);
762
+ if (ie < 1 || ie > 2 || a === -1 && v > -0.15 || a === 1 && v < 0.15)
763
+ continue;
764
+ const O = new f.Vector3(v, k, E);
765
+ O.x < 0 ? ye.push(O.clone()) : we.push(O.clone()), le[p * 3] = O.x, le[p * 3 + 1] = O.y, le[p * 3 + 2] = O.z, W.push(O.x, O.y, O.z);
766
+ const I = (k + m) / (m * 2);
767
+ if (I < 0.3)
768
+ L[p * 3] = P.r * 0.5 + I * 0.4, L[p * 3 + 1] = P.g * 1 + I * 0.05, L[p * 3 + 2] = P.b * 1 + I * 0.05;
769
+ else if (I < 0.6) {
770
+ const B = (I - 0.3) / 0.3;
771
+ L[p * 3] = (P.r * (1 - B) + j.r * B) * 1.1, L[p * 3 + 1] = (P.g * (1 - B) + j.g * B) * 1.1, L[p * 3 + 2] = (P.b * (1 - B) + j.b * B) * 1.1;
772
+ } else
773
+ L[p * 3] = j.r * 1, L[p * 3 + 1] = j.g * 1, L[p * 3 + 2] = j.b * 1;
774
+ Me[p] = Math.random() * 1.5 + 0.8, p++;
775
+ }
776
+ const G = ((n, a = 1.5) => {
777
+ const o = n && n.trim().length > 0 ? n : "AI", c = document.createElement("canvas"), i = c.getContext("2d");
778
+ c.width = 1024, c.height = 512, i.fillStyle = "white", i.textAlign = "center", i.textBaseline = "middle";
779
+ let m = 350;
780
+ i.font = `bold ${m}px Arial`;
781
+ const S = c.width * 0.85;
782
+ let v = i.measureText(o);
783
+ for (; (v.width > S || m > c.height * 0.7) && m > 20; )
784
+ m -= 10, i.font = `bold ${m}px Arial`, v = i.measureText(o);
785
+ i.fillText(o, c.width / 2, c.height / 2);
786
+ const k = i.getImageData(0, 0, c.width, c.height), E = [], $ = 3, z = 220;
787
+ let ie = 1 / 0, O = -1 / 0, I = 1 / 0, B = -1 / 0;
788
+ for (let r = 0; r < c.height; r += $)
789
+ for (let s = 0; s < c.width; s += $) {
790
+ const h = (Math.floor(r) * c.width + Math.floor(s)) * 4;
791
+ if (k.data[h + 3] > 160) {
792
+ const d = (s - c.width / 2) / z * a, l = -(r - c.height / 2) / z * a, u = (Math.random() - 0.5) * 0.25;
793
+ E.push({ x: d, y: l, z: u }), d < ie && (ie = d), d > O && (O = d), l < I && (I = l), l > B && (B = l);
794
+ }
795
+ }
796
+ const qe = O - ie, Ne = B - I, He = 3.2, e = 2.5;
797
+ let t = 1;
798
+ return qe > He && (t = He / qe), Ne * t > e && (t = e / Ne), t < 1 && E.forEach((r) => {
799
+ r.x *= t, r.y *= t, r.z *= t;
800
+ }), E;
801
+ })(pe, 1.8);
802
+ if (G.length > 0)
803
+ if (G.length > p) {
804
+ const n = G.length / p;
805
+ for (let a = 0; a < p; a++) {
806
+ const o = Math.floor(a * n), c = G[Math.min(o, G.length - 1)];
807
+ T.push(c.x, c.y, c.z);
808
+ }
809
+ } else
810
+ for (let n = 0; n < p; n++)
811
+ if (n < G.length)
812
+ T.push(
813
+ G[n].x,
814
+ G[n].y,
815
+ G[n].z
816
+ );
817
+ else {
818
+ const a = G[Math.floor(Math.random() * G.length)];
819
+ T.push(
820
+ a.x + (Math.random() - 0.5) * 0.5,
821
+ a.y + (Math.random() - 0.5) * 0.5,
822
+ a.z + (Math.random() - 0.5) * 0.3
823
+ );
824
+ }
825
+ else
826
+ for (let n = 0; n < p; n++)
827
+ T.push(0, 0, 0);
828
+ const Te = le.slice(0, p * 3), Se = L.slice(0, p * 3), xe = Me.slice(0, p), q = new f.BufferGeometry();
829
+ q.setAttribute("position", new f.BufferAttribute(Te, 3)), q.setAttribute("color", new f.BufferAttribute(Se, 3)), q.setAttribute("size", new f.BufferAttribute(xe, 1)), q.setDrawRange(0, p);
830
+ const Ee = new f.PointsMaterial({
831
+ size: ve,
832
+ vertexColors: !0,
833
+ transparent: !0,
834
+ opacity: 1,
835
+ blending: _ ? f.AdditiveBlending : f.NormalBlending,
836
+ sizeAttenuation: !0
837
+ }), Ke = new f.Points(q, Ee);
838
+ D.add(Ke), te.add(D);
839
+ const Le = new f.Color(j.r, j.g, j.b), Ze = new f.LineBasicMaterial({
840
+ color: Le,
841
+ transparent: !0,
842
+ opacity: 0.2
843
+ }), We = new f.Group(), ue = ye.length, re = we.length;
844
+ if (ue > 0 && re > 0)
845
+ for (let n = 0; n < 80; n++) {
846
+ const a = (Ve = ye[Math.floor(Math.random() * ue)]) == null ? void 0 : Ve.clone(), o = (Ue = we[Math.floor(Math.random() * re)]) == null ? void 0 : Ue.clone();
847
+ if (!a || !o) continue;
848
+ const c = new f.BufferGeometry().setFromPoints([a, o]), i = new f.Line(c, Ze);
849
+ We.add(i);
850
+ }
851
+ D.add(We);
852
+ const fe = new f.Group();
853
+ D.add(fe);
854
+ const X = [];
855
+ let ne = 0;
856
+ const Qe = 6, Ge = (n) => new f.Vector3(
857
+ (Math.random() - 0.5) * n,
858
+ (Math.random() - 0.5) * n,
859
+ (Math.random() - 0.5) * n
860
+ ), Oe = () => {
861
+ if (!ce || !p) return;
862
+ const n = Math.floor(Math.random() * p), a = Math.floor(Math.random() * p), o = q.attributes.position.array, c = new f.Vector3(o[n * 3], o[n * 3 + 1], o[n * 3 + 2]), i = new f.Vector3(o[a * 3], o[a * 3 + 1], o[a * 3 + 2]);
863
+ if (c.lengthSq() < 0.1 || i.lengthSq() < 0.1 || c.distanceToSquared(i) < 0.5) return;
864
+ const m = c.clone().lerp(i, 0.3).add(Ge(U)), S = c.clone().lerp(i, 0.7).add(Ge(U)), v = new f.CatmullRomCurve3([c, m, S, i]), k = new f.TubeGeometry(v, 12, se, 4, !1);
865
+ let E;
866
+ M ? M.r !== void 0 ? E = new f.Color(M.r, M.g, M.b) : E = new f.Color(M) : E = new f.Color().setHSL(0.7 + Math.random() * 0.08, 1, 0.7 + Math.random() * 0.15);
867
+ const $ = new f.MeshBasicMaterial({
868
+ color: E,
869
+ transparent: !0,
870
+ opacity: 0.85,
871
+ blending: f.AdditiveBlending
872
+ }), z = new f.Mesh(k, $);
873
+ fe.add(z), X.push({
874
+ line: z,
875
+ material: $,
876
+ life: 0,
877
+ maxLife: 0.5 + Math.random() * 0.9,
878
+ flickerSpeed: 18 + Math.random() * 20,
879
+ phase: Math.random() * Math.PI * 2
880
+ });
881
+ }, et = new f.Clock();
882
+ Q.position.set(0, 0, Pe);
883
+ const Re = { x: 0, y: 0 }, de = { x: 0, y: 0 }, ee = { x: 0, y: 0 }, je = (n) => {
884
+ if (!x) return;
885
+ const a = x.getBoundingClientRect();
886
+ Re.x = (n.clientX - a.left) / a.width * 2 - 1, Re.y = -((n.clientY - a.top) / a.height) * 2 + 1, de.y = Re.x * 0.3 * (H / 0.05), de.x = Re.y * 0.2 * (H / 0.05);
887
+ };
888
+ x.addEventListener("mousemove", je), be.push(() => {
889
+ x.removeEventListener("mousemove", je);
890
+ });
891
+ let ae = 0;
892
+ const Ie = 0.08;
893
+ let J = 0, Ye = 1;
894
+ const $e = 3;
895
+ let ke = $e;
896
+ function ze() {
897
+ if (!ce) return;
898
+ ge.current = requestAnimationFrame(ze);
899
+ const n = et.getDelta();
900
+ if (ae += n, ee.x += (de.x - ee.x) * 0.05, ee.y += (de.y - ee.y) * 0.05, F && (F.rotation.y += n * 0.1, F.rotation.x = Math.sin(ae * 0.3) * 0.03), D.rotation.y = Math.sin(ae * 0.4) * R + ee.y, D.rotation.x = Math.sin(ae * 0.25) * Ie + ee.x, D.rotation.z = Math.cos(ae * 0.15) * 0.015, ke -= n, ke <= 0) {
901
+ J += n / N, J >= 1 && (J = 0, Ye *= -1, ke = $e);
902
+ const a = J < 0.5 ? 2 * J * J : 1 - Math.pow(-2 * J + 2, 2) / 2, o = q.attributes.position;
903
+ for (let c = 0; c < p; c++) {
904
+ const i = c * 3;
905
+ Ye === 1 ? (o.array[i] = W[i] + (T[i] - W[i]) * a, o.array[i + 1] = W[i + 1] + (T[i + 1] - W[i + 1]) * a, o.array[i + 2] = W[i + 2] + (T[i + 2] - W[i + 2]) * a) : (o.array[i] = T[i] + (W[i] - T[i]) * a, o.array[i + 1] = T[i + 1] + (W[i + 1] - T[i + 1]) * a, o.array[i + 2] = T[i + 2] + (W[i + 2] - T[i + 2]) * a);
906
+ }
907
+ o.needsUpdate = !0;
908
+ }
909
+ ne -= n, w > 0 && ne <= 0 && X.length < Qe * w && (Oe(), ne = (0.12 + Math.random() * 0.25) / Math.max(0.1, w));
910
+ for (let a = X.length - 1; a >= 0; a--) {
911
+ const o = X[a];
912
+ if (!o || !o.material) continue;
913
+ o.life += n;
914
+ const c = o.life / o.maxLife, i = Math.pow(Math.max(0, 1 - c), 1.5), m = 0.6 + Math.sin(ae * o.flickerSpeed + o.phase) * 0.4;
915
+ o.material.opacity = Math.max(0, i * m * Math.min(1, w)), o.life >= o.maxLife && (fe.remove(o.line), o.line.geometry && o.line.geometry.dispose(), o.material && o.material.dispose(), X.splice(a, 1));
916
+ }
917
+ g.render(te, Q);
918
+ }
919
+ ze();
920
+ const Be = () => {
921
+ if (!ce || !x) return;
922
+ const n = x.offsetWidth, a = x.offsetHeight;
923
+ n === 0 || a === 0 || (Q.aspect = n / a, Q.updateProjectionMatrix(), g.setSize(n, a), g.setPixelRatio(Math.min(window.devicePixelRatio * 1.5, 3)));
924
+ };
925
+ window.addEventListener("resize", Be), be.push(() => {
926
+ window.removeEventListener("resize", Be), X.forEach((n) => {
927
+ n.line && (fe.remove(n.line), n.line.geometry && n.line.geometry.dispose(), n.material && n.material.dispose());
928
+ }), X.length = 0, te.traverse((n) => {
929
+ n.geometry && n.geometry.dispose(), n.material && (Array.isArray(n.material) ? n.material.forEach((a) => a.dispose()) : n.material.dispose());
930
+ }), g.dispose();
931
+ });
932
+ })(), () => {
933
+ ce = !1, ge.current && (cancelAnimationFrame(ge.current), ge.current = null), be.forEach((te) => {
934
+ try {
935
+ te();
936
+ } catch (Q) {
937
+ console.error("Cleanup error:", Q);
938
+ }
939
+ });
940
+ };
941
+ }, [pe, Y, ve, P, j, N, R, H, w, M, U, se, Pe, Fe, K, Z, _]), /* @__PURE__ */ ct.jsx("div", { className: Xe, style: { position: "relative", width: "100%", height: "100%", backgroundColor: oe ? "transparent" : me, ...Je }, children: /* @__PURE__ */ ct.jsx(
942
+ "canvas",
943
+ {
944
+ ref: De,
945
+ style: {
946
+ display: "block",
947
+ width: "100%",
948
+ height: "100%",
949
+ outline: "none"
950
+ }
951
+ }
952
+ ) });
953
+ };
954
+ export {
955
+ mt as ShapeParticleText
956
+ };
@@ -0,0 +1,30 @@
1
+ (function(ae,q){typeof exports=="object"&&typeof module<"u"?q(exports,require("react"),require("three")):typeof define=="function"&&define.amd?define(["exports","react","three"],q):(ae=typeof globalThis<"u"?globalThis:ae||self,q(ae["3dShapeParticleText"]={},ae.React,ae.THREE))})(this,function(ae,q,ut){"use strict";function ft(z){const T=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(z){for(const $ in z)if($!=="default"){const y=Object.getOwnPropertyDescriptor(z,$);Object.defineProperty(T,$,y.get?y:{enumerable:!0,get:()=>z[$]})}}return T.default=z,Object.freeze(T)}const u=ft(ut);var Ke={exports:{}},Te={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var it;function dt(){if(it)return Te;it=1;var z=q,T=Symbol.for("react.element"),$=Symbol.for("react.fragment"),y=Object.prototype.hasOwnProperty,k=z.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,be={key:!0,ref:!0,__self:!0,__source:!0};function ue(J,P,K){var w,M={},H=null,fe=null;K!==void 0&&(H=""+K),P.key!==void 0&&(H=""+P.key),P.ref!==void 0&&(fe=P.ref);for(w in P)y.call(P,w)&&!be.hasOwnProperty(w)&&(M[w]=P[w]);if(J&&J.defaultProps)for(w in P=J.defaultProps,P)M[w]===void 0&&(M[w]=P[w]);return{$$typeof:T,type:J,key:H,ref:fe,props:M,_owner:k.current}}return Te.Fragment=$,Te.jsx=ue,Te.jsxs=ue,Te}var Se={};/**
10
+ * @license React
11
+ * react-jsx-runtime.development.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var ot;function ht(){return ot||(ot=1,process.env.NODE_ENV!=="production"&&function(){var z=q,T=Symbol.for("react.element"),$=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),be=Symbol.for("react.profiler"),ue=Symbol.for("react.provider"),J=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),K=Symbol.for("react.suspense"),w=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),fe=Symbol.for("react.offscreen"),Oe=Symbol.iterator,Le="@@iterator";function ee(e){if(e===null||typeof e!="object")return null;var t=Oe&&e[Oe]||e[Le];return typeof t=="function"?t:null}var te=z.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(e){{for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];Ze("error",e,r)}}function Ze(e,t,r){{var s=te.ReactDebugCurrentFrame,h=s.getStackAddendum();h!==""&&(t+="%s",r=r.concat([h]));var d=r.map(function(l){return String(l)});d.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,d)}}var Qe=!1,We=!1,ye=!1,E=!1,de=!1,xe;xe=Symbol.for("react.module.reference");function ct(e){return!!(typeof e=="string"||typeof e=="function"||e===y||e===be||de||e===k||e===K||e===w||E||e===fe||Qe||We||ye||typeof e=="object"&&e!==null&&(e.$$typeof===H||e.$$typeof===M||e.$$typeof===ue||e.$$typeof===J||e.$$typeof===P||e.$$typeof===xe||e.getModuleId!==void 0))}function ie(e,t,r){var s=e.displayName;if(s)return s;var h=t.displayName||t.name||"";return h!==""?r+"("+h+")":r}function re(e){return e.displayName||"Context"}function g(e){if(e==null)return null;if(typeof e.tag=="number"&&_("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case y:return"Fragment";case $:return"Portal";case be:return"Profiler";case k:return"StrictMode";case K:return"Suspense";case w:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case J:var t=e;return re(t)+".Consumer";case ue:var r=e;return re(r._context)+".Provider";case P:return ie(e,e.render,"ForwardRef");case M:var s=e.displayName||null;return s!==null?s:g(e.type)||"Memo";case H:{var h=e,d=h._payload,l=h._init;try{return g(l(d))}catch{return null}}}return null}var D=Object.assign,L=0,he,W,je,we,Ee,G,S;function p(){}p.__reactDisabledLog=!0;function lt(){{if(L===0){he=console.log,W=console.info,je=console.warn,we=console.error,Ee=console.group,G=console.groupCollapsed,S=console.groupEnd;var e={configurable:!0,enumerable:!0,value:p,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}L++}}function I(){{if(L--,L===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:D({},e,{value:he}),info:D({},e,{value:W}),warn:D({},e,{value:je}),error:D({},e,{value:we}),group:D({},e,{value:Ee}),groupCollapsed:D({},e,{value:G}),groupEnd:D({},e,{value:S})})}L<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ke=te.ReactCurrentDispatcher,Ae;function Re(e,t,r){{if(Ae===void 0)try{throw Error()}catch(h){var s=h.stack.trim().match(/\n( *(at )?)/);Ae=s&&s[1]||""}return`
18
+ `+Ae+e}}var X=!1,Pe;{var et=typeof WeakMap=="function"?WeakMap:Map;Pe=new et}function Ge(e,t){if(!e||X)return"";{var r=Pe.get(e);if(r!==void 0)return r}var s;X=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var d;d=ke.current,ke.current=null,lt();try{if(t){var l=function(){throw Error()};if(Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(F){s=F}Reflect.construct(e,[],l)}else{try{l.call()}catch(F){s=F}e.call(l.prototype)}}else{try{throw Error()}catch(F){s=F}e()}}catch(F){if(F&&s&&typeof F.stack=="string"){for(var f=F.stack.split(`
19
+ `),C=s.stack.split(`
20
+ `),b=f.length-1,x=C.length-1;b>=1&&x>=0&&f[b]!==C[x];)x--;for(;b>=1&&x>=0;b--,x--)if(f[b]!==C[x]){if(b!==1||x!==1)do if(b--,x--,x<0||f[b]!==C[x]){var N=`
21
+ `+f[b].replace(" at new "," at ");return e.displayName&&N.includes("<anonymous>")&&(N=N.replace("<anonymous>",e.displayName)),typeof e=="function"&&Pe.set(e,N),N}while(b>=1&&x>=0);break}}}finally{X=!1,ke.current=d,I(),Error.prepareStackTrace=h}var Me=e?e.displayName||e.name:"",ge=Me?Re(Me):"";return typeof e=="function"&&Pe.set(e,ge),ge}function tt(e,t,r){return Ge(e,!1)}function Ie(e){var t=e.prototype;return!!(t&&t.isReactComponent)}function pe(e,t,r){if(e==null)return"";if(typeof e=="function")return Ge(e,Ie(e));if(typeof e=="string")return Re(e);switch(e){case K:return Re("Suspense");case w:return Re("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case P:return tt(e.render);case M:return pe(e.type,t,r);case H:{var s=e,h=s._payload,d=s._init;try{return pe(d(h),t,r)}catch{}}}return""}var oe=Object.prototype.hasOwnProperty,ve={},Z=te.ReactDebugCurrentFrame;function se(e){if(e){var t=e._owner,r=pe(e.type,e._source,t?t.type:null);Z.setExtraStackFrame(r)}else Z.setExtraStackFrame(null)}function rt(e,t,r,s,h){{var d=Function.call.bind(oe);for(var l in e)if(d(e,l)){var f=void 0;try{if(typeof e[l]!="function"){var C=Error((s||"React class")+": "+r+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw C.name="Invariant Violation",C}f=e[l](t,l,s,r,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(b){f=b}f&&!(f instanceof Error)&&(se(h),_("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",s||"React class",r,l,typeof f),se(null)),f instanceof Error&&!(f.message in ve)&&(ve[f.message]=!0,se(h),_("Failed %s type: %s",r,f.message),se(null))}}}var Ye=Array.isArray;function Ce(e){return Ye(e)}function nt(e){{var t=typeof Symbol=="function"&&Symbol.toStringTag,r=t&&e[Symbol.toStringTag]||e.constructor.name||"Object";return r}}function _e(e){try{return me(e),!1}catch{return!0}}function me(e){return""+e}function ne(e){if(_e(e))return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",nt(e)),me(e)}var Fe=te.ReactCurrentOwner,ce={key:!0,ref:!0,__self:!0,__source:!0},ze,Q;function Be(e){if(oe.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return e.ref!==void 0}function Ve(e){if(oe.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function De(e,t){typeof e.ref=="string"&&Fe.current}function Ue(e,t){{var r=function(){ze||(ze=!0,_("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};r.isReactWarning=!0,Object.defineProperty(e,"key",{get:r,configurable:!0})}}function Ne(e,t){{var r=function(){Q||(Q=!0,_("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};r.isReactWarning=!0,Object.defineProperty(e,"ref",{get:r,configurable:!0})}}var $e=function(e,t,r,s,h,d,l){var f={$$typeof:T,type:e,key:t,ref:r,props:l,_owner:d};return f._store={},Object.defineProperty(f._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(f,"_self",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.defineProperty(f,"_source",{configurable:!1,enumerable:!1,writable:!1,value:h}),Object.freeze&&(Object.freeze(f.props),Object.freeze(f)),f};function He(e,t,r,s,h){{var d,l={},f=null,C=null;r!==void 0&&(ne(r),f=""+r),Ve(t)&&(ne(t.key),f=""+t.key),Be(t)&&(C=t.ref,De(t,h));for(d in t)oe.call(t,d)&&!ce.hasOwnProperty(d)&&(l[d]=t[d]);if(e&&e.defaultProps){var b=e.defaultProps;for(d in b)l[d]===void 0&&(l[d]=b[d])}if(f||C){var x=typeof e=="function"?e.displayName||e.name||"Unknown":e;f&&Ue(l,x),C&&Ne(l,x)}return $e(e,f,C,h,s,Fe.current,l)}}var n=te.ReactCurrentOwner,a=te.ReactDebugCurrentFrame;function o(e){if(e){var t=e._owner,r=pe(e.type,e._source,t?t.type:null);a.setExtraStackFrame(r)}else a.setExtraStackFrame(null)}var c;c=!1;function i(e){return typeof e=="object"&&e!==null&&e.$$typeof===T}function m(){{if(n.current){var e=g(n.current.type);if(e)return`
22
+
23
+ Check the render method of \``+e+"`."}return""}}function O(e){return""}var v={};function A(e){{var t=m();if(!t){var r=typeof e=="string"?e:e.displayName||e.name;r&&(t=`
24
+
25
+ Check the top-level render call using <`+r+">.")}return t}}function R(e,t){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var r=A(t);if(v[r])return;v[r]=!0;var s="";e&&e._owner&&e._owner!==n.current&&(s=" It was passed a child from "+g(e._owner.type)+"."),o(e),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',r,s),o(null)}}function B(e,t){{if(typeof e!="object")return;if(Ce(e))for(var r=0;r<e.length;r++){var s=e[r];i(s)&&R(s,t)}else if(i(e))e._store&&(e._store.validated=!0);else if(e){var h=ee(e);if(typeof h=="function"&&h!==e.entries)for(var d=h.call(e),l;!(l=d.next()).done;)i(l.value)&&R(l.value,t)}}}function V(e){{var t=e.type;if(t==null||typeof t=="string")return;var r;if(typeof t=="function")r=t.propTypes;else if(typeof t=="object"&&(t.$$typeof===P||t.$$typeof===M))r=t.propTypes;else return;if(r){var s=g(t);rt(r,e.props,"prop",s,e)}else if(t.PropTypes!==void 0&&!c){c=!0;var h=g(t);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",h||"Unknown")}typeof t.getDefaultProps=="function"&&!t.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function le(e){{for(var t=Object.keys(e.props),r=0;r<t.length;r++){var s=t[r];if(s!=="children"&&s!=="key"){o(e),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",s),o(null);break}}e.ref!==null&&(o(e),_("Invalid attribute `ref` supplied to `React.Fragment`."),o(null))}}var j={};function Y(e,t,r,s,h,d){{var l=ct(e);if(!l){var f="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(f+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var C=O();C?f+=C:f+=m();var b;e===null?b="null":Ce(e)?b="array":e!==void 0&&e.$$typeof===T?(b="<"+(g(e.type)||"Unknown")+" />",f=" Did you accidentally export a JSX literal instead of a component?"):b=typeof e,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",b,f)}var x=He(e,t,r,h,d);if(x==null)return x;if(l){var N=t.children;if(N!==void 0)if(s)if(Ce(N)){for(var Me=0;Me<N.length;Me++)B(N[Me],e);Object.freeze&&Object.freeze(N)}else _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else B(N,e)}if(oe.call(t,"key")){var ge=g(e),F=Object.keys(t).filter(function(mt){return mt!=="key"}),at=F.length>0?"{key: someKey, "+F.join(": ..., ")+": ...}":"{key: someKey}";if(!j[ge+at]){var vt=F.length>0?"{"+F.join(": ..., ")+": ...}":"{}";_(`A props object containing a "key" prop is being spread into JSX:
26
+ let props = %s;
27
+ <%s {...props} />
28
+ React keys must be passed directly to JSX without using spread:
29
+ let props = %s;
30
+ <%s key={someKey} {...props} />`,at,ge,vt,ge),j[ge+at]=!0}}return e===y?le(x):V(x),x}}function U(e,t,r){return Y(e,t,r,!0)}function Xe(e,t,r){return Y(e,t,r,!1)}var qe=Xe,Je=U;Se.Fragment=y,Se.jsx=qe,Se.jsxs=Je}()),Se}process.env.NODE_ENV==="production"?Ke.exports=dt():Ke.exports=ht();var st=Ke.exports;const pt=({text:z="AI",particleCount:T=24e3,particleSize:$=.01,primaryColor:y={r:.396,g:.239,b:.82},secondaryColor:k={r:.537,g:.239,b:.82},backgroundColor:be="#000000",transparent:ue=!1,morphDuration:J=2.5,rotationSpeed:P=.4,hoverIntensity:K=.05,lightningIntensity:w=1,lightningColor:M=null,zapSpread:H=.7,zapWidth:fe=.02,cameraDistance:Oe=5.5,globeOpacity:Le=.08,globeColor:ee=null,showGlobe:te=!0,glowEffect:_=!0,className:Ze="",style:Qe={}})=>{const We=q.useRef(null),ye=q.useRef(null);return q.useRef([]),q.useEffect(()=>{const E=We.current;if(!E){console.error("ShapeParticleText: Canvas element not found");return}let de=!0;const xe=[];return(()=>{var $e,He;if(!de)return;const ie=new u.Scene,re=new u.PerspectiveCamera(50,E.offsetWidth/E.offsetHeight,.1,1e3);let g;try{const n={alpha:!0,antialias:!0,powerPreference:"default"},a=E.getContext("webgl2",n)||E.getContext("webgl",n)||E.getContext("experimental-webgl",n);if(!a){console.error("ShapeParticleText: WebGL not supported in this environment");return}const o=(c,i)=>{const m=Object.getOwnPropertyDescriptor(c,i);return m&&!m.writable&&!m.configurable};if(!a.getShaderPrecisionFormat._isPatched){const c=a.getShaderPrecisionFormat,i=function(...m){return{rangeMin:127,rangeMax:127,precision:23}};i._isPatched=!0,Object.defineProperty(a,"getShaderPrecisionFormat",{value:i,configurable:!0})}if(!a.getParameter._isPatched){const c=a.getParameter,i=function(...m){let O=null;try{O=c.apply(a,m)}catch{}const v=m[0];return O??(v===7938?"WebGL 1.0 (Three.js Mock)":v===35724?"WebGL GLSL ES 1.0 (Three.js Mock)":v===7936?"Three.js Mock Vendor":v===7937?"Three.js Mock Renderer":v===34921||v===34930||v===35657||v===35658?16:"")};i._isPatched=!0,Object.defineProperty(a,"getParameter",{value:i,configurable:!0})}if(!a.getExtension._isPatched){const c=a.getExtension,i=function(...m){let O=null;try{O=c.apply(a,m)}catch{}return O===null&&m[0]==="WEBGL_debug_renderer_info"?null:O};i._isPatched=!0,Object.defineProperty(a,"getExtension",{value:i,configurable:!0})}g=new u.WebGLRenderer({canvas:E,context:a,precision:"mediump",...n}),g.capabilities&&(g.capabilities.isWebGL2||(g.capabilities.isWebGL2=!0),g.capabilities.precision||(g.capabilities.precision="mediump"))}catch(n){console.warn("ShapeParticleText: Failed to initialize custom context renderer, attempting hard fallback...",n);try{g=new u.WebGLRenderer({canvas:E})}catch(a){console.error("ShapeParticleText: Fatal error initializing WebGL renderer:",a);return}}g.setSize(E.offsetWidth,E.offsetHeight),g.setPixelRatio(Math.min(window.devicePixelRatio,2)),g.setClearColor(0,0);let D=null;if(te){const n=new u.SphereGeometry(2,48,48);let a;ee?a=typeof ee=="string"?new u.Color(ee):new u.Color(ee.r,ee.g,ee.b):a=new u.Color(y.r,y.g,y.b);const o=new u.MeshBasicMaterial({color:a,wireframe:!0,transparent:!0,opacity:Le});D=new u.Mesh(n,o),ie.add(D)}const L=new u.Group,he=new Float32Array(T*3),W=new Float32Array(T*3),je=new Float32Array(T),we=[],Ee=[],G=[],S=[];let p=0;for(let n=0;n<T;n++){const a=n<T/2?-1:1,o=Math.random()*Math.PI,c=Math.random()*Math.PI*2,i=1.4+Math.random()*.3,m=1.2+Math.random()*.2,O=1+Math.random()*.2;let v=i*Math.sin(o)*Math.cos(c),A=m*Math.sin(o)*Math.sin(c),R=O*Math.cos(o);v=v*.85+a*.35;const B=(Math.sin(o*8)*Math.cos(c*6)+Math.sin(o*12)*Math.sin(c*8))*.12,V=Math.sqrt(v*v+A*A+R*R);V>.1&&(v+=B*(v/V),A+=B*(A/V),R+=B*(R/V));const le=Math.sqrt(v*v+A*A+R*R);if(le<1||le>2||a===-1&&v>-.15||a===1&&v<.15)continue;const j=new u.Vector3(v,A,R);j.x<0?we.push(j.clone()):Ee.push(j.clone()),he[p*3]=j.x,he[p*3+1]=j.y,he[p*3+2]=j.z,G.push(j.x,j.y,j.z);const Y=(A+m)/(m*2);if(Y<.3)W[p*3]=y.r*.5+Y*.4,W[p*3+1]=y.g*1+Y*.05,W[p*3+2]=y.b*1+Y*.05;else if(Y<.6){const U=(Y-.3)/.3;W[p*3]=(y.r*(1-U)+k.r*U)*1.1,W[p*3+1]=(y.g*(1-U)+k.g*U)*1.1,W[p*3+2]=(y.b*(1-U)+k.b*U)*1.1}else W[p*3]=k.r*1,W[p*3+1]=k.g*1,W[p*3+2]=k.b*1;je[p]=Math.random()*1.5+.8,p++}const I=((n,a=1.5)=>{const o=n&&n.trim().length>0?n:"AI",c=document.createElement("canvas"),i=c.getContext("2d");c.width=1024,c.height=512,i.fillStyle="white",i.textAlign="center",i.textBaseline="middle";let m=350;i.font=`bold ${m}px Arial`;const O=c.width*.85;let v=i.measureText(o);for(;(v.width>O||m>c.height*.7)&&m>20;)m-=10,i.font=`bold ${m}px Arial`,v=i.measureText(o);i.fillText(o,c.width/2,c.height/2);const A=i.getImageData(0,0,c.width,c.height),R=[],B=3,V=220;let le=1/0,j=-1/0,Y=1/0,U=-1/0;for(let r=0;r<c.height;r+=B)for(let s=0;s<c.width;s+=B){const h=(Math.floor(r)*c.width+Math.floor(s))*4;if(A.data[h+3]>160){const d=(s-c.width/2)/V*a,l=-(r-c.height/2)/V*a,f=(Math.random()-.5)*.25;R.push({x:d,y:l,z:f}),d<le&&(le=d),d>j&&(j=d),l<Y&&(Y=l),l>U&&(U=l)}}const Xe=j-le,qe=U-Y,Je=3.2,e=2.5;let t=1;return Xe>Je&&(t=Je/Xe),qe*t>e&&(t=e/qe),t<1&&R.forEach(r=>{r.x*=t,r.y*=t,r.z*=t}),R})(z,1.8);if(I.length>0)if(I.length>p){const n=I.length/p;for(let a=0;a<p;a++){const o=Math.floor(a*n),c=I[Math.min(o,I.length-1)];S.push(c.x,c.y,c.z)}}else for(let n=0;n<p;n++)if(n<I.length)S.push(I[n].x,I[n].y,I[n].z);else{const a=I[Math.floor(Math.random()*I.length)];S.push(a.x+(Math.random()-.5)*.5,a.y+(Math.random()-.5)*.5,a.z+(Math.random()-.5)*.3)}else for(let n=0;n<p;n++)S.push(0,0,0);const ke=he.slice(0,p*3),Ae=W.slice(0,p*3),Re=je.slice(0,p),X=new u.BufferGeometry;X.setAttribute("position",new u.BufferAttribute(ke,3)),X.setAttribute("color",new u.BufferAttribute(Ae,3)),X.setAttribute("size",new u.BufferAttribute(Re,1)),X.setDrawRange(0,p);const Pe=new u.PointsMaterial({size:$,vertexColors:!0,transparent:!0,opacity:1,blending:_?u.AdditiveBlending:u.NormalBlending,sizeAttenuation:!0}),et=new u.Points(X,Pe);L.add(et),ie.add(L);const Ge=new u.Color(k.r,k.g,k.b),tt=new u.LineBasicMaterial({color:Ge,transparent:!0,opacity:.2}),Ie=new u.Group,pe=we.length,oe=Ee.length;if(pe>0&&oe>0)for(let n=0;n<80;n++){const a=($e=we[Math.floor(Math.random()*pe)])==null?void 0:$e.clone(),o=(He=Ee[Math.floor(Math.random()*oe)])==null?void 0:He.clone();if(!a||!o)continue;const c=new u.BufferGeometry().setFromPoints([a,o]),i=new u.Line(c,tt);Ie.add(i)}L.add(Ie);const ve=new u.Group;L.add(ve);const Z=[];let se=0;const rt=6,Ye=n=>new u.Vector3((Math.random()-.5)*n,(Math.random()-.5)*n,(Math.random()-.5)*n),Ce=()=>{if(!de||!p)return;const n=Math.floor(Math.random()*p),a=Math.floor(Math.random()*p),o=X.attributes.position.array,c=new u.Vector3(o[n*3],o[n*3+1],o[n*3+2]),i=new u.Vector3(o[a*3],o[a*3+1],o[a*3+2]);if(c.lengthSq()<.1||i.lengthSq()<.1||c.distanceToSquared(i)<.5)return;const m=c.clone().lerp(i,.3).add(Ye(H)),O=c.clone().lerp(i,.7).add(Ye(H)),v=new u.CatmullRomCurve3([c,m,O,i]),A=new u.TubeGeometry(v,12,fe,4,!1);let R;M?M.r!==void 0?R=new u.Color(M.r,M.g,M.b):R=new u.Color(M):R=new u.Color().setHSL(.7+Math.random()*.08,1,.7+Math.random()*.15);const B=new u.MeshBasicMaterial({color:R,transparent:!0,opacity:.85,blending:u.AdditiveBlending}),V=new u.Mesh(A,B);ve.add(V),Z.push({line:V,material:B,life:0,maxLife:.5+Math.random()*.9,flickerSpeed:18+Math.random()*20,phase:Math.random()*Math.PI*2})},nt=new u.Clock;re.position.set(0,0,Oe);const _e={x:0,y:0},me={x:0,y:0},ne={x:0,y:0},Fe=n=>{if(!E)return;const a=E.getBoundingClientRect();_e.x=(n.clientX-a.left)/a.width*2-1,_e.y=-((n.clientY-a.top)/a.height)*2+1,me.y=_e.x*.3*(K/.05),me.x=_e.y*.2*(K/.05)};E.addEventListener("mousemove",Fe),xe.push(()=>{E.removeEventListener("mousemove",Fe)});let ce=0;const ze=.08;let Q=0,Be=1;const Ve=3;let De=Ve;function Ue(){if(!de)return;ye.current=requestAnimationFrame(Ue);const n=nt.getDelta();if(ce+=n,ne.x+=(me.x-ne.x)*.05,ne.y+=(me.y-ne.y)*.05,D&&(D.rotation.y+=n*.1,D.rotation.x=Math.sin(ce*.3)*.03),L.rotation.y=Math.sin(ce*.4)*P+ne.y,L.rotation.x=Math.sin(ce*.25)*ze+ne.x,L.rotation.z=Math.cos(ce*.15)*.015,De-=n,De<=0){Q+=n/J,Q>=1&&(Q=0,Be*=-1,De=Ve);const a=Q<.5?2*Q*Q:1-Math.pow(-2*Q+2,2)/2,o=X.attributes.position;for(let c=0;c<p;c++){const i=c*3;Be===1?(o.array[i]=G[i]+(S[i]-G[i])*a,o.array[i+1]=G[i+1]+(S[i+1]-G[i+1])*a,o.array[i+2]=G[i+2]+(S[i+2]-G[i+2])*a):(o.array[i]=S[i]+(G[i]-S[i])*a,o.array[i+1]=S[i+1]+(G[i+1]-S[i+1])*a,o.array[i+2]=S[i+2]+(G[i+2]-S[i+2])*a)}o.needsUpdate=!0}se-=n,w>0&&se<=0&&Z.length<rt*w&&(Ce(),se=(.12+Math.random()*.25)/Math.max(.1,w));for(let a=Z.length-1;a>=0;a--){const o=Z[a];if(!o||!o.material)continue;o.life+=n;const c=o.life/o.maxLife,i=Math.pow(Math.max(0,1-c),1.5),m=.6+Math.sin(ce*o.flickerSpeed+o.phase)*.4;o.material.opacity=Math.max(0,i*m*Math.min(1,w)),o.life>=o.maxLife&&(ve.remove(o.line),o.line.geometry&&o.line.geometry.dispose(),o.material&&o.material.dispose(),Z.splice(a,1))}g.render(ie,re)}Ue();const Ne=()=>{if(!de||!E)return;const n=E.offsetWidth,a=E.offsetHeight;n===0||a===0||(re.aspect=n/a,re.updateProjectionMatrix(),g.setSize(n,a),g.setPixelRatio(Math.min(window.devicePixelRatio*1.5,3)))};window.addEventListener("resize",Ne),xe.push(()=>{window.removeEventListener("resize",Ne),Z.forEach(n=>{n.line&&(ve.remove(n.line),n.line.geometry&&n.line.geometry.dispose(),n.material&&n.material.dispose())}),Z.length=0,ie.traverse(n=>{n.geometry&&n.geometry.dispose(),n.material&&(Array.isArray(n.material)?n.material.forEach(a=>a.dispose()):n.material.dispose())}),g.dispose()})})(),()=>{de=!1,ye.current&&(cancelAnimationFrame(ye.current),ye.current=null),xe.forEach(ie=>{try{ie()}catch(re){console.error("Cleanup error:",re)}})}},[z,T,$,y,k,J,P,K,w,M,H,fe,Oe,Le,ee,te,_]),st.jsx("div",{className:Ze,style:{position:"relative",width:"100%",height:"100%",backgroundColor:ue?"transparent":be,...Qe},children:st.jsx("canvas",{ref:We,style:{display:"block",width:"100%",height:"100%",outline:"none"}})})};ae.ShapeParticleText=pt,Object.defineProperty(ae,Symbol.toStringTag,{value:"Module"})});
package/package.json ADDED
@@ -0,0 +1,62 @@
1
+ {
2
+ "name": "3d-shape-particle-text",
3
+ "version": "1.0.0",
4
+ "description": "Interactive 3D particle system morphing between brain shape and text, with lightning effects and full customization.",
5
+ "main": "dist/3d-shape-particle-text.umd.js",
6
+ "module": "dist/3d-shape-particle-text.es.js",
7
+ "files": [
8
+ "dist",
9
+ "README.md",
10
+ "LICENSE"
11
+ ],
12
+ "exports": {
13
+ ".": {
14
+ "import": "./dist/3d-shape-particle-text.es.js",
15
+ "require": "./dist/3d-shape-particle-text.umd.js"
16
+ }
17
+ },
18
+ "scripts": {
19
+ "dev": "vite",
20
+ "build": "vite build",
21
+ "preview": "vite preview"
22
+ },
23
+ "keywords": [
24
+ "react",
25
+ "three.js",
26
+ "3d",
27
+ "webgl",
28
+ "ai",
29
+ "brain",
30
+ "neural-network",
31
+ "visualization",
32
+ "landing-page",
33
+ "hero-section",
34
+ "interactive",
35
+ "particles",
36
+ "morph",
37
+ "ui-component",
38
+ "future-tech"
39
+ ],
40
+ "author": "mukes555",
41
+ "license": "MIT",
42
+ "repository": {
43
+ "type": "git",
44
+ "url": "https://github.com/mukes555/3d-shape-particle-text"
45
+ },
46
+ "bugs": {
47
+ "url": "https://github.com/mukes555/3d-shape-particle-text/issues"
48
+ },
49
+ "homepage": "https://github.com/mukes555/3d-shape-particle-text#readme",
50
+ "peerDependencies": {
51
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
52
+ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
53
+ "three": "^0.128.0 || ^0.130.0 || ^0.140.0 || ^0.150.0 || ^0.160.0"
54
+ },
55
+ "devDependencies": {
56
+ "@vitejs/plugin-react": "^4.2.0",
57
+ "react": "^18.2.0",
58
+ "react-dom": "^18.2.0",
59
+ "three": "^0.160.0",
60
+ "vite": "^5.0.0"
61
+ }
62
+ }