@djangocfg/ui-nextjs 2.1.102 → 2.1.104

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.
@@ -1,880 +0,0 @@
1
- 'use strict';
2
-
3
- var react = require('react');
4
- var lib = require('@djangocfg/ui-core/lib');
5
- var jsxRuntime = require('react/jsx-runtime');
6
-
7
- var __defProp = Object.defineProperty;
8
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
9
- var variantMap = {
10
- "gradient-mesh": "mesh-gradient",
11
- "dot-matrix": "geometric-flow",
12
- "grid-lines": "geometric-flow",
13
- "aurora": "aurora-borealis",
14
- "particles": "floating-orbs",
15
- "waves": "liquid-gradient"
16
- };
17
- var AnimatedBackground = /* @__PURE__ */ __name(({
18
- variant = "mesh-gradient",
19
- className,
20
- intensity = "medium",
21
- colorScheme = "vibrant"
22
- }) => {
23
- const resolvedVariant = variantMap[variant] || variant;
24
- const intensityConfig = react.useMemo(() => ({
25
- subtle: { opacity: 0.15, blur: "blur-3xl", scale: 0.8 },
26
- medium: { opacity: 0.25, blur: "blur-2xl", scale: 1 },
27
- strong: { opacity: 0.4, blur: "blur-xl", scale: 1.2 }
28
- })[intensity], [intensity]);
29
- const colors = react.useMemo(() => {
30
- const palettes = {
31
- vibrant: [
32
- "hsl(var(--chart-1))",
33
- // Blue
34
- "hsl(var(--chart-2))",
35
- // Green
36
- "hsl(var(--chart-3))",
37
- // Purple
38
- "hsl(var(--chart-4))",
39
- // Orange
40
- "hsl(var(--chart-5))"
41
- // Red
42
- ],
43
- monochrome: [
44
- "hsl(var(--primary))",
45
- "hsl(var(--primary) / 0.8)",
46
- "hsl(var(--primary) / 0.6)"
47
- ],
48
- cool: [
49
- "hsl(var(--chart-1))",
50
- // Blue
51
- "hsl(var(--chart-3))",
52
- // Purple
53
- "hsl(210 100% 50%)",
54
- // Bright blue
55
- "hsl(260 100% 60%)"
56
- // Violet
57
- ],
58
- warm: [
59
- "hsl(var(--chart-4))",
60
- // Orange
61
- "hsl(var(--chart-5))",
62
- // Red
63
- "hsl(35 100% 55%)",
64
- // Gold
65
- "hsl(350 100% 60%)"
66
- // Rose
67
- ]
68
- };
69
- return palettes[colorScheme];
70
- }, [colorScheme]);
71
- if (resolvedVariant === "none") {
72
- return null;
73
- }
74
- return /* @__PURE__ */ jsxRuntime.jsxs(
75
- "div",
76
- {
77
- className: lib.cn("absolute overflow-hidden pointer-events-none", className),
78
- style: { inset: 0, width: "100%", height: "100%" },
79
- children: [
80
- resolvedVariant === "aurora-borealis" && /* @__PURE__ */ jsxRuntime.jsx(AuroraBorealis, { colors, intensity: intensityConfig }),
81
- resolvedVariant === "mesh-gradient" && /* @__PURE__ */ jsxRuntime.jsx(MeshGradient, { colors, intensity: intensityConfig }),
82
- resolvedVariant === "floating-orbs" && /* @__PURE__ */ jsxRuntime.jsx(FloatingOrbs, { colors, intensity: intensityConfig }),
83
- resolvedVariant === "geometric-flow" && /* @__PURE__ */ jsxRuntime.jsx(GeometricFlow, { colors, intensity: intensityConfig }),
84
- resolvedVariant === "liquid-gradient" && /* @__PURE__ */ jsxRuntime.jsx(LiquidGradient, { colors, intensity: intensityConfig }),
85
- resolvedVariant === "spotlight" && /* @__PURE__ */ jsxRuntime.jsx(Spotlight, { colors, intensity: intensityConfig }),
86
- /* @__PURE__ */ jsxRuntime.jsx(AnimationStyles, {})
87
- ]
88
- }
89
- );
90
- }, "AnimatedBackground");
91
- var AuroraBorealis = /* @__PURE__ */ __name(({ colors, intensity }) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
92
- /* @__PURE__ */ jsxRuntime.jsx(
93
- "div",
94
- {
95
- className: "absolute inset-0",
96
- style: {
97
- background: `linear-gradient(135deg, ${colors[0]} 0%, transparent 50%, ${colors[1]} 100%)`,
98
- opacity: intensity.opacity * 0.3
99
- }
100
- }
101
- ),
102
- /* @__PURE__ */ jsxRuntime.jsx(
103
- "div",
104
- {
105
- className: lib.cn("absolute inset-0", intensity.blur),
106
- style: {
107
- background: `linear-gradient(110deg,
108
- transparent 0%,
109
- ${colors[0]} 20%,
110
- ${colors[2] || colors[0]} 35%,
111
- ${colors[1]} 50%,
112
- ${colors[3] || colors[1]} 65%,
113
- ${colors[0]} 80%,
114
- transparent 100%
115
- )`,
116
- opacity: intensity.opacity,
117
- animation: "aurora-shift 15s ease-in-out infinite",
118
- transform: `translateY(-30%) scaleY(${intensity.scale})`
119
- }
120
- }
121
- ),
122
- /* @__PURE__ */ jsxRuntime.jsx(
123
- "div",
124
- {
125
- className: lib.cn("absolute inset-0", intensity.blur),
126
- style: {
127
- background: `linear-gradient(70deg,
128
- transparent 0%,
129
- ${colors[1]} 25%,
130
- ${colors[2] || colors[0]} 50%,
131
- ${colors[0]} 75%,
132
- transparent 100%
133
- )`,
134
- opacity: intensity.opacity * 0.7,
135
- animation: "aurora-shift 20s ease-in-out infinite reverse",
136
- animationDelay: "-5s",
137
- transform: `translateY(-20%) scaleY(${intensity.scale * 0.8})`
138
- }
139
- }
140
- ),
141
- /* @__PURE__ */ jsxRuntime.jsx(
142
- "div",
143
- {
144
- className: "absolute inset-0",
145
- style: {
146
- background: `radial-gradient(ellipse 100% 50% at 50% 0%,
147
- ${colors[2] || colors[0]} 0%,
148
- transparent 70%
149
- )`,
150
- opacity: intensity.opacity * 0.4,
151
- animation: "aurora-shimmer 8s ease-in-out infinite"
152
- }
153
- }
154
- )
155
- ] }), "AuroraBorealis");
156
- var MeshGradient = /* @__PURE__ */ __name(({ colors, intensity }) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
157
- /* @__PURE__ */ jsxRuntime.jsx(
158
- "div",
159
- {
160
- className: lib.cn("absolute rounded-full", intensity.blur),
161
- style: {
162
- width: "60%",
163
- height: "60%",
164
- top: "-10%",
165
- right: "-10%",
166
- background: `radial-gradient(circle, ${colors[0]} 0%, transparent 70%)`,
167
- opacity: intensity.opacity,
168
- animation: "mesh-float-1 25s ease-in-out infinite",
169
- transform: `scale(${intensity.scale})`
170
- }
171
- }
172
- ),
173
- /* @__PURE__ */ jsxRuntime.jsx(
174
- "div",
175
- {
176
- className: lib.cn("absolute rounded-full", intensity.blur),
177
- style: {
178
- width: "50%",
179
- height: "50%",
180
- bottom: "-5%",
181
- left: "-5%",
182
- background: `radial-gradient(circle, ${colors[1]} 0%, transparent 70%)`,
183
- opacity: intensity.opacity,
184
- animation: "mesh-float-2 30s ease-in-out infinite",
185
- transform: `scale(${intensity.scale})`
186
- }
187
- }
188
- ),
189
- /* @__PURE__ */ jsxRuntime.jsx(
190
- "div",
191
- {
192
- className: lib.cn("absolute rounded-full", intensity.blur),
193
- style: {
194
- width: "40%",
195
- height: "40%",
196
- top: "30%",
197
- left: "25%",
198
- background: `radial-gradient(circle, ${colors[2] || colors[0]} 0%, transparent 70%)`,
199
- opacity: intensity.opacity * 0.8,
200
- animation: "mesh-float-3 20s ease-in-out infinite",
201
- transform: `scale(${intensity.scale})`
202
- }
203
- }
204
- ),
205
- colors[3] && /* @__PURE__ */ jsxRuntime.jsx(
206
- "div",
207
- {
208
- className: lib.cn("absolute rounded-full", intensity.blur),
209
- style: {
210
- width: "35%",
211
- height: "35%",
212
- bottom: "20%",
213
- right: "15%",
214
- background: `radial-gradient(circle, ${colors[3]} 0%, transparent 70%)`,
215
- opacity: intensity.opacity * 0.6,
216
- animation: "mesh-float-4 22s ease-in-out infinite",
217
- transform: `scale(${intensity.scale})`
218
- }
219
- }
220
- )
221
- ] }), "MeshGradient");
222
- var FloatingOrbs = /* @__PURE__ */ __name(({ colors, intensity }) => {
223
- const orbs = react.useMemo(() => {
224
- return Array.from({ length: 12 }).map((_, i) => ({
225
- id: i,
226
- size: 60 + i % 4 * 40,
227
- x: i * 23 % 100,
228
- y: i * 31 % 100,
229
- color: colors[i % colors.length],
230
- duration: 15 + i % 5 * 5,
231
- delay: i * 1.5
232
- }));
233
- }, [colors]);
234
- return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: orbs.map((orb) => /* @__PURE__ */ jsxRuntime.jsx(
235
- "div",
236
- {
237
- className: lib.cn("absolute rounded-full", intensity.blur),
238
- style: {
239
- width: `${orb.size * intensity.scale}px`,
240
- height: `${orb.size * intensity.scale}px`,
241
- left: `${orb.x}%`,
242
- top: `${orb.y}%`,
243
- background: `radial-gradient(circle at 30% 30%, ${orb.color}, transparent 70%)`,
244
- opacity: intensity.opacity * (0.5 + orb.id % 3 * 0.2),
245
- animation: `orb-float-${orb.id % 4 + 1} ${orb.duration}s ease-in-out infinite`,
246
- animationDelay: `${orb.delay}s`
247
- }
248
- },
249
- orb.id
250
- )) });
251
- }, "FloatingOrbs");
252
- var GeometricFlow = /* @__PURE__ */ __name(({ colors, intensity }) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
253
- /* @__PURE__ */ jsxRuntime.jsx(
254
- "div",
255
- {
256
- className: "absolute inset-0",
257
- style: {
258
- background: `linear-gradient(135deg,
259
- ${colors[0]} 0%,
260
- transparent 30%,
261
- transparent 70%,
262
- ${colors[1]} 100%
263
- )`,
264
- opacity: intensity.opacity * 0.3
265
- }
266
- }
267
- ),
268
- /* @__PURE__ */ jsxRuntime.jsx(
269
- "div",
270
- {
271
- className: "absolute inset-0",
272
- style: {
273
- backgroundImage: `
274
- linear-gradient(${colors[0]}20 1px, transparent 1px),
275
- linear-gradient(90deg, ${colors[0]}20 1px, transparent 1px)
276
- `,
277
- backgroundSize: "60px 60px",
278
- animation: "grid-drift 30s linear infinite",
279
- opacity: intensity.opacity
280
- }
281
- }
282
- ),
283
- /* @__PURE__ */ jsxRuntime.jsx(
284
- "div",
285
- {
286
- className: "absolute inset-0",
287
- style: {
288
- backgroundImage: `repeating-linear-gradient(
289
- 45deg,
290
- transparent,
291
- transparent 80px,
292
- ${colors[2] || colors[0]}10 80px,
293
- ${colors[2] || colors[0]}10 82px
294
- )`,
295
- animation: "diagonal-shift 20s linear infinite",
296
- opacity: intensity.opacity
297
- }
298
- }
299
- ),
300
- /* @__PURE__ */ jsxRuntime.jsx(
301
- "div",
302
- {
303
- className: lib.cn("absolute rounded-full", intensity.blur),
304
- style: {
305
- width: "40%",
306
- height: "40%",
307
- top: "20%",
308
- left: "50%",
309
- transform: "translateX(-50%)",
310
- background: `radial-gradient(circle, ${colors[0]} 0%, transparent 70%)`,
311
- opacity: intensity.opacity * 0.5,
312
- animation: "pulse-glow 8s ease-in-out infinite"
313
- }
314
- }
315
- )
316
- ] }), "GeometricFlow");
317
- var LiquidGradient = /* @__PURE__ */ __name(({ colors, intensity }) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
318
- /* @__PURE__ */ jsxRuntime.jsx(
319
- "div",
320
- {
321
- className: "absolute inset-0",
322
- style: {
323
- background: `linear-gradient(180deg,
324
- transparent 0%,
325
- ${colors[0]}15 30%,
326
- ${colors[1]}20 50%,
327
- ${colors[2] || colors[0]}15 70%,
328
- transparent 100%
329
- )`,
330
- opacity: intensity.opacity
331
- }
332
- }
333
- ),
334
- /* @__PURE__ */ jsxRuntime.jsx(
335
- "div",
336
- {
337
- className: lib.cn("absolute", intensity.blur),
338
- style: {
339
- width: "120%",
340
- height: "50%",
341
- bottom: "-10%",
342
- left: "-10%",
343
- background: `linear-gradient(90deg,
344
- ${colors[0]} 0%,
345
- ${colors[1]} 33%,
346
- ${colors[2] || colors[0]} 66%,
347
- ${colors[0]} 100%
348
- )`,
349
- opacity: intensity.opacity,
350
- borderRadius: "50% 50% 0 0",
351
- animation: "liquid-flow-1 12s ease-in-out infinite",
352
- transform: `scaleY(${intensity.scale})`
353
- }
354
- }
355
- ),
356
- /* @__PURE__ */ jsxRuntime.jsx(
357
- "div",
358
- {
359
- className: lib.cn("absolute", intensity.blur),
360
- style: {
361
- width: "100%",
362
- height: "40%",
363
- bottom: "-5%",
364
- left: "0",
365
- background: `linear-gradient(90deg,
366
- ${colors[1]} 0%,
367
- ${colors[2] || colors[0]} 50%,
368
- ${colors[3] || colors[1]} 100%
369
- )`,
370
- opacity: intensity.opacity * 0.8,
371
- borderRadius: "60% 40% 0 0",
372
- animation: "liquid-flow-2 15s ease-in-out infinite",
373
- transform: `scaleY(${intensity.scale * 0.9})`
374
- }
375
- }
376
- ),
377
- Array.from({ length: 6 }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsx(
378
- "div",
379
- {
380
- className: "absolute rounded-full",
381
- style: {
382
- width: `${12 + i * 4}px`,
383
- height: `${12 + i * 4}px`,
384
- left: `${15 + i * 15}%`,
385
- bottom: "10%",
386
- background: `radial-gradient(circle at 30% 30%,
387
- ${colors[i % colors.length]}80,
388
- ${colors[i % colors.length]}20
389
- )`,
390
- border: `1px solid ${colors[i % colors.length]}40`,
391
- opacity: intensity.opacity,
392
- animation: `bubble-float ${8 + i * 2}s ease-in-out infinite`,
393
- animationDelay: `${i * 2}s`
394
- }
395
- },
396
- i
397
- ))
398
- ] }), "LiquidGradient");
399
- var Spotlight = /* @__PURE__ */ __name(({ colors, intensity }) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
400
- /* @__PURE__ */ jsxRuntime.jsx(
401
- "div",
402
- {
403
- className: lib.cn("absolute", intensity.blur),
404
- style: {
405
- width: "80%",
406
- height: "80%",
407
- top: "-20%",
408
- left: "50%",
409
- transform: "translateX(-50%)",
410
- background: `conic-gradient(from 180deg at 50% 50%,
411
- ${colors[0]} 0deg,
412
- ${colors[1]} 60deg,
413
- ${colors[2] || colors[0]} 120deg,
414
- ${colors[3] || colors[1]} 180deg,
415
- ${colors[0]} 240deg,
416
- ${colors[1]} 300deg,
417
- ${colors[0]} 360deg
418
- )`,
419
- opacity: intensity.opacity,
420
- animation: "spotlight-rotate 30s linear infinite"
421
- }
422
- }
423
- ),
424
- /* @__PURE__ */ jsxRuntime.jsx(
425
- "div",
426
- {
427
- className: "absolute inset-0",
428
- style: {
429
- background: `radial-gradient(circle at 50% 30%,
430
- transparent 0%,
431
- hsl(var(--background)) 70%
432
- )`
433
- }
434
- }
435
- ),
436
- /* @__PURE__ */ jsxRuntime.jsx(
437
- "div",
438
- {
439
- className: lib.cn("absolute rounded-full", intensity.blur),
440
- style: {
441
- width: "50%",
442
- height: "50%",
443
- top: "10%",
444
- left: "25%",
445
- background: `radial-gradient(circle, ${colors[0]} 0%, transparent 70%)`,
446
- opacity: intensity.opacity * 0.5,
447
- animation: "pulse-glow 6s ease-in-out infinite"
448
- }
449
- }
450
- )
451
- ] }), "Spotlight");
452
- var AnimationStyles = /* @__PURE__ */ __name(() => /* @__PURE__ */ jsxRuntime.jsx("style", { children: `
453
- @keyframes aurora-shift {
454
- 0%, 100% {
455
- transform: translateX(-10%) translateY(-30%) scaleX(1.1);
456
- }
457
- 50% {
458
- transform: translateX(10%) translateY(-25%) scaleX(0.9);
459
- }
460
- }
461
-
462
- @keyframes aurora-shimmer {
463
- 0%, 100% {
464
- opacity: 0.2;
465
- transform: scale(1);
466
- }
467
- 50% {
468
- opacity: 0.4;
469
- transform: scale(1.05);
470
- }
471
- }
472
-
473
- @keyframes mesh-float-1 {
474
- 0%, 100% { transform: translate(0, 0) scale(1); }
475
- 25% { transform: translate(-5%, 10%) scale(1.05); }
476
- 50% { transform: translate(5%, 5%) scale(0.95); }
477
- 75% { transform: translate(-3%, -5%) scale(1.02); }
478
- }
479
-
480
- @keyframes mesh-float-2 {
481
- 0%, 100% { transform: translate(0, 0) scale(1); }
482
- 33% { transform: translate(8%, -8%) scale(1.08); }
483
- 66% { transform: translate(-6%, 6%) scale(0.92); }
484
- }
485
-
486
- @keyframes mesh-float-3 {
487
- 0%, 100% { transform: translate(0, 0) scale(1); }
488
- 50% { transform: translate(10%, 10%) scale(1.1); }
489
- }
490
-
491
- @keyframes mesh-float-4 {
492
- 0%, 100% { transform: translate(0, 0) scale(1); }
493
- 25% { transform: translate(5%, -10%) scale(0.95); }
494
- 75% { transform: translate(-8%, 5%) scale(1.05); }
495
- }
496
-
497
- @keyframes orb-float-1 {
498
- 0%, 100% { transform: translate(0, 0); }
499
- 50% { transform: translate(30px, -40px); }
500
- }
501
-
502
- @keyframes orb-float-2 {
503
- 0%, 100% { transform: translate(0, 0); }
504
- 50% { transform: translate(-25px, 35px); }
505
- }
506
-
507
- @keyframes orb-float-3 {
508
- 0%, 100% { transform: translate(0, 0); }
509
- 33% { transform: translate(40px, 20px); }
510
- 66% { transform: translate(-20px, -30px); }
511
- }
512
-
513
- @keyframes orb-float-4 {
514
- 0%, 100% { transform: translate(0, 0); }
515
- 25% { transform: translate(-35px, -25px); }
516
- 75% { transform: translate(25px, 40px); }
517
- }
518
-
519
- @keyframes grid-drift {
520
- 0% { transform: translate(0, 0); }
521
- 100% { transform: translate(60px, 60px); }
522
- }
523
-
524
- @keyframes diagonal-shift {
525
- 0% { transform: translateX(0); }
526
- 100% { transform: translateX(160px); }
527
- }
528
-
529
- @keyframes pulse-glow {
530
- 0%, 100% { opacity: 0.3; transform: translateX(-50%) scale(1); }
531
- 50% { opacity: 0.6; transform: translateX(-50%) scale(1.1); }
532
- }
533
-
534
- @keyframes liquid-flow-1 {
535
- 0%, 100% {
536
- transform: translateY(0) scaleX(1);
537
- border-radius: 50% 50% 0 0;
538
- }
539
- 25% {
540
- transform: translateY(-30px) scaleX(1.05);
541
- border-radius: 45% 55% 0 0;
542
- }
543
- 50% {
544
- transform: translateY(-50px) scaleX(0.95);
545
- border-radius: 55% 45% 0 0;
546
- }
547
- 75% {
548
- transform: translateY(-25px) scaleX(1.02);
549
- border-radius: 48% 52% 0 0;
550
- }
551
- }
552
-
553
- @keyframes liquid-flow-2 {
554
- 0%, 100% {
555
- transform: translateY(0) scaleX(1);
556
- border-radius: 60% 40% 0 0;
557
- }
558
- 33% {
559
- transform: translateY(-40px) scaleX(1.08);
560
- border-radius: 40% 60% 0 0;
561
- }
562
- 66% {
563
- transform: translateY(-60px) scaleX(0.92);
564
- border-radius: 55% 45% 0 0;
565
- }
566
- }
567
-
568
- @keyframes bubble-float {
569
- 0%, 100% {
570
- transform: translateY(0) scale(1);
571
- opacity: 0.6;
572
- }
573
- 50% {
574
- transform: translateY(-100px) scale(1.2);
575
- opacity: 0.3;
576
- }
577
- }
578
-
579
- @keyframes spotlight-rotate {
580
- 0% { transform: translateX(-50%) rotate(0deg); }
581
- 100% { transform: translateX(-50%) rotate(360deg); }
582
- }
583
- ` }), "AnimationStyles");
584
- var blurMap = {
585
- sm: "blur-sm",
586
- md: "blur-md",
587
- lg: "blur-lg",
588
- xl: "blur-xl",
589
- "2xl": "blur-2xl",
590
- "3xl": "blur-3xl"
591
- };
592
- var MouseFollower = /* @__PURE__ */ __name(({
593
- variant = "glow",
594
- size = 300,
595
- color = "primary",
596
- smoothness = 0.1,
597
- opacity = 0.3,
598
- blur = "2xl",
599
- className,
600
- showOnMobile = false,
601
- disabled = false
602
- }) => {
603
- const [mounted, setMounted] = react.useState(false);
604
- const [isVisible, setIsVisible] = react.useState(false);
605
- const [isMobile, setIsMobile] = react.useState(false);
606
- const positionRef = react.useRef({ x: 0, y: 0 });
607
- const targetRef = react.useRef({ x: 0, y: 0 });
608
- const elementRef = react.useRef(null);
609
- const rafRef = react.useRef(0);
610
- const resolvedColor = react.useMemo(() => {
611
- if (color === "primary") return "hsl(var(--primary))";
612
- if (color === "secondary") return "hsl(var(--secondary))";
613
- if (color === "accent") return "hsl(var(--accent))";
614
- return color;
615
- }, [color]);
616
- react.useEffect(() => {
617
- setMounted(true);
618
- const checkMobile = /* @__PURE__ */ __name(() => {
619
- setIsMobile("ontouchstart" in window || navigator.maxTouchPoints > 0);
620
- }, "checkMobile");
621
- checkMobile();
622
- window.addEventListener("resize", checkMobile);
623
- return () => window.removeEventListener("resize", checkMobile);
624
- }, []);
625
- const animate = react.useCallback(() => {
626
- const dx = targetRef.current.x - positionRef.current.x;
627
- const dy = targetRef.current.y - positionRef.current.y;
628
- positionRef.current.x += dx * smoothness;
629
- positionRef.current.y += dy * smoothness;
630
- if (elementRef.current) {
631
- elementRef.current.style.transform = `translate(${positionRef.current.x - size / 2}px, ${positionRef.current.y - size / 2}px)`;
632
- }
633
- rafRef.current = requestAnimationFrame(animate);
634
- }, [smoothness, size]);
635
- react.useEffect(() => {
636
- if (disabled || !mounted) return;
637
- if (isMobile && !showOnMobile) return;
638
- const handleMouseMove = /* @__PURE__ */ __name((e) => {
639
- targetRef.current = { x: e.clientX, y: e.clientY };
640
- if (!isVisible) setIsVisible(true);
641
- }, "handleMouseMove");
642
- const handleMouseLeave = /* @__PURE__ */ __name(() => {
643
- setIsVisible(false);
644
- }, "handleMouseLeave");
645
- const handleMouseEnter = /* @__PURE__ */ __name(() => {
646
- setIsVisible(true);
647
- }, "handleMouseEnter");
648
- document.addEventListener("mousemove", handleMouseMove);
649
- document.addEventListener("mouseleave", handleMouseLeave);
650
- document.addEventListener("mouseenter", handleMouseEnter);
651
- rafRef.current = requestAnimationFrame(animate);
652
- return () => {
653
- document.removeEventListener("mousemove", handleMouseMove);
654
- document.removeEventListener("mouseleave", handleMouseLeave);
655
- document.removeEventListener("mouseenter", handleMouseEnter);
656
- cancelAnimationFrame(rafRef.current);
657
- };
658
- }, [disabled, mounted, isMobile, showOnMobile, animate, isVisible]);
659
- if (!mounted || disabled) return null;
660
- if (isMobile && !showOnMobile) return null;
661
- return /* @__PURE__ */ jsxRuntime.jsx(
662
- "div",
663
- {
664
- className: lib.cn(
665
- "fixed inset-0 pointer-events-none overflow-hidden z-0",
666
- className
667
- ),
668
- children: /* @__PURE__ */ jsxRuntime.jsxs(
669
- "div",
670
- {
671
- ref: elementRef,
672
- className: lib.cn(
673
- "absolute top-0 left-0 transition-opacity duration-300",
674
- isVisible ? "opacity-100" : "opacity-0"
675
- ),
676
- style: { width: size, height: size },
677
- children: [
678
- variant === "glow" && /* @__PURE__ */ jsxRuntime.jsx(
679
- GlowEffect,
680
- {
681
- size,
682
- color: resolvedColor,
683
- opacity,
684
- blur: blurMap[blur]
685
- }
686
- ),
687
- variant === "spotlight" && /* @__PURE__ */ jsxRuntime.jsx(
688
- SpotlightEffect,
689
- {
690
- size,
691
- color: resolvedColor,
692
- opacity,
693
- blur: blurMap[blur]
694
- }
695
- ),
696
- variant === "gradient-blob" && /* @__PURE__ */ jsxRuntime.jsx(
697
- GradientBlobEffect,
698
- {
699
- size,
700
- color: resolvedColor,
701
- opacity,
702
- blur: blurMap[blur]
703
- }
704
- ),
705
- variant === "ring" && /* @__PURE__ */ jsxRuntime.jsx(
706
- RingEffect,
707
- {
708
- size,
709
- color: resolvedColor,
710
- opacity
711
- }
712
- ),
713
- variant === "trail" && /* @__PURE__ */ jsxRuntime.jsx(
714
- TrailEffect,
715
- {
716
- size,
717
- color: resolvedColor,
718
- opacity,
719
- blur: blurMap[blur]
720
- }
721
- )
722
- ]
723
- }
724
- )
725
- }
726
- );
727
- }, "MouseFollower");
728
- var GlowEffect = /* @__PURE__ */ __name(({ size, color, opacity, blur }) => /* @__PURE__ */ jsxRuntime.jsx(
729
- "div",
730
- {
731
- className: lib.cn("w-full h-full rounded-full", blur),
732
- style: {
733
- background: `radial-gradient(circle, ${color} 0%, transparent 70%)`,
734
- opacity
735
- }
736
- }
737
- ), "GlowEffect");
738
- var SpotlightEffect = /* @__PURE__ */ __name(({ size, color, opacity, blur }) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
739
- /* @__PURE__ */ jsxRuntime.jsx(
740
- "div",
741
- {
742
- className: lib.cn("absolute inset-0", blur),
743
- style: {
744
- background: `conic-gradient(from 180deg at 50% 50%,
745
- transparent 0deg,
746
- ${color} 150deg,
747
- ${color} 210deg,
748
- transparent 360deg
749
- )`,
750
- opacity: opacity * 0.6
751
- }
752
- }
753
- ),
754
- /* @__PURE__ */ jsxRuntime.jsx(
755
- "div",
756
- {
757
- className: lib.cn("absolute rounded-full", blur),
758
- style: {
759
- width: "40%",
760
- height: "40%",
761
- top: "30%",
762
- left: "30%",
763
- background: `radial-gradient(circle, ${color} 0%, transparent 70%)`,
764
- opacity
765
- }
766
- }
767
- )
768
- ] }), "SpotlightEffect");
769
- var GradientBlobEffect = /* @__PURE__ */ __name(({ size, color, opacity, blur }) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
770
- /* @__PURE__ */ jsxRuntime.jsx(
771
- "div",
772
- {
773
- className: lib.cn("w-full h-full", blur),
774
- style: {
775
- background: `radial-gradient(ellipse 60% 40% at 50% 50%, ${color} 0%, transparent 70%)`,
776
- opacity,
777
- animation: "blob-morph 8s ease-in-out infinite"
778
- }
779
- }
780
- ),
781
- /* @__PURE__ */ jsxRuntime.jsx(
782
- "div",
783
- {
784
- className: lib.cn("absolute inset-0", blur),
785
- style: {
786
- background: `radial-gradient(ellipse 40% 60% at 50% 50%, ${color} 0%, transparent 60%)`,
787
- opacity: opacity * 0.5,
788
- animation: "blob-morph 8s ease-in-out infinite reverse",
789
- animationDelay: "-4s"
790
- }
791
- }
792
- ),
793
- /* @__PURE__ */ jsxRuntime.jsx("style", { children: `
794
- @keyframes blob-morph {
795
- 0%, 100% { transform: scale(1) rotate(0deg); border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
796
- 25% { transform: scale(1.1) rotate(90deg); border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
797
- 50% { transform: scale(0.9) rotate(180deg); border-radius: 50% 60% 30% 60% / 30% 60% 70% 40%; }
798
- 75% { transform: scale(1.05) rotate(270deg); border-radius: 60% 40% 50% 40% / 70% 30% 50% 60%; }
799
- }
800
- ` })
801
- ] }), "GradientBlobEffect");
802
- var RingEffect = /* @__PURE__ */ __name(({ size, color, opacity }) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
803
- /* @__PURE__ */ jsxRuntime.jsx(
804
- "div",
805
- {
806
- className: "absolute inset-0 rounded-full",
807
- style: {
808
- border: `2px solid ${color}`,
809
- opacity: opacity * 0.3
810
- }
811
- }
812
- ),
813
- /* @__PURE__ */ jsxRuntime.jsx(
814
- "div",
815
- {
816
- className: "absolute rounded-full",
817
- style: {
818
- inset: "15%",
819
- border: `2px solid ${color}`,
820
- opacity: opacity * 0.5,
821
- animation: "ring-pulse 2s ease-in-out infinite"
822
- }
823
- }
824
- ),
825
- /* @__PURE__ */ jsxRuntime.jsx(
826
- "div",
827
- {
828
- className: "absolute rounded-full",
829
- style: {
830
- inset: "30%",
831
- border: `2px solid ${color}`,
832
- opacity: opacity * 0.7,
833
- animation: "ring-pulse 2s ease-in-out infinite",
834
- animationDelay: "-1s"
835
- }
836
- }
837
- ),
838
- /* @__PURE__ */ jsxRuntime.jsx(
839
- "div",
840
- {
841
- className: "absolute rounded-full",
842
- style: {
843
- width: "8px",
844
- height: "8px",
845
- top: "50%",
846
- left: "50%",
847
- transform: "translate(-50%, -50%)",
848
- background: color,
849
- opacity
850
- }
851
- }
852
- ),
853
- /* @__PURE__ */ jsxRuntime.jsx("style", { children: `
854
- @keyframes ring-pulse {
855
- 0%, 100% { opacity: 0.3; transform: scale(1); }
856
- 50% { opacity: 0.7; transform: scale(1.05); }
857
- }
858
- ` })
859
- ] }), "RingEffect");
860
- var TrailEffect = /* @__PURE__ */ __name(({ size, color, opacity, blur }) => /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsx(
861
- "div",
862
- {
863
- className: lib.cn("absolute rounded-full", blur),
864
- style: {
865
- width: `${100 - i * 15}%`,
866
- height: `${100 - i * 15}%`,
867
- top: `${i * 7.5}%`,
868
- left: `${i * 7.5}%`,
869
- background: `radial-gradient(circle, ${color} 0%, transparent 70%)`,
870
- opacity: opacity * (1 - i * 0.15),
871
- transition: `transform ${0.1 + i * 0.05}s ease-out`
872
- }
873
- },
874
- i
875
- )) }), "TrailEffect");
876
-
877
- exports.AnimatedBackground = AnimatedBackground;
878
- exports.MouseFollower = MouseFollower;
879
- //# sourceMappingURL=animations.cjs.map
880
- //# sourceMappingURL=animations.cjs.map