@igorao79/uivix 0.1.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/dist/index.d.mts +606 -0
- package/dist/index.d.ts +606 -0
- package/dist/index.js +3668 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +3587 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +49 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,3668 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/index.ts
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
|
+
AuroraBackground: () => AuroraBackground,
|
|
34
|
+
Avatar: () => Avatar,
|
|
35
|
+
Badge: () => Badge,
|
|
36
|
+
BeamsBackground: () => BeamsBackground,
|
|
37
|
+
BlurText: () => BlurText,
|
|
38
|
+
BokehBackground: () => BokehBackground,
|
|
39
|
+
Button: () => Button,
|
|
40
|
+
Card: () => Card,
|
|
41
|
+
CardContent: () => CardContent,
|
|
42
|
+
CardDescription: () => CardDescription,
|
|
43
|
+
CardFooter: () => CardFooter,
|
|
44
|
+
CardHeader: () => CardHeader,
|
|
45
|
+
CardTitle: () => CardTitle,
|
|
46
|
+
CounterText: () => CounterText,
|
|
47
|
+
DotPatternBackground: () => DotPatternBackground,
|
|
48
|
+
GlitchText: () => GlitchText,
|
|
49
|
+
GradientMeshBackground: () => GradientMeshBackground,
|
|
50
|
+
GradientText: () => GradientText,
|
|
51
|
+
GridBackground: () => GridBackground,
|
|
52
|
+
HighlightText: () => HighlightText,
|
|
53
|
+
Input: () => Input,
|
|
54
|
+
Label: () => Label,
|
|
55
|
+
Marquee: () => Marquee,
|
|
56
|
+
MatrixRainBackground: () => MatrixRainBackground,
|
|
57
|
+
MediaText: () => MediaText,
|
|
58
|
+
MeteorBackground: () => MeteorBackground,
|
|
59
|
+
OTPInput: () => OTPInput,
|
|
60
|
+
ParticleBackground: () => ParticleBackground,
|
|
61
|
+
PasswordInput: () => PasswordInput,
|
|
62
|
+
PixelBackground: () => PixelBackground,
|
|
63
|
+
Progress: () => Progress,
|
|
64
|
+
RetroGridBackground: () => RetroGridBackground,
|
|
65
|
+
RippleBackground: () => RippleBackground,
|
|
66
|
+
SearchInput: () => SearchInput,
|
|
67
|
+
Separator: () => Separator,
|
|
68
|
+
ShimmerText: () => ShimmerText,
|
|
69
|
+
Skeleton: () => Skeleton,
|
|
70
|
+
SparklesText: () => SparklesText,
|
|
71
|
+
StarfieldBackground: () => StarfieldBackground,
|
|
72
|
+
Toggle: () => Toggle,
|
|
73
|
+
Tooltip: () => Tooltip,
|
|
74
|
+
TypewriterText: () => TypewriterText,
|
|
75
|
+
WaveBackground: () => WaveBackground,
|
|
76
|
+
WaveText: () => WaveText,
|
|
77
|
+
cn: () => cn
|
|
78
|
+
});
|
|
79
|
+
module.exports = __toCommonJS(index_exports);
|
|
80
|
+
|
|
81
|
+
// src/components/Button/Button.tsx
|
|
82
|
+
var import_react = __toESM(require("react"));
|
|
83
|
+
|
|
84
|
+
// src/utils/cn.ts
|
|
85
|
+
var import_clsx = require("clsx");
|
|
86
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
87
|
+
function cn(...inputs) {
|
|
88
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// src/components/Button/Button.tsx
|
|
92
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
93
|
+
var variantStyles = {
|
|
94
|
+
default: "bg-zinc-900 text-white hover:bg-zinc-800 dark:bg-white dark:text-zinc-900 dark:hover:bg-zinc-200",
|
|
95
|
+
secondary: "bg-zinc-100 text-zinc-900 hover:bg-zinc-200 dark:bg-zinc-800 dark:text-zinc-100 dark:hover:bg-zinc-700",
|
|
96
|
+
outline: "border border-zinc-300 bg-transparent text-zinc-900 hover:bg-zinc-100 dark:border-zinc-700 dark:text-zinc-100 dark:hover:bg-zinc-800",
|
|
97
|
+
ghost: "bg-transparent text-zinc-900 hover:bg-zinc-100 dark:text-zinc-100 dark:hover:bg-zinc-800",
|
|
98
|
+
destructive: "bg-red-600 text-white hover:bg-red-700 dark:bg-red-700 dark:hover:bg-red-800",
|
|
99
|
+
link: "bg-transparent text-zinc-900 underline-offset-4 hover:underline dark:text-zinc-100 p-0 h-auto",
|
|
100
|
+
gradient: "bg-gradient-to-r from-violet-600 to-indigo-600 text-white hover:from-violet-700 hover:to-indigo-700 shadow-md hover:shadow-lg",
|
|
101
|
+
glow: "bg-violet-600 text-white hover:bg-violet-700 shadow-[0_0_15px_rgba(139,92,246,0.4)] hover:shadow-[0_0_25px_rgba(139,92,246,0.6)] dark:shadow-[0_0_15px_rgba(167,139,250,0.4)] dark:hover:shadow-[0_0_25px_rgba(167,139,250,0.6)]",
|
|
102
|
+
soft: "bg-violet-100 text-violet-700 hover:bg-violet-200 dark:bg-violet-900/30 dark:text-violet-300 dark:hover:bg-violet-900/50"
|
|
103
|
+
};
|
|
104
|
+
var sizeStyles = {
|
|
105
|
+
sm: "h-8 px-3 text-xs gap-1.5",
|
|
106
|
+
md: "h-10 px-4 text-sm gap-2",
|
|
107
|
+
lg: "h-12 px-6 text-base gap-2.5",
|
|
108
|
+
icon: "h-10 w-10"
|
|
109
|
+
};
|
|
110
|
+
var Spinner = ({ className }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
111
|
+
"svg",
|
|
112
|
+
{
|
|
113
|
+
className: cn("animate-spin", className),
|
|
114
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
115
|
+
fill: "none",
|
|
116
|
+
viewBox: "0 0 24 24",
|
|
117
|
+
children: [
|
|
118
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
119
|
+
"circle",
|
|
120
|
+
{
|
|
121
|
+
className: "opacity-25",
|
|
122
|
+
cx: "12",
|
|
123
|
+
cy: "12",
|
|
124
|
+
r: "10",
|
|
125
|
+
stroke: "currentColor",
|
|
126
|
+
strokeWidth: "4"
|
|
127
|
+
}
|
|
128
|
+
),
|
|
129
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
130
|
+
"path",
|
|
131
|
+
{
|
|
132
|
+
className: "opacity-75",
|
|
133
|
+
fill: "currentColor",
|
|
134
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
135
|
+
}
|
|
136
|
+
)
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
);
|
|
140
|
+
var Button = import_react.default.forwardRef(
|
|
141
|
+
({
|
|
142
|
+
className,
|
|
143
|
+
variant = "default",
|
|
144
|
+
size = "md",
|
|
145
|
+
pill = false,
|
|
146
|
+
loading = false,
|
|
147
|
+
leftIcon,
|
|
148
|
+
rightIcon,
|
|
149
|
+
disabled,
|
|
150
|
+
children,
|
|
151
|
+
...props
|
|
152
|
+
}, ref) => {
|
|
153
|
+
const spinnerSize = size === "sm" ? "h-3 w-3" : size === "lg" ? "h-5 w-5" : "h-4 w-4";
|
|
154
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
155
|
+
"button",
|
|
156
|
+
{
|
|
157
|
+
ref,
|
|
158
|
+
disabled: disabled || loading,
|
|
159
|
+
className: cn(
|
|
160
|
+
"inline-flex items-center justify-center font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
161
|
+
variantStyles[variant],
|
|
162
|
+
sizeStyles[size],
|
|
163
|
+
pill ? "rounded-full" : "rounded-md",
|
|
164
|
+
className
|
|
165
|
+
),
|
|
166
|
+
...props,
|
|
167
|
+
children: [
|
|
168
|
+
loading && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Spinner, { className: spinnerSize }),
|
|
169
|
+
!loading && leftIcon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "shrink-0", children: leftIcon }),
|
|
170
|
+
children,
|
|
171
|
+
!loading && rightIcon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "shrink-0", children: rightIcon })
|
|
172
|
+
]
|
|
173
|
+
}
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
);
|
|
177
|
+
Button.displayName = "Button";
|
|
178
|
+
|
|
179
|
+
// src/components/Input/Input.tsx
|
|
180
|
+
var import_react2 = __toESM(require("react"));
|
|
181
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
182
|
+
var variantStyles2 = {
|
|
183
|
+
default: "border border-zinc-300 bg-transparent dark:border-zinc-700 dark:bg-transparent",
|
|
184
|
+
filled: "border border-transparent bg-zinc-100 dark:bg-zinc-800",
|
|
185
|
+
underline: "border-b border-zinc-300 bg-transparent rounded-none px-0 dark:border-zinc-700",
|
|
186
|
+
floating: "peer border border-zinc-300 bg-transparent dark:border-zinc-700 dark:bg-transparent",
|
|
187
|
+
ghost: "border border-transparent bg-transparent hover:bg-zinc-100 dark:hover:bg-zinc-800 focus-visible:bg-zinc-100 dark:focus-visible:bg-zinc-800",
|
|
188
|
+
glow: "border border-zinc-300 bg-transparent dark:border-zinc-700 dark:bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0 focus-visible:border-violet-500 focus-visible:shadow-[0_0_10px_rgba(139,92,246,0.5),0_0_20px_rgba(139,92,246,0.2)] dark:focus-visible:border-violet-400 dark:focus-visible:shadow-[0_0_10px_rgba(167,139,250,0.5),0_0_20px_rgba(167,139,250,0.2)]"
|
|
189
|
+
};
|
|
190
|
+
var sizeStyles2 = {
|
|
191
|
+
sm: "h-8 px-2 text-xs",
|
|
192
|
+
md: "h-10 px-3 text-sm",
|
|
193
|
+
lg: "h-12 px-4 text-base"
|
|
194
|
+
};
|
|
195
|
+
var iconSizeStyles = {
|
|
196
|
+
sm: { left: "left-2", right: "right-2", inputLeft: "pl-7", inputRight: "pr-7" },
|
|
197
|
+
md: { left: "left-3", right: "right-3", inputLeft: "pl-9", inputRight: "pr-9" },
|
|
198
|
+
lg: { left: "left-4", right: "right-4", inputLeft: "pl-11", inputRight: "pr-11" }
|
|
199
|
+
};
|
|
200
|
+
var floatingSizeStyles = {
|
|
201
|
+
sm: {
|
|
202
|
+
input: "h-10 pt-4 pb-1 px-3 text-xs",
|
|
203
|
+
label: "text-xs left-3",
|
|
204
|
+
floated: "top-1 text-[10px]",
|
|
205
|
+
resting: "top-1/2 -translate-y-1/2 text-xs"
|
|
206
|
+
},
|
|
207
|
+
md: {
|
|
208
|
+
input: "h-12 pt-5 pb-2 px-3 text-sm",
|
|
209
|
+
label: "text-sm left-3",
|
|
210
|
+
floated: "top-1.5 text-[11px]",
|
|
211
|
+
resting: "top-1/2 -translate-y-1/2 text-sm"
|
|
212
|
+
},
|
|
213
|
+
lg: {
|
|
214
|
+
input: "h-14 pt-6 pb-2 px-4 text-base",
|
|
215
|
+
label: "text-base left-4",
|
|
216
|
+
floated: "top-2 text-xs",
|
|
217
|
+
resting: "top-1/2 -translate-y-1/2 text-base"
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
var Input = import_react2.default.forwardRef(
|
|
221
|
+
({
|
|
222
|
+
className,
|
|
223
|
+
variant = "default",
|
|
224
|
+
inputSize = "md",
|
|
225
|
+
error,
|
|
226
|
+
label,
|
|
227
|
+
labelClassName,
|
|
228
|
+
wrapperClassName,
|
|
229
|
+
leftIcon,
|
|
230
|
+
rightIcon,
|
|
231
|
+
id,
|
|
232
|
+
onChange,
|
|
233
|
+
onFocus,
|
|
234
|
+
onBlur,
|
|
235
|
+
defaultValue,
|
|
236
|
+
value: controlledValue,
|
|
237
|
+
...props
|
|
238
|
+
}, ref) => {
|
|
239
|
+
if (variant === "floating") {
|
|
240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
241
|
+
FloatingInputInternal,
|
|
242
|
+
{
|
|
243
|
+
ref,
|
|
244
|
+
className,
|
|
245
|
+
inputSize,
|
|
246
|
+
error,
|
|
247
|
+
label: label || "",
|
|
248
|
+
labelClassName,
|
|
249
|
+
wrapperClassName,
|
|
250
|
+
id,
|
|
251
|
+
onChange,
|
|
252
|
+
onFocus,
|
|
253
|
+
onBlur,
|
|
254
|
+
defaultValue,
|
|
255
|
+
value: controlledValue,
|
|
256
|
+
...props
|
|
257
|
+
}
|
|
258
|
+
);
|
|
259
|
+
}
|
|
260
|
+
if (leftIcon || rightIcon) {
|
|
261
|
+
const iconSizes = iconSizeStyles[inputSize];
|
|
262
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: cn("relative w-full", wrapperClassName), children: [
|
|
263
|
+
leftIcon && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: cn("pointer-events-none absolute top-1/2 -translate-y-1/2 text-zinc-400 dark:text-zinc-500", iconSizes.left), children: leftIcon }),
|
|
264
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
265
|
+
"input",
|
|
266
|
+
{
|
|
267
|
+
ref,
|
|
268
|
+
id,
|
|
269
|
+
className: cn(
|
|
270
|
+
"w-full rounded-md text-zinc-900 placeholder:text-zinc-400 transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 dark:text-zinc-100 dark:placeholder:text-zinc-500",
|
|
271
|
+
variantStyles2[variant],
|
|
272
|
+
sizeStyles2[inputSize],
|
|
273
|
+
leftIcon && iconSizes.inputLeft,
|
|
274
|
+
rightIcon && iconSizes.inputRight,
|
|
275
|
+
error && "border-red-500 focus-visible:ring-red-500 dark:border-red-500",
|
|
276
|
+
className
|
|
277
|
+
),
|
|
278
|
+
onChange,
|
|
279
|
+
onFocus,
|
|
280
|
+
onBlur,
|
|
281
|
+
defaultValue,
|
|
282
|
+
value: controlledValue,
|
|
283
|
+
...props
|
|
284
|
+
}
|
|
285
|
+
),
|
|
286
|
+
rightIcon && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: cn("pointer-events-none absolute top-1/2 -translate-y-1/2 text-zinc-400 dark:text-zinc-500", iconSizes.right), children: rightIcon })
|
|
287
|
+
] });
|
|
288
|
+
}
|
|
289
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
290
|
+
"input",
|
|
291
|
+
{
|
|
292
|
+
ref,
|
|
293
|
+
id,
|
|
294
|
+
className: cn(
|
|
295
|
+
"w-full rounded-md text-zinc-900 placeholder:text-zinc-400 transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 dark:text-zinc-100 dark:placeholder:text-zinc-500",
|
|
296
|
+
variantStyles2[variant],
|
|
297
|
+
sizeStyles2[inputSize],
|
|
298
|
+
error && "border-red-500 focus-visible:ring-red-500 dark:border-red-500",
|
|
299
|
+
className
|
|
300
|
+
),
|
|
301
|
+
onChange,
|
|
302
|
+
onFocus,
|
|
303
|
+
onBlur,
|
|
304
|
+
defaultValue,
|
|
305
|
+
value: controlledValue,
|
|
306
|
+
...props
|
|
307
|
+
}
|
|
308
|
+
);
|
|
309
|
+
}
|
|
310
|
+
);
|
|
311
|
+
Input.displayName = "Input";
|
|
312
|
+
var FloatingInputInternal = import_react2.default.forwardRef(
|
|
313
|
+
({
|
|
314
|
+
className,
|
|
315
|
+
inputSize,
|
|
316
|
+
error,
|
|
317
|
+
label,
|
|
318
|
+
labelClassName,
|
|
319
|
+
wrapperClassName,
|
|
320
|
+
id,
|
|
321
|
+
onChange,
|
|
322
|
+
onFocus,
|
|
323
|
+
onBlur,
|
|
324
|
+
defaultValue,
|
|
325
|
+
value: controlledValue,
|
|
326
|
+
...props
|
|
327
|
+
}, ref) => {
|
|
328
|
+
const generatedId = (0, import_react2.useId)();
|
|
329
|
+
const inputId = id || generatedId;
|
|
330
|
+
const [focused, setFocused] = (0, import_react2.useState)(false);
|
|
331
|
+
const [internalValue, setInternalValue] = (0, import_react2.useState)((defaultValue == null ? void 0 : defaultValue.toString()) || "");
|
|
332
|
+
const value = controlledValue !== void 0 ? controlledValue.toString() : internalValue;
|
|
333
|
+
const isFloated = focused || value.length > 0;
|
|
334
|
+
const sizes = floatingSizeStyles[inputSize];
|
|
335
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: cn("relative w-full", wrapperClassName), children: [
|
|
336
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
337
|
+
"input",
|
|
338
|
+
{
|
|
339
|
+
ref,
|
|
340
|
+
id: inputId,
|
|
341
|
+
className: cn(
|
|
342
|
+
"peer w-full rounded-md border border-zinc-300 bg-transparent text-zinc-900 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 dark:border-zinc-700 dark:bg-transparent dark:text-zinc-100",
|
|
343
|
+
sizes.input,
|
|
344
|
+
error && "border-red-500 focus-visible:ring-red-500 dark:border-red-500",
|
|
345
|
+
className
|
|
346
|
+
),
|
|
347
|
+
value: controlledValue !== void 0 ? controlledValue : void 0,
|
|
348
|
+
defaultValue: controlledValue !== void 0 ? void 0 : defaultValue,
|
|
349
|
+
onChange: (e) => {
|
|
350
|
+
if (controlledValue === void 0) setInternalValue(e.target.value);
|
|
351
|
+
onChange == null ? void 0 : onChange(e);
|
|
352
|
+
},
|
|
353
|
+
onFocus: (e) => {
|
|
354
|
+
setFocused(true);
|
|
355
|
+
onFocus == null ? void 0 : onFocus(e);
|
|
356
|
+
},
|
|
357
|
+
onBlur: (e) => {
|
|
358
|
+
setFocused(false);
|
|
359
|
+
onBlur == null ? void 0 : onBlur(e);
|
|
360
|
+
},
|
|
361
|
+
placeholder: " ",
|
|
362
|
+
...props
|
|
363
|
+
}
|
|
364
|
+
),
|
|
365
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
366
|
+
"label",
|
|
367
|
+
{
|
|
368
|
+
htmlFor: inputId,
|
|
369
|
+
className: cn(
|
|
370
|
+
"pointer-events-none absolute transition-all duration-200 ease-out",
|
|
371
|
+
sizes.label,
|
|
372
|
+
isFloated ? cn(sizes.floated, focused ? error ? "text-red-500" : "text-zinc-500 dark:text-zinc-400" : "text-zinc-400 dark:text-zinc-500") : cn(sizes.resting, "text-zinc-400 dark:text-zinc-500"),
|
|
373
|
+
labelClassName
|
|
374
|
+
),
|
|
375
|
+
children: label
|
|
376
|
+
}
|
|
377
|
+
)
|
|
378
|
+
] });
|
|
379
|
+
}
|
|
380
|
+
);
|
|
381
|
+
FloatingInputInternal.displayName = "FloatingInputInternal";
|
|
382
|
+
|
|
383
|
+
// src/components/Input/PasswordInput.tsx
|
|
384
|
+
var import_react3 = __toESM(require("react"));
|
|
385
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
386
|
+
var sizeStyles3 = {
|
|
387
|
+
sm: { input: "h-8 px-2 pr-8 text-xs", btn: "right-1.5 h-5 w-5" },
|
|
388
|
+
md: { input: "h-10 px-3 pr-10 text-sm", btn: "right-2.5 h-5 w-5" },
|
|
389
|
+
lg: { input: "h-12 px-4 pr-12 text-base", btn: "right-3.5 h-6 w-6" }
|
|
390
|
+
};
|
|
391
|
+
var EyeIcon = () => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "h-full w-full", children: [
|
|
392
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0" }),
|
|
393
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("circle", { cx: "12", cy: "12", r: "3" })
|
|
394
|
+
] });
|
|
395
|
+
var EyeOffIcon = () => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "h-full w-full", children: [
|
|
396
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49" }),
|
|
397
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M14.084 14.158a3 3 0 0 1-4.242-4.242" }),
|
|
398
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143" }),
|
|
399
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "m2 2 20 20" })
|
|
400
|
+
] });
|
|
401
|
+
var PasswordInput = import_react3.default.forwardRef(
|
|
402
|
+
({ className, inputSize = "md", error, wrapperClassName, ...props }, ref) => {
|
|
403
|
+
const [visible, setVisible] = (0, import_react3.useState)(false);
|
|
404
|
+
const sizes = sizeStyles3[inputSize];
|
|
405
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: cn("relative w-full", wrapperClassName), children: [
|
|
406
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
407
|
+
"input",
|
|
408
|
+
{
|
|
409
|
+
ref,
|
|
410
|
+
type: visible ? "text" : "password",
|
|
411
|
+
className: cn(
|
|
412
|
+
"w-full rounded-md border border-zinc-300 bg-transparent text-zinc-900 placeholder:text-zinc-400 transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 dark:border-zinc-700 dark:bg-transparent dark:text-zinc-100 dark:placeholder:text-zinc-500",
|
|
413
|
+
sizes.input,
|
|
414
|
+
error && "border-red-500 focus-visible:ring-red-500 dark:border-red-500",
|
|
415
|
+
className
|
|
416
|
+
),
|
|
417
|
+
...props
|
|
418
|
+
}
|
|
419
|
+
),
|
|
420
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
421
|
+
"button",
|
|
422
|
+
{
|
|
423
|
+
type: "button",
|
|
424
|
+
tabIndex: -1,
|
|
425
|
+
onClick: () => setVisible((v) => !v),
|
|
426
|
+
className: cn(
|
|
427
|
+
"absolute top-1/2 -translate-y-1/2 text-zinc-400 hover:text-zinc-600 dark:text-zinc-500 dark:hover:text-zinc-300 transition-colors",
|
|
428
|
+
sizes.btn
|
|
429
|
+
),
|
|
430
|
+
"aria-label": visible ? "Hide password" : "Show password",
|
|
431
|
+
children: visible ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(EyeOffIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(EyeIcon, {})
|
|
432
|
+
}
|
|
433
|
+
)
|
|
434
|
+
] });
|
|
435
|
+
}
|
|
436
|
+
);
|
|
437
|
+
PasswordInput.displayName = "PasswordInput";
|
|
438
|
+
|
|
439
|
+
// src/components/Input/SearchInput.tsx
|
|
440
|
+
var import_react4 = __toESM(require("react"));
|
|
441
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
442
|
+
var sizeStyles4 = {
|
|
443
|
+
sm: { input: "h-8 pl-7 pr-7 text-xs", iconL: "left-2 h-3.5 w-3.5", iconR: "right-1.5 h-3.5 w-3.5" },
|
|
444
|
+
md: { input: "h-10 pl-9 pr-9 text-sm", iconL: "left-3 h-4 w-4", iconR: "right-2.5 h-4 w-4" },
|
|
445
|
+
lg: { input: "h-12 pl-11 pr-11 text-base", iconL: "left-4 h-5 w-5", iconR: "right-3.5 h-5 w-5" }
|
|
446
|
+
};
|
|
447
|
+
var SearchIcon = ({ className }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className, children: [
|
|
448
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("circle", { cx: "11", cy: "11", r: "8" }),
|
|
449
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "m21 21-4.3-4.3" })
|
|
450
|
+
] });
|
|
451
|
+
var XIcon = ({ className }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className, children: [
|
|
452
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M18 6 6 18" }),
|
|
453
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "m6 6 12 12" })
|
|
454
|
+
] });
|
|
455
|
+
var SearchInput = import_react4.default.forwardRef(
|
|
456
|
+
({ className, inputSize = "md", onClear, wrapperClassName, onChange, value: controlledValue, defaultValue, ...props }, ref) => {
|
|
457
|
+
const [internalValue, setInternalValue] = (0, import_react4.useState)((defaultValue == null ? void 0 : defaultValue.toString()) || "");
|
|
458
|
+
const value = controlledValue !== void 0 ? controlledValue.toString() : internalValue;
|
|
459
|
+
const sizes = sizeStyles4[inputSize];
|
|
460
|
+
const handleChange = (e) => {
|
|
461
|
+
if (controlledValue === void 0) setInternalValue(e.target.value);
|
|
462
|
+
onChange == null ? void 0 : onChange(e);
|
|
463
|
+
};
|
|
464
|
+
const handleClear = () => {
|
|
465
|
+
if (controlledValue === void 0) setInternalValue("");
|
|
466
|
+
onClear == null ? void 0 : onClear();
|
|
467
|
+
};
|
|
468
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: cn("relative w-full", wrapperClassName), children: [
|
|
469
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: cn("pointer-events-none absolute top-1/2 -translate-y-1/2 text-zinc-400 dark:text-zinc-500", sizes.iconL), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SearchIcon, { className: "h-full w-full" }) }),
|
|
470
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
471
|
+
"input",
|
|
472
|
+
{
|
|
473
|
+
ref,
|
|
474
|
+
type: "search",
|
|
475
|
+
className: cn(
|
|
476
|
+
"w-full rounded-md border border-zinc-300 bg-transparent text-zinc-900 placeholder:text-zinc-400 transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 dark:border-zinc-700 dark:bg-transparent dark:text-zinc-100 dark:placeholder:text-zinc-500 [&::-webkit-search-cancel-button]:hidden",
|
|
477
|
+
sizes.input,
|
|
478
|
+
className
|
|
479
|
+
),
|
|
480
|
+
value: controlledValue !== void 0 ? controlledValue : void 0,
|
|
481
|
+
defaultValue: controlledValue !== void 0 ? void 0 : defaultValue,
|
|
482
|
+
onChange: handleChange,
|
|
483
|
+
...props
|
|
484
|
+
}
|
|
485
|
+
),
|
|
486
|
+
value.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
487
|
+
"button",
|
|
488
|
+
{
|
|
489
|
+
type: "button",
|
|
490
|
+
tabIndex: -1,
|
|
491
|
+
onClick: handleClear,
|
|
492
|
+
className: cn(
|
|
493
|
+
"absolute top-1/2 -translate-y-1/2 text-zinc-400 hover:text-zinc-600 dark:text-zinc-500 dark:hover:text-zinc-300 transition-colors",
|
|
494
|
+
sizes.iconR
|
|
495
|
+
),
|
|
496
|
+
"aria-label": "Clear search",
|
|
497
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(XIcon, { className: "h-full w-full" })
|
|
498
|
+
}
|
|
499
|
+
)
|
|
500
|
+
] });
|
|
501
|
+
}
|
|
502
|
+
);
|
|
503
|
+
SearchInput.displayName = "SearchInput";
|
|
504
|
+
|
|
505
|
+
// src/components/Input/OTPInput.tsx
|
|
506
|
+
var import_react5 = __toESM(require("react"));
|
|
507
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
508
|
+
var sizeStyles5 = {
|
|
509
|
+
sm: "h-8 w-8 text-sm",
|
|
510
|
+
md: "h-10 w-10 text-lg",
|
|
511
|
+
lg: "h-12 w-12 text-xl"
|
|
512
|
+
};
|
|
513
|
+
var OTPInput = ({
|
|
514
|
+
length = 6,
|
|
515
|
+
onComplete,
|
|
516
|
+
onChange,
|
|
517
|
+
inputSize = "md",
|
|
518
|
+
error = false,
|
|
519
|
+
disabled = false,
|
|
520
|
+
className,
|
|
521
|
+
wrapperClassName,
|
|
522
|
+
separatorAfter
|
|
523
|
+
}) => {
|
|
524
|
+
const [values, setValues] = (0, import_react5.useState)(Array(length).fill(""));
|
|
525
|
+
const inputRefs = (0, import_react5.useRef)([]);
|
|
526
|
+
const focusInput = (0, import_react5.useCallback)((index) => {
|
|
527
|
+
var _a;
|
|
528
|
+
if (index >= 0 && index < length) {
|
|
529
|
+
(_a = inputRefs.current[index]) == null ? void 0 : _a.focus();
|
|
530
|
+
}
|
|
531
|
+
}, [length]);
|
|
532
|
+
const updateValues = (0, import_react5.useCallback)(
|
|
533
|
+
(newValues) => {
|
|
534
|
+
setValues(newValues);
|
|
535
|
+
const otp = newValues.join("");
|
|
536
|
+
onChange == null ? void 0 : onChange(otp);
|
|
537
|
+
if (otp.length === length && newValues.every((v) => v !== "")) {
|
|
538
|
+
onComplete == null ? void 0 : onComplete(otp);
|
|
539
|
+
}
|
|
540
|
+
},
|
|
541
|
+
[length, onChange, onComplete]
|
|
542
|
+
);
|
|
543
|
+
const handleChange = (index, e) => {
|
|
544
|
+
const val = e.target.value;
|
|
545
|
+
if (!/^\d*$/.test(val)) return;
|
|
546
|
+
const digit = val.slice(-1);
|
|
547
|
+
const newValues = [...values];
|
|
548
|
+
newValues[index] = digit;
|
|
549
|
+
updateValues(newValues);
|
|
550
|
+
if (digit && index < length - 1) {
|
|
551
|
+
focusInput(index + 1);
|
|
552
|
+
}
|
|
553
|
+
};
|
|
554
|
+
const handleKeyDown = (index, e) => {
|
|
555
|
+
if (e.key === "Backspace") {
|
|
556
|
+
e.preventDefault();
|
|
557
|
+
const newValues = [...values];
|
|
558
|
+
if (values[index]) {
|
|
559
|
+
newValues[index] = "";
|
|
560
|
+
updateValues(newValues);
|
|
561
|
+
} else if (index > 0) {
|
|
562
|
+
newValues[index - 1] = "";
|
|
563
|
+
updateValues(newValues);
|
|
564
|
+
focusInput(index - 1);
|
|
565
|
+
}
|
|
566
|
+
} else if (e.key === "ArrowLeft") {
|
|
567
|
+
focusInput(index - 1);
|
|
568
|
+
} else if (e.key === "ArrowRight") {
|
|
569
|
+
focusInput(index + 1);
|
|
570
|
+
}
|
|
571
|
+
};
|
|
572
|
+
const handlePaste = (e) => {
|
|
573
|
+
e.preventDefault();
|
|
574
|
+
const pasted = e.clipboardData.getData("text").replace(/\D/g, "").slice(0, length);
|
|
575
|
+
if (!pasted) return;
|
|
576
|
+
const newValues = [...values];
|
|
577
|
+
for (let i = 0; i < pasted.length; i++) {
|
|
578
|
+
newValues[i] = pasted[i];
|
|
579
|
+
}
|
|
580
|
+
updateValues(newValues);
|
|
581
|
+
focusInput(Math.min(pasted.length, length - 1));
|
|
582
|
+
};
|
|
583
|
+
const separatorSet = new Set(separatorAfter || []);
|
|
584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: cn("flex items-center gap-2", wrapperClassName), children: values.map((val, i) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react5.default.Fragment, { children: [
|
|
585
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
586
|
+
"input",
|
|
587
|
+
{
|
|
588
|
+
ref: (el) => {
|
|
589
|
+
inputRefs.current[i] = el;
|
|
590
|
+
},
|
|
591
|
+
type: "text",
|
|
592
|
+
inputMode: "numeric",
|
|
593
|
+
autoComplete: "one-time-code",
|
|
594
|
+
maxLength: 1,
|
|
595
|
+
value: val,
|
|
596
|
+
disabled,
|
|
597
|
+
onChange: (e) => handleChange(i, e),
|
|
598
|
+
onKeyDown: (e) => handleKeyDown(i, e),
|
|
599
|
+
onPaste: i === 0 ? handlePaste : void 0,
|
|
600
|
+
onFocus: (e) => e.target.select(),
|
|
601
|
+
className: cn(
|
|
602
|
+
"rounded-md border border-zinc-300 bg-transparent text-center font-mono text-zinc-900 transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 dark:border-zinc-700 dark:bg-transparent dark:text-zinc-100",
|
|
603
|
+
sizeStyles5[inputSize],
|
|
604
|
+
error && "border-red-500 focus-visible:ring-red-500 dark:border-red-500",
|
|
605
|
+
className
|
|
606
|
+
),
|
|
607
|
+
"aria-label": `Digit ${i + 1}`
|
|
608
|
+
}
|
|
609
|
+
),
|
|
610
|
+
separatorSet.has(i) && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "text-zinc-400 dark:text-zinc-500 text-lg font-bold select-none", children: "-" })
|
|
611
|
+
] }, i)) });
|
|
612
|
+
};
|
|
613
|
+
OTPInput.displayName = "OTPInput";
|
|
614
|
+
|
|
615
|
+
// src/components/Label/Label.tsx
|
|
616
|
+
var import_react6 = __toESM(require("react"));
|
|
617
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
618
|
+
var sizeStyles6 = {
|
|
619
|
+
sm: "text-xs",
|
|
620
|
+
md: "text-sm",
|
|
621
|
+
lg: "text-base"
|
|
622
|
+
};
|
|
623
|
+
var Label = import_react6.default.forwardRef(
|
|
624
|
+
({ className, size = "md", required, children, ...props }, ref) => {
|
|
625
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
626
|
+
"label",
|
|
627
|
+
{
|
|
628
|
+
ref,
|
|
629
|
+
className: cn(
|
|
630
|
+
"font-medium text-zinc-900 dark:text-zinc-100 leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
631
|
+
sizeStyles6[size],
|
|
632
|
+
className
|
|
633
|
+
),
|
|
634
|
+
...props,
|
|
635
|
+
children: [
|
|
636
|
+
children,
|
|
637
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "ml-1 text-red-500", children: "*" })
|
|
638
|
+
]
|
|
639
|
+
}
|
|
640
|
+
);
|
|
641
|
+
}
|
|
642
|
+
);
|
|
643
|
+
Label.displayName = "Label";
|
|
644
|
+
|
|
645
|
+
// src/components/Text/TypewriterText.tsx
|
|
646
|
+
var import_react7 = require("react");
|
|
647
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
648
|
+
var TypewriterText = ({
|
|
649
|
+
words,
|
|
650
|
+
typeSpeed = 80,
|
|
651
|
+
deleteSpeed = 50,
|
|
652
|
+
pauseDuration = 1500,
|
|
653
|
+
loop = true,
|
|
654
|
+
cursor = true,
|
|
655
|
+
cursorChar = "|",
|
|
656
|
+
className,
|
|
657
|
+
cursorClassName,
|
|
658
|
+
as: Tag = "span"
|
|
659
|
+
}) => {
|
|
660
|
+
const [text, setText] = (0, import_react7.useState)("");
|
|
661
|
+
const [wordIndex, setWordIndex] = (0, import_react7.useState)(0);
|
|
662
|
+
const [isDeleting, setIsDeleting] = (0, import_react7.useState)(false);
|
|
663
|
+
const longestWord = (0, import_react7.useMemo)(
|
|
664
|
+
() => words.reduce((a, b) => a.length >= b.length ? a : b, ""),
|
|
665
|
+
[words]
|
|
666
|
+
);
|
|
667
|
+
const tick = (0, import_react7.useCallback)(() => {
|
|
668
|
+
const currentWord = words[wordIndex] || "";
|
|
669
|
+
if (isDeleting) {
|
|
670
|
+
setText(currentWord.substring(0, text.length - 1));
|
|
671
|
+
} else {
|
|
672
|
+
setText(currentWord.substring(0, text.length + 1));
|
|
673
|
+
}
|
|
674
|
+
}, [text, wordIndex, isDeleting, words]);
|
|
675
|
+
(0, import_react7.useEffect)(() => {
|
|
676
|
+
const currentWord = words[wordIndex] || "";
|
|
677
|
+
if (!isDeleting && text === currentWord) {
|
|
678
|
+
if (!loop && wordIndex === words.length - 1) return;
|
|
679
|
+
const timeout2 = setTimeout(() => setIsDeleting(true), pauseDuration);
|
|
680
|
+
return () => clearTimeout(timeout2);
|
|
681
|
+
}
|
|
682
|
+
if (isDeleting && text === "") {
|
|
683
|
+
setIsDeleting(false);
|
|
684
|
+
setWordIndex((prev) => (prev + 1) % words.length);
|
|
685
|
+
return;
|
|
686
|
+
}
|
|
687
|
+
const speed = isDeleting ? deleteSpeed : typeSpeed;
|
|
688
|
+
const timeout = setTimeout(tick, speed);
|
|
689
|
+
return () => clearTimeout(timeout);
|
|
690
|
+
}, [text, isDeleting, wordIndex, words, typeSpeed, deleteSpeed, pauseDuration, loop, tick]);
|
|
691
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Tag, { className: cn("inline-grid", className), children: [
|
|
692
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "invisible col-start-1 row-start-1 whitespace-pre", "aria-hidden": "true", children: longestWord }),
|
|
693
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "col-start-1 row-start-1 whitespace-pre", children: [
|
|
694
|
+
text,
|
|
695
|
+
cursor && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
696
|
+
"span",
|
|
697
|
+
{
|
|
698
|
+
className: cn(
|
|
699
|
+
"inline-block w-[2px] h-[1em] align-middle ml-0.5 animate-[uixy-blink_1s_step-end_infinite] bg-current",
|
|
700
|
+
cursorClassName
|
|
701
|
+
)
|
|
702
|
+
}
|
|
703
|
+
)
|
|
704
|
+
] }),
|
|
705
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("style", { children: `
|
|
706
|
+
@keyframes uixy-blink {
|
|
707
|
+
0%, 100% { opacity: 1; }
|
|
708
|
+
50% { opacity: 0; }
|
|
709
|
+
}
|
|
710
|
+
` })
|
|
711
|
+
] });
|
|
712
|
+
};
|
|
713
|
+
TypewriterText.displayName = "TypewriterText";
|
|
714
|
+
|
|
715
|
+
// src/components/Text/GradientText.tsx
|
|
716
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
717
|
+
var GradientText = ({
|
|
718
|
+
children,
|
|
719
|
+
animate = true,
|
|
720
|
+
speed = 3,
|
|
721
|
+
colors = "from-violet-500 via-pink-500 to-indigo-500",
|
|
722
|
+
as: Tag = "span",
|
|
723
|
+
className
|
|
724
|
+
}) => {
|
|
725
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
726
|
+
Tag,
|
|
727
|
+
{
|
|
728
|
+
className: cn(
|
|
729
|
+
"inline-block bg-clip-text text-transparent bg-gradient-to-r",
|
|
730
|
+
colors,
|
|
731
|
+
animate && "bg-[length:200%_auto]",
|
|
732
|
+
className
|
|
733
|
+
),
|
|
734
|
+
style: animate ? {
|
|
735
|
+
animation: `uixy-gradient ${speed}s linear infinite`
|
|
736
|
+
} : void 0,
|
|
737
|
+
children: [
|
|
738
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("style", { children: `
|
|
739
|
+
@keyframes uixy-gradient {
|
|
740
|
+
0% { background-position: 0% center; }
|
|
741
|
+
100% { background-position: 200% center; }
|
|
742
|
+
}
|
|
743
|
+
` }),
|
|
744
|
+
children
|
|
745
|
+
]
|
|
746
|
+
}
|
|
747
|
+
);
|
|
748
|
+
};
|
|
749
|
+
GradientText.displayName = "GradientText";
|
|
750
|
+
|
|
751
|
+
// src/components/Text/GlitchText.tsx
|
|
752
|
+
var import_react8 = require("react");
|
|
753
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
754
|
+
var glitchCounter = 0;
|
|
755
|
+
var GlitchText = ({
|
|
756
|
+
children,
|
|
757
|
+
speed = 3,
|
|
758
|
+
intensity = 5,
|
|
759
|
+
as: Tag = "span",
|
|
760
|
+
className
|
|
761
|
+
}) => {
|
|
762
|
+
const wrapperRef = (0, import_react8.useRef)(null);
|
|
763
|
+
const idRef = (0, import_react8.useRef)(`uixy-g-${++glitchCounter}`);
|
|
764
|
+
const id = idRef.current;
|
|
765
|
+
const offset = Math.max(1, Math.min(intensity, 10));
|
|
766
|
+
(0, import_react8.useEffect)(() => {
|
|
767
|
+
const styleEl = document.createElement("style");
|
|
768
|
+
styleEl.textContent = `
|
|
769
|
+
.${id} { position: relative; display: inline-block; }
|
|
770
|
+
.${id}::before, .${id}::after {
|
|
771
|
+
content: "${children.replace(/"/g, '\\"')}";
|
|
772
|
+
position: absolute; inset: 0; opacity: 0.8;
|
|
773
|
+
}
|
|
774
|
+
.${id}::before {
|
|
775
|
+
color: #0ff; z-index: -1;
|
|
776
|
+
animation: ${id}-a ${speed}s infinite;
|
|
777
|
+
}
|
|
778
|
+
.${id}::after {
|
|
779
|
+
color: #f0f; z-index: -1;
|
|
780
|
+
animation: ${id}-b ${speed}s infinite;
|
|
781
|
+
}
|
|
782
|
+
@keyframes ${id}-a {
|
|
783
|
+
0%, 15%, 40%, 46%, 80%, 86%, 100% { transform: translate(0); clip-path: inset(0 0 100% 0); }
|
|
784
|
+
5% { transform: translate(${offset}px, 0); clip-path: inset(10% 0 70% 0); }
|
|
785
|
+
10% { transform: translate(-${offset}px, 0); clip-path: inset(50% 0 10% 0); }
|
|
786
|
+
42% { transform: translate(${offset * 0.6}px, 0); clip-path: inset(20% 0 50% 0); }
|
|
787
|
+
44% { transform: translate(-${offset * 0.8}px, 0); clip-path: inset(60% 0 5% 0); }
|
|
788
|
+
82% { transform: translate(-${offset * 0.5}px, 0); clip-path: inset(5% 0 80% 0); }
|
|
789
|
+
84% { transform: translate(${offset}px, 0); clip-path: inset(40% 0 20% 0); }
|
|
790
|
+
}
|
|
791
|
+
@keyframes ${id}-b {
|
|
792
|
+
0%, 15%, 50%, 56%, 85%, 91%, 100% { transform: translate(0); clip-path: inset(0 0 100% 0); }
|
|
793
|
+
5% { transform: translate(-${offset}px, 0); clip-path: inset(30% 0 40% 0); }
|
|
794
|
+
10% { transform: translate(${offset}px, 0); clip-path: inset(70% 0 0% 0); }
|
|
795
|
+
52% { transform: translate(-${offset * 0.7}px, 0); clip-path: inset(15% 0 60% 0); }
|
|
796
|
+
54% { transform: translate(${offset * 0.5}px, 0); clip-path: inset(75% 0 0% 0); }
|
|
797
|
+
87% { transform: translate(${offset * 0.8}px, 0); clip-path: inset(0% 0 85% 0); }
|
|
798
|
+
89% { transform: translate(-${offset * 0.6}px, 0); clip-path: inset(55% 0 15% 0); }
|
|
799
|
+
}
|
|
800
|
+
`;
|
|
801
|
+
document.head.appendChild(styleEl);
|
|
802
|
+
return () => {
|
|
803
|
+
document.head.removeChild(styleEl);
|
|
804
|
+
};
|
|
805
|
+
}, [children, speed, offset, id]);
|
|
806
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Tag, { ref: wrapperRef, className: cn("relative inline-block", className), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: id, children }) });
|
|
807
|
+
};
|
|
808
|
+
GlitchText.displayName = "GlitchText";
|
|
809
|
+
|
|
810
|
+
// src/components/Text/ShimmerText.tsx
|
|
811
|
+
var import_react9 = require("react");
|
|
812
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
813
|
+
var shimmerStyleInjected = false;
|
|
814
|
+
var ShimmerText = ({
|
|
815
|
+
children,
|
|
816
|
+
speed = 2,
|
|
817
|
+
shimmerColor = "rgba(255,255,255,0.8)",
|
|
818
|
+
baseColor = "rgba(255,255,255,0.4)",
|
|
819
|
+
as: Tag = "span",
|
|
820
|
+
className
|
|
821
|
+
}) => {
|
|
822
|
+
const ref = (0, import_react9.useRef)(null);
|
|
823
|
+
(0, import_react9.useEffect)(() => {
|
|
824
|
+
if (!shimmerStyleInjected) {
|
|
825
|
+
shimmerStyleInjected = true;
|
|
826
|
+
const style = document.createElement("style");
|
|
827
|
+
style.textContent = `
|
|
828
|
+
@keyframes uixy-shimmer {
|
|
829
|
+
0% { background-position: 200% center; }
|
|
830
|
+
100% { background-position: -200% center; }
|
|
831
|
+
}
|
|
832
|
+
.uixy-shimmer-text {
|
|
833
|
+
-webkit-background-clip: text !important;
|
|
834
|
+
background-clip: text !important;
|
|
835
|
+
-webkit-text-fill-color: transparent !important;
|
|
836
|
+
color: transparent !important;
|
|
837
|
+
}
|
|
838
|
+
`;
|
|
839
|
+
document.head.appendChild(style);
|
|
840
|
+
}
|
|
841
|
+
}, []);
|
|
842
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
843
|
+
Tag,
|
|
844
|
+
{
|
|
845
|
+
ref,
|
|
846
|
+
className: cn("uixy-shimmer-text inline-block", className),
|
|
847
|
+
style: {
|
|
848
|
+
backgroundImage: `linear-gradient(90deg, ${baseColor} 0%, ${baseColor} 35%, ${shimmerColor} 50%, ${baseColor} 65%, ${baseColor} 100%)`,
|
|
849
|
+
backgroundSize: "200% 100%",
|
|
850
|
+
animation: `uixy-shimmer ${speed}s linear infinite`
|
|
851
|
+
},
|
|
852
|
+
children
|
|
853
|
+
}
|
|
854
|
+
);
|
|
855
|
+
};
|
|
856
|
+
ShimmerText.displayName = "ShimmerText";
|
|
857
|
+
|
|
858
|
+
// src/components/Text/WaveText.tsx
|
|
859
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
860
|
+
var WaveText = ({
|
|
861
|
+
children,
|
|
862
|
+
delay = 80,
|
|
863
|
+
duration = 1,
|
|
864
|
+
height = 12,
|
|
865
|
+
as: Tag = "span",
|
|
866
|
+
className
|
|
867
|
+
}) => {
|
|
868
|
+
const letters = children.split("");
|
|
869
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Tag, { className: cn("inline-flex", className), children: [
|
|
870
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("style", { children: `
|
|
871
|
+
@keyframes uixy-wave {
|
|
872
|
+
0%, 100% { transform: translateY(0); }
|
|
873
|
+
50% { transform: translateY(-${height}px); }
|
|
874
|
+
}
|
|
875
|
+
` }),
|
|
876
|
+
letters.map((letter, i) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
877
|
+
"span",
|
|
878
|
+
{
|
|
879
|
+
style: {
|
|
880
|
+
display: "inline-block",
|
|
881
|
+
animation: `uixy-wave ${duration}s ease-in-out infinite`,
|
|
882
|
+
animationDelay: `${i * delay}ms`,
|
|
883
|
+
whiteSpace: letter === " " ? "pre" : void 0
|
|
884
|
+
},
|
|
885
|
+
children: letter === " " ? "\xA0" : letter
|
|
886
|
+
},
|
|
887
|
+
i
|
|
888
|
+
))
|
|
889
|
+
] });
|
|
890
|
+
};
|
|
891
|
+
WaveText.displayName = "WaveText";
|
|
892
|
+
|
|
893
|
+
// src/components/Text/BlurText.tsx
|
|
894
|
+
var import_react10 = require("react");
|
|
895
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
896
|
+
var BlurText = ({
|
|
897
|
+
children,
|
|
898
|
+
mode = "word",
|
|
899
|
+
delay = 100,
|
|
900
|
+
duration = 500,
|
|
901
|
+
triggerOnView = true,
|
|
902
|
+
as: Tag = "span",
|
|
903
|
+
className
|
|
904
|
+
}) => {
|
|
905
|
+
const containerRef = (0, import_react10.useRef)(null);
|
|
906
|
+
const [visible, setVisible] = (0, import_react10.useState)(!triggerOnView);
|
|
907
|
+
(0, import_react10.useEffect)(() => {
|
|
908
|
+
if (!triggerOnView) {
|
|
909
|
+
const t = setTimeout(() => setVisible(true), 50);
|
|
910
|
+
return () => clearTimeout(t);
|
|
911
|
+
}
|
|
912
|
+
const el = containerRef.current;
|
|
913
|
+
if (!el) return;
|
|
914
|
+
const observer = new IntersectionObserver(
|
|
915
|
+
([entry]) => {
|
|
916
|
+
if (entry.isIntersecting) {
|
|
917
|
+
setVisible(true);
|
|
918
|
+
observer.disconnect();
|
|
919
|
+
}
|
|
920
|
+
},
|
|
921
|
+
{ threshold: 0.1 }
|
|
922
|
+
);
|
|
923
|
+
observer.observe(el);
|
|
924
|
+
return () => observer.disconnect();
|
|
925
|
+
}, [triggerOnView]);
|
|
926
|
+
const units = mode === "word" ? children.split(" ").map((w, i, arr) => i < arr.length - 1 ? w + " " : w) : children.split("");
|
|
927
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { ref: containerRef, className: "inline", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Tag, { className: cn("inline", className), children: units.map((unit, i) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
928
|
+
"span",
|
|
929
|
+
{
|
|
930
|
+
style: {
|
|
931
|
+
display: "inline-block",
|
|
932
|
+
transition: `opacity ${duration}ms ease, filter ${duration}ms ease, transform ${duration}ms ease`,
|
|
933
|
+
transitionDelay: visible ? `${i * delay}ms` : "0ms",
|
|
934
|
+
opacity: visible ? 1 : 0,
|
|
935
|
+
filter: visible ? "blur(0px)" : "blur(10px)",
|
|
936
|
+
transform: visible ? "translateY(0)" : "translateY(12px)",
|
|
937
|
+
whiteSpace: "pre"
|
|
938
|
+
},
|
|
939
|
+
children: unit
|
|
940
|
+
},
|
|
941
|
+
i
|
|
942
|
+
)) }) });
|
|
943
|
+
};
|
|
944
|
+
BlurText.displayName = "BlurText";
|
|
945
|
+
|
|
946
|
+
// src/components/Text/CounterText.tsx
|
|
947
|
+
var import_react11 = require("react");
|
|
948
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
949
|
+
function easeOutQuart(t) {
|
|
950
|
+
return 1 - Math.pow(1 - t, 4);
|
|
951
|
+
}
|
|
952
|
+
var CounterText = ({
|
|
953
|
+
target,
|
|
954
|
+
from = 0,
|
|
955
|
+
duration = 2e3,
|
|
956
|
+
decimals = 0,
|
|
957
|
+
prefix = "",
|
|
958
|
+
suffix = "",
|
|
959
|
+
separator = ",",
|
|
960
|
+
triggerOnView = true,
|
|
961
|
+
as: Tag = "span",
|
|
962
|
+
className
|
|
963
|
+
}) => {
|
|
964
|
+
const ref = (0, import_react11.useRef)(null);
|
|
965
|
+
const [value, setValue] = (0, import_react11.useState)(from);
|
|
966
|
+
const [started, setStarted] = (0, import_react11.useState)(!triggerOnView);
|
|
967
|
+
(0, import_react11.useEffect)(() => {
|
|
968
|
+
if (!triggerOnView) return;
|
|
969
|
+
const el = ref.current;
|
|
970
|
+
if (!el) return;
|
|
971
|
+
const observer = new IntersectionObserver(
|
|
972
|
+
([entry]) => {
|
|
973
|
+
if (entry.isIntersecting) {
|
|
974
|
+
setStarted(true);
|
|
975
|
+
observer.disconnect();
|
|
976
|
+
}
|
|
977
|
+
},
|
|
978
|
+
{ threshold: 0.2 }
|
|
979
|
+
);
|
|
980
|
+
observer.observe(el);
|
|
981
|
+
return () => observer.disconnect();
|
|
982
|
+
}, [triggerOnView]);
|
|
983
|
+
(0, import_react11.useEffect)(() => {
|
|
984
|
+
if (!started) return;
|
|
985
|
+
const startTime = performance.now();
|
|
986
|
+
let rafId;
|
|
987
|
+
const animate = (now) => {
|
|
988
|
+
const elapsed = now - startTime;
|
|
989
|
+
const progress = Math.min(elapsed / duration, 1);
|
|
990
|
+
const eased = easeOutQuart(progress);
|
|
991
|
+
const current = from + (target - from) * eased;
|
|
992
|
+
setValue(current);
|
|
993
|
+
if (progress < 1) {
|
|
994
|
+
rafId = requestAnimationFrame(animate);
|
|
995
|
+
}
|
|
996
|
+
};
|
|
997
|
+
rafId = requestAnimationFrame(animate);
|
|
998
|
+
return () => cancelAnimationFrame(rafId);
|
|
999
|
+
}, [started, from, target, duration]);
|
|
1000
|
+
const formatNumber = (num) => {
|
|
1001
|
+
const fixed = num.toFixed(decimals);
|
|
1002
|
+
if (!separator) return fixed;
|
|
1003
|
+
const [int, dec] = fixed.split(".");
|
|
1004
|
+
const formatted = int.replace(/\B(?=(\d{3})+(?!\d))/g, separator);
|
|
1005
|
+
return dec !== void 0 ? `${formatted}.${dec}` : formatted;
|
|
1006
|
+
};
|
|
1007
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Tag, { ref, className: cn("tabular-nums", className), children: [
|
|
1008
|
+
prefix,
|
|
1009
|
+
formatNumber(value),
|
|
1010
|
+
suffix
|
|
1011
|
+
] });
|
|
1012
|
+
};
|
|
1013
|
+
CounterText.displayName = "CounterText";
|
|
1014
|
+
|
|
1015
|
+
// src/components/Text/MediaText.tsx
|
|
1016
|
+
var import_react12 = require("react");
|
|
1017
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1018
|
+
var mediaTextStyleInjected = false;
|
|
1019
|
+
var MediaText = ({
|
|
1020
|
+
children,
|
|
1021
|
+
src,
|
|
1022
|
+
videoSrc,
|
|
1023
|
+
backgroundSize = "cover",
|
|
1024
|
+
backgroundPosition = "center",
|
|
1025
|
+
loop = true,
|
|
1026
|
+
muted = true,
|
|
1027
|
+
as: Tag = "h1",
|
|
1028
|
+
className
|
|
1029
|
+
}) => {
|
|
1030
|
+
(0, import_react12.useEffect)(() => {
|
|
1031
|
+
if (mediaTextStyleInjected) return;
|
|
1032
|
+
mediaTextStyleInjected = true;
|
|
1033
|
+
const style = document.createElement("style");
|
|
1034
|
+
style.textContent = `
|
|
1035
|
+
.uixy-media-text-clip {
|
|
1036
|
+
-webkit-background-clip: text !important;
|
|
1037
|
+
background-clip: text !important;
|
|
1038
|
+
-webkit-text-fill-color: transparent !important;
|
|
1039
|
+
color: transparent !important;
|
|
1040
|
+
}
|
|
1041
|
+
.uixy-media-text-video-container {
|
|
1042
|
+
position: relative;
|
|
1043
|
+
display: inline-block;
|
|
1044
|
+
overflow: hidden;
|
|
1045
|
+
}
|
|
1046
|
+
.uixy-media-text-video-container video {
|
|
1047
|
+
position: absolute;
|
|
1048
|
+
top: 0;
|
|
1049
|
+
left: 0;
|
|
1050
|
+
width: 100%;
|
|
1051
|
+
height: 100%;
|
|
1052
|
+
object-fit: cover;
|
|
1053
|
+
}
|
|
1054
|
+
.uixy-media-text-video-overlay {
|
|
1055
|
+
position: relative;
|
|
1056
|
+
z-index: 1;
|
|
1057
|
+
mix-blend-mode: screen;
|
|
1058
|
+
background: #000;
|
|
1059
|
+
}
|
|
1060
|
+
`;
|
|
1061
|
+
document.head.appendChild(style);
|
|
1062
|
+
}, []);
|
|
1063
|
+
if (src && !videoSrc) {
|
|
1064
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1065
|
+
Tag,
|
|
1066
|
+
{
|
|
1067
|
+
className: cn("uixy-media-text-clip inline-block", className),
|
|
1068
|
+
style: {
|
|
1069
|
+
backgroundImage: `url(${src})`,
|
|
1070
|
+
backgroundSize,
|
|
1071
|
+
backgroundPosition,
|
|
1072
|
+
backgroundRepeat: "no-repeat"
|
|
1073
|
+
},
|
|
1074
|
+
children
|
|
1075
|
+
}
|
|
1076
|
+
);
|
|
1077
|
+
}
|
|
1078
|
+
if (videoSrc) {
|
|
1079
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "uixy-media-text-video-container", children: [
|
|
1080
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1081
|
+
"video",
|
|
1082
|
+
{
|
|
1083
|
+
src: videoSrc,
|
|
1084
|
+
autoPlay: true,
|
|
1085
|
+
loop,
|
|
1086
|
+
muted,
|
|
1087
|
+
playsInline: true,
|
|
1088
|
+
preload: "auto"
|
|
1089
|
+
}
|
|
1090
|
+
),
|
|
1091
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1092
|
+
Tag,
|
|
1093
|
+
{
|
|
1094
|
+
className: cn("uixy-media-text-video-overlay whitespace-nowrap", className),
|
|
1095
|
+
children
|
|
1096
|
+
}
|
|
1097
|
+
)
|
|
1098
|
+
] });
|
|
1099
|
+
}
|
|
1100
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Tag, { className: cn("inline-block", className), children });
|
|
1101
|
+
};
|
|
1102
|
+
MediaText.displayName = "MediaText";
|
|
1103
|
+
|
|
1104
|
+
// src/components/Text/SparklesText.tsx
|
|
1105
|
+
var import_react13 = require("react");
|
|
1106
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1107
|
+
var sparklesStyleInjected = false;
|
|
1108
|
+
var SparklesText = ({
|
|
1109
|
+
children,
|
|
1110
|
+
sparkleColor = "#FFC700",
|
|
1111
|
+
count = 12,
|
|
1112
|
+
minSize = 4,
|
|
1113
|
+
maxSize = 14,
|
|
1114
|
+
speed = 450,
|
|
1115
|
+
as: Tag = "span",
|
|
1116
|
+
className
|
|
1117
|
+
}) => {
|
|
1118
|
+
const containerRef = (0, import_react13.useRef)(null);
|
|
1119
|
+
const injectStyles = (0, import_react13.useCallback)(() => {
|
|
1120
|
+
if (sparklesStyleInjected) return;
|
|
1121
|
+
sparklesStyleInjected = true;
|
|
1122
|
+
const style = document.createElement("style");
|
|
1123
|
+
style.textContent = `
|
|
1124
|
+
@keyframes uixy-sparkle-life {
|
|
1125
|
+
0% { transform: scale(0) rotate(0deg); opacity: 0; }
|
|
1126
|
+
20% { transform: scale(0.6) rotate(60deg); opacity: 0.8; }
|
|
1127
|
+
50% { transform: scale(1) rotate(140deg); opacity: 1; }
|
|
1128
|
+
80% { transform: scale(0.6) rotate(240deg); opacity: 0.8; }
|
|
1129
|
+
100% { transform: scale(0) rotate(360deg); opacity: 0; }
|
|
1130
|
+
}
|
|
1131
|
+
`;
|
|
1132
|
+
document.head.appendChild(style);
|
|
1133
|
+
}, []);
|
|
1134
|
+
(0, import_react13.useEffect)(() => {
|
|
1135
|
+
injectStyles();
|
|
1136
|
+
const container = containerRef.current;
|
|
1137
|
+
if (!container) return;
|
|
1138
|
+
const createSparkleSVG = () => {
|
|
1139
|
+
const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
1140
|
+
const size = minSize + Math.random() * (maxSize - minSize);
|
|
1141
|
+
const duration = 1.2 + Math.random() * 1.2;
|
|
1142
|
+
svg.setAttribute("viewBox", "0 0 24 24");
|
|
1143
|
+
svg.setAttribute("fill", sparkleColor);
|
|
1144
|
+
svg.innerHTML = `<path d="M12 0L14.59 8.41L23 12L14.59 15.59L12 24L9.41 15.59L1 12L9.41 8.41Z"/>`;
|
|
1145
|
+
Object.assign(svg.style, {
|
|
1146
|
+
position: "absolute",
|
|
1147
|
+
left: `${Math.random() * 100}%`,
|
|
1148
|
+
top: `${Math.random() * 100}%`,
|
|
1149
|
+
width: `${size}px`,
|
|
1150
|
+
height: `${size}px`,
|
|
1151
|
+
pointerEvents: "none",
|
|
1152
|
+
animation: `uixy-sparkle-life ${duration}s ease-in-out forwards`,
|
|
1153
|
+
zIndex: "1"
|
|
1154
|
+
});
|
|
1155
|
+
container.appendChild(svg);
|
|
1156
|
+
setTimeout(() => {
|
|
1157
|
+
if (svg.parentNode === container) {
|
|
1158
|
+
container.removeChild(svg);
|
|
1159
|
+
}
|
|
1160
|
+
}, duration * 1e3);
|
|
1161
|
+
};
|
|
1162
|
+
for (let i = 0; i < count; i++) {
|
|
1163
|
+
setTimeout(() => createSparkleSVG(), Math.random() * speed * 2);
|
|
1164
|
+
}
|
|
1165
|
+
const interval = setInterval(() => {
|
|
1166
|
+
createSparkleSVG();
|
|
1167
|
+
}, speed);
|
|
1168
|
+
return () => {
|
|
1169
|
+
clearInterval(interval);
|
|
1170
|
+
const svgs = container.querySelectorAll("svg");
|
|
1171
|
+
svgs.forEach((s) => s.remove());
|
|
1172
|
+
};
|
|
1173
|
+
}, [sparkleColor, count, minSize, maxSize, speed, injectStyles]);
|
|
1174
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Tag, { ref: containerRef, className: cn("relative inline-block", className), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "relative z-[2]", children }) });
|
|
1175
|
+
};
|
|
1176
|
+
SparklesText.displayName = "SparklesText";
|
|
1177
|
+
|
|
1178
|
+
// src/components/Text/HighlightText.tsx
|
|
1179
|
+
var import_react14 = require("react");
|
|
1180
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1181
|
+
var highlightStyleInjected = false;
|
|
1182
|
+
var HighlightText = ({
|
|
1183
|
+
children,
|
|
1184
|
+
variant = "marker",
|
|
1185
|
+
color = "rgba(139, 92, 246, 0.35)",
|
|
1186
|
+
colorTo,
|
|
1187
|
+
duration = 800,
|
|
1188
|
+
delay = 0,
|
|
1189
|
+
triggerOnView = true,
|
|
1190
|
+
as: Tag = "span",
|
|
1191
|
+
className
|
|
1192
|
+
}) => {
|
|
1193
|
+
const containerRef = (0, import_react14.useRef)(null);
|
|
1194
|
+
const [active, setActive] = (0, import_react14.useState)(false);
|
|
1195
|
+
(0, import_react14.useEffect)(() => {
|
|
1196
|
+
if (!highlightStyleInjected) {
|
|
1197
|
+
highlightStyleInjected = true;
|
|
1198
|
+
const style = document.createElement("style");
|
|
1199
|
+
style.textContent = `
|
|
1200
|
+
/* \u2500\u2500 marker \u2500\u2500 */
|
|
1201
|
+
.uixy-hl-marker {
|
|
1202
|
+
background-size: 0% 100%;
|
|
1203
|
+
background-repeat: no-repeat;
|
|
1204
|
+
background-position: left center;
|
|
1205
|
+
padding: 0.05em 0.15em;
|
|
1206
|
+
margin: -0.05em -0.15em;
|
|
1207
|
+
border-radius: 0.15em;
|
|
1208
|
+
}
|
|
1209
|
+
.uixy-hl-marker.uixy-hl-on { background-size: 100% 100%; }
|
|
1210
|
+
|
|
1211
|
+
/* \u2500\u2500 underline \u2500\u2500 */
|
|
1212
|
+
.uixy-hl-underline {
|
|
1213
|
+
background-size: 0% 3px;
|
|
1214
|
+
background-repeat: no-repeat;
|
|
1215
|
+
background-position: left bottom;
|
|
1216
|
+
padding-bottom: 4px;
|
|
1217
|
+
}
|
|
1218
|
+
.uixy-hl-underline.uixy-hl-on { background-size: 100% 3px; }
|
|
1219
|
+
|
|
1220
|
+
/* \u2500\u2500 box \u2500\u2500 */
|
|
1221
|
+
.uixy-hl-box {
|
|
1222
|
+
border: 2px solid transparent;
|
|
1223
|
+
border-radius: 4px;
|
|
1224
|
+
padding: 0.05em 0.25em;
|
|
1225
|
+
margin: -0.05em -0.25em;
|
|
1226
|
+
}
|
|
1227
|
+
.uixy-hl-box.uixy-hl-on { border-color: var(--uixy-hl-c); }
|
|
1228
|
+
|
|
1229
|
+
/* \u2500\u2500 strikethrough \u2500\u2500 */
|
|
1230
|
+
.uixy-hl-strikethrough {
|
|
1231
|
+
position: relative;
|
|
1232
|
+
}
|
|
1233
|
+
.uixy-hl-strikethrough::after {
|
|
1234
|
+
content: '';
|
|
1235
|
+
position: absolute;
|
|
1236
|
+
left: 0;
|
|
1237
|
+
top: 50%;
|
|
1238
|
+
height: 2.5px;
|
|
1239
|
+
background: var(--uixy-hl-c);
|
|
1240
|
+
width: 0%;
|
|
1241
|
+
transition: width var(--uixy-hl-dur) cubic-bezier(0.25, 0.1, 0.25, 1);
|
|
1242
|
+
border-radius: 2px;
|
|
1243
|
+
}
|
|
1244
|
+
.uixy-hl-strikethrough.uixy-hl-on::after { width: 100%; }
|
|
1245
|
+
|
|
1246
|
+
/* \u2500\u2500 gradient \u2500\u2500 */
|
|
1247
|
+
.uixy-hl-gradient {
|
|
1248
|
+
background-size: 0% 100%;
|
|
1249
|
+
background-repeat: no-repeat;
|
|
1250
|
+
background-position: left center;
|
|
1251
|
+
padding: 0.05em 0.15em;
|
|
1252
|
+
margin: -0.05em -0.15em;
|
|
1253
|
+
border-radius: 0.15em;
|
|
1254
|
+
}
|
|
1255
|
+
.uixy-hl-gradient.uixy-hl-on { background-size: 100% 100%; }
|
|
1256
|
+
|
|
1257
|
+
/* \u2500\u2500 glow \u2500\u2500 */
|
|
1258
|
+
.uixy-hl-glow {
|
|
1259
|
+
text-shadow: none;
|
|
1260
|
+
transition: text-shadow var(--uixy-hl-dur) ease;
|
|
1261
|
+
}
|
|
1262
|
+
.uixy-hl-glow.uixy-hl-on {
|
|
1263
|
+
text-shadow:
|
|
1264
|
+
0 0 8px var(--uixy-hl-c),
|
|
1265
|
+
0 0 20px var(--uixy-hl-c),
|
|
1266
|
+
0 0 40px var(--uixy-hl-c);
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
/* \u2500\u2500 bracket \u2500\u2500 */
|
|
1270
|
+
.uixy-hl-bracket {
|
|
1271
|
+
position: relative;
|
|
1272
|
+
padding: 0 0.3em;
|
|
1273
|
+
margin: 0 -0.3em;
|
|
1274
|
+
}
|
|
1275
|
+
.uixy-hl-bracket::before,
|
|
1276
|
+
.uixy-hl-bracket::after {
|
|
1277
|
+
position: absolute;
|
|
1278
|
+
top: -2px;
|
|
1279
|
+
bottom: -2px;
|
|
1280
|
+
width: 6px;
|
|
1281
|
+
border: 2px solid transparent;
|
|
1282
|
+
transition: border-color var(--uixy-hl-dur) ease;
|
|
1283
|
+
content: '';
|
|
1284
|
+
}
|
|
1285
|
+
.uixy-hl-bracket::before {
|
|
1286
|
+
left: 0;
|
|
1287
|
+
border-right: none;
|
|
1288
|
+
border-radius: 3px 0 0 3px;
|
|
1289
|
+
}
|
|
1290
|
+
.uixy-hl-bracket::after {
|
|
1291
|
+
right: 0;
|
|
1292
|
+
border-left: none;
|
|
1293
|
+
border-radius: 0 3px 3px 0;
|
|
1294
|
+
}
|
|
1295
|
+
.uixy-hl-bracket.uixy-hl-on::before,
|
|
1296
|
+
.uixy-hl-bracket.uixy-hl-on::after {
|
|
1297
|
+
border-color: var(--uixy-hl-c);
|
|
1298
|
+
}
|
|
1299
|
+
`;
|
|
1300
|
+
document.head.appendChild(style);
|
|
1301
|
+
}
|
|
1302
|
+
}, []);
|
|
1303
|
+
(0, import_react14.useEffect)(() => {
|
|
1304
|
+
if (!triggerOnView) {
|
|
1305
|
+
const timer = setTimeout(() => setActive(true), Math.max(delay, 50));
|
|
1306
|
+
return () => clearTimeout(timer);
|
|
1307
|
+
}
|
|
1308
|
+
const el = containerRef.current;
|
|
1309
|
+
if (!el) return;
|
|
1310
|
+
const observer = new IntersectionObserver(
|
|
1311
|
+
([entry]) => {
|
|
1312
|
+
if (entry.isIntersecting) {
|
|
1313
|
+
setTimeout(() => setActive(true), delay);
|
|
1314
|
+
observer.disconnect();
|
|
1315
|
+
}
|
|
1316
|
+
},
|
|
1317
|
+
{ threshold: 0.5 }
|
|
1318
|
+
);
|
|
1319
|
+
observer.observe(el);
|
|
1320
|
+
return () => observer.disconnect();
|
|
1321
|
+
}, [triggerOnView, delay]);
|
|
1322
|
+
const gradientBg = variant === "gradient" && colorTo ? `linear-gradient(120deg, ${color}, ${colorTo})` : `linear-gradient(${color}, ${color})`;
|
|
1323
|
+
const transitionProp = variant === "box" ? `border-color ${duration}ms cubic-bezier(0.25,0.1,0.25,1)` : variant === "glow" || variant === "bracket" ? void 0 : `background-size ${duration}ms cubic-bezier(0.25,0.1,0.25,1)`;
|
|
1324
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { ref: containerRef, className: "inline", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1325
|
+
Tag,
|
|
1326
|
+
{
|
|
1327
|
+
className: cn(
|
|
1328
|
+
`uixy-hl-${variant}`,
|
|
1329
|
+
active && "uixy-hl-on",
|
|
1330
|
+
className
|
|
1331
|
+
),
|
|
1332
|
+
style: {
|
|
1333
|
+
...["marker", "underline", "gradient"].includes(variant) ? { backgroundImage: gradientBg } : {},
|
|
1334
|
+
"--uixy-hl-c": color,
|
|
1335
|
+
"--uixy-hl-dur": `${duration}ms`,
|
|
1336
|
+
...transitionProp ? { transition: transitionProp } : {}
|
|
1337
|
+
},
|
|
1338
|
+
children
|
|
1339
|
+
}
|
|
1340
|
+
) });
|
|
1341
|
+
};
|
|
1342
|
+
HighlightText.displayName = "HighlightText";
|
|
1343
|
+
|
|
1344
|
+
// src/components/Card/Card.tsx
|
|
1345
|
+
var import_react15 = require("react");
|
|
1346
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1347
|
+
var cardStyleInjected = false;
|
|
1348
|
+
function injectCardStyles() {
|
|
1349
|
+
if (cardStyleInjected) return;
|
|
1350
|
+
cardStyleInjected = true;
|
|
1351
|
+
const style = document.createElement("style");
|
|
1352
|
+
style.textContent = `
|
|
1353
|
+
/* \u2500\u2500 spotlight \u2500\u2500 */
|
|
1354
|
+
.uixy-card-spotlight {
|
|
1355
|
+
--uixy-mx: 50%; --uixy-my: 50%;
|
|
1356
|
+
position: relative; overflow: hidden;
|
|
1357
|
+
}
|
|
1358
|
+
.uixy-card-spotlight::before {
|
|
1359
|
+
content:''; position:absolute; inset:0;
|
|
1360
|
+
background: radial-gradient(600px circle at var(--uixy-mx) var(--uixy-my), rgba(139,92,246,0.15), transparent 40%);
|
|
1361
|
+
opacity:0; transition:opacity .3s; pointer-events:none; z-index:0;
|
|
1362
|
+
}
|
|
1363
|
+
.uixy-card-spotlight:hover::before { opacity:1; }
|
|
1364
|
+
|
|
1365
|
+
/* \u2500\u2500 neon \u2500\u2500 */
|
|
1366
|
+
.uixy-card-neon {
|
|
1367
|
+
box-shadow: 0 0 5px var(--uixy-neon, rgba(139,92,246,0.4)),
|
|
1368
|
+
0 0 20px var(--uixy-neon, rgba(139,92,246,0.2)),
|
|
1369
|
+
inset 0 0 20px var(--uixy-neon, rgba(139,92,246,0.05));
|
|
1370
|
+
transition: box-shadow 0.3s ease;
|
|
1371
|
+
}
|
|
1372
|
+
.uixy-card-neon:hover {
|
|
1373
|
+
box-shadow: 0 0 10px var(--uixy-neon, rgba(139,92,246,0.6)),
|
|
1374
|
+
0 0 40px var(--uixy-neon, rgba(139,92,246,0.3)),
|
|
1375
|
+
0 0 80px var(--uixy-neon, rgba(139,92,246,0.15)),
|
|
1376
|
+
inset 0 0 30px var(--uixy-neon, rgba(139,92,246,0.08));
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1379
|
+
/* \u2500\u2500 tilt \u2500\u2500 */
|
|
1380
|
+
.uixy-card-tilt {
|
|
1381
|
+
transition: transform 0.15s ease;
|
|
1382
|
+
transform-style: preserve-3d;
|
|
1383
|
+
perspective: 1000px;
|
|
1384
|
+
}
|
|
1385
|
+
|
|
1386
|
+
/* \u2500\u2500 animated border \u2500\u2500 */
|
|
1387
|
+
@keyframes uixy-border-spin {
|
|
1388
|
+
to { --uixy-angle: 360deg; }
|
|
1389
|
+
}
|
|
1390
|
+
@property --uixy-angle { syntax:'<angle>'; initial-value:0deg; inherits:false; }
|
|
1391
|
+
.uixy-card-animated-border {
|
|
1392
|
+
position:relative; overflow:hidden;
|
|
1393
|
+
}
|
|
1394
|
+
.uixy-card-animated-border::before {
|
|
1395
|
+
content:''; position:absolute; inset:-2px;
|
|
1396
|
+
background: conic-gradient(from var(--uixy-angle,0deg), #8b5cf6, #3b82f6, #06b6d4, #8b5cf6);
|
|
1397
|
+
animation: uixy-border-spin 3s linear infinite;
|
|
1398
|
+
border-radius: inherit;
|
|
1399
|
+
z-index: -1;
|
|
1400
|
+
}
|
|
1401
|
+
.uixy-card-animated-border::after {
|
|
1402
|
+
content:''; position:absolute; inset:2px;
|
|
1403
|
+
background: rgb(24 24 27);
|
|
1404
|
+
border-radius: inherit;
|
|
1405
|
+
z-index: -1;
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
/* \u2500\u2500 noise \u2500\u2500 */
|
|
1409
|
+
.uixy-card-noise { position:relative; overflow:hidden; }
|
|
1410
|
+
.uixy-card-noise::before {
|
|
1411
|
+
content:''; position:absolute; inset:-50%;
|
|
1412
|
+
background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
|
|
1413
|
+
background-size: 128px;
|
|
1414
|
+
opacity: 0.04;
|
|
1415
|
+
pointer-events: none;
|
|
1416
|
+
z-index:0;
|
|
1417
|
+
}
|
|
1418
|
+
|
|
1419
|
+
/* \u2500\u2500 lifted \u2500\u2500 */
|
|
1420
|
+
.uixy-card-lifted {
|
|
1421
|
+
transition: transform 0.3s ease, box-shadow 0.3s ease;
|
|
1422
|
+
}
|
|
1423
|
+
.uixy-card-lifted:hover {
|
|
1424
|
+
transform: translateY(-6px);
|
|
1425
|
+
box-shadow: 0 20px 40px rgba(0,0,0,0.3), 0 8px 16px rgba(0,0,0,0.2);
|
|
1426
|
+
}
|
|
1427
|
+
`;
|
|
1428
|
+
document.head.appendChild(style);
|
|
1429
|
+
}
|
|
1430
|
+
var Card = (0, import_react15.forwardRef)(
|
|
1431
|
+
({ variant = "default", className, children, onMouseMove, onMouseLeave, ...props }, ref) => {
|
|
1432
|
+
const innerRef = (0, import_react15.useRef)(null);
|
|
1433
|
+
const cardRef = ref || innerRef;
|
|
1434
|
+
(0, import_react15.useEffect)(() => {
|
|
1435
|
+
injectCardStyles();
|
|
1436
|
+
}, []);
|
|
1437
|
+
const handleMouseMove = (0, import_react15.useCallback)(
|
|
1438
|
+
(e) => {
|
|
1439
|
+
const el = cardRef.current;
|
|
1440
|
+
if (!el) return;
|
|
1441
|
+
const rect = el.getBoundingClientRect();
|
|
1442
|
+
const x = e.clientX - rect.left;
|
|
1443
|
+
const y = e.clientY - rect.top;
|
|
1444
|
+
if (variant === "spotlight") {
|
|
1445
|
+
el.style.setProperty("--uixy-mx", `${x}px`);
|
|
1446
|
+
el.style.setProperty("--uixy-my", `${y}px`);
|
|
1447
|
+
}
|
|
1448
|
+
if (variant === "tilt") {
|
|
1449
|
+
const cx = rect.width / 2;
|
|
1450
|
+
const cy = rect.height / 2;
|
|
1451
|
+
const rotateX = (y - cy) / cy * -8;
|
|
1452
|
+
const rotateY = (x - cx) / cx * 8;
|
|
1453
|
+
el.style.transform = `perspective(1000px) rotateX(${rotateX}deg) rotateY(${rotateY}deg) scale(1.02)`;
|
|
1454
|
+
}
|
|
1455
|
+
onMouseMove == null ? void 0 : onMouseMove(e);
|
|
1456
|
+
},
|
|
1457
|
+
[variant, onMouseMove, cardRef]
|
|
1458
|
+
);
|
|
1459
|
+
const handleMouseLeave = (0, import_react15.useCallback)(
|
|
1460
|
+
(e) => {
|
|
1461
|
+
if (variant === "tilt") {
|
|
1462
|
+
const el = cardRef.current;
|
|
1463
|
+
if (el) el.style.transform = "perspective(1000px) rotateX(0) rotateY(0) scale(1)";
|
|
1464
|
+
}
|
|
1465
|
+
onMouseLeave == null ? void 0 : onMouseLeave(e);
|
|
1466
|
+
},
|
|
1467
|
+
[variant, onMouseLeave, cardRef]
|
|
1468
|
+
);
|
|
1469
|
+
const base = "rounded-xl p-6";
|
|
1470
|
+
const variants = {
|
|
1471
|
+
default: `${base} border border-zinc-800 bg-zinc-900`,
|
|
1472
|
+
bordered: `${base} border-2 border-zinc-600 bg-zinc-900/50`,
|
|
1473
|
+
elevated: `${base} bg-zinc-900 shadow-xl shadow-black/30`,
|
|
1474
|
+
ghost: `${base} hover:bg-zinc-900/50 transition-colors`,
|
|
1475
|
+
gradient: `${base} border border-zinc-800 bg-gradient-to-br from-violet-950/40 via-zinc-900 to-cyan-950/30`,
|
|
1476
|
+
glass: `${base} border border-white/10 bg-white/5 backdrop-blur-lg`,
|
|
1477
|
+
spotlight: `${base} border border-zinc-800 bg-zinc-900 uixy-card-spotlight`,
|
|
1478
|
+
neon: `${base} border border-violet-500/30 bg-zinc-900 uixy-card-neon`,
|
|
1479
|
+
tilt: `${base} border border-zinc-800 bg-zinc-900 uixy-card-tilt cursor-pointer`,
|
|
1480
|
+
"animated-border": `${base} bg-zinc-900 uixy-card-animated-border`,
|
|
1481
|
+
noise: `${base} border border-zinc-800 bg-zinc-900 uixy-card-noise`,
|
|
1482
|
+
lifted: `${base} border border-zinc-800 bg-zinc-900 uixy-card-lifted cursor-pointer`
|
|
1483
|
+
};
|
|
1484
|
+
const needsZWrap = variant === "spotlight" || variant === "noise" || variant === "animated-border";
|
|
1485
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1486
|
+
"div",
|
|
1487
|
+
{
|
|
1488
|
+
ref: cardRef,
|
|
1489
|
+
className: cn(variants[variant], className),
|
|
1490
|
+
onMouseMove: handleMouseMove,
|
|
1491
|
+
onMouseLeave: handleMouseLeave,
|
|
1492
|
+
...props,
|
|
1493
|
+
children: needsZWrap ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "relative z-10", children }) : children
|
|
1494
|
+
}
|
|
1495
|
+
);
|
|
1496
|
+
}
|
|
1497
|
+
);
|
|
1498
|
+
Card.displayName = "Card";
|
|
1499
|
+
var CardHeader = (0, import_react15.forwardRef)(
|
|
1500
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { ref, className: cn("mb-4", className), ...props })
|
|
1501
|
+
);
|
|
1502
|
+
CardHeader.displayName = "CardHeader";
|
|
1503
|
+
var CardTitle = (0, import_react15.forwardRef)(
|
|
1504
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("h3", { ref, className: cn("text-lg font-semibold text-zinc-100", className), ...props })
|
|
1505
|
+
);
|
|
1506
|
+
CardTitle.displayName = "CardTitle";
|
|
1507
|
+
var CardDescription = (0, import_react15.forwardRef)(
|
|
1508
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { ref, className: cn("text-sm text-zinc-400 mt-1", className), ...props })
|
|
1509
|
+
);
|
|
1510
|
+
CardDescription.displayName = "CardDescription";
|
|
1511
|
+
var CardContent = (0, import_react15.forwardRef)(
|
|
1512
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { ref, className: cn("", className), ...props })
|
|
1513
|
+
);
|
|
1514
|
+
CardContent.displayName = "CardContent";
|
|
1515
|
+
var CardFooter = (0, import_react15.forwardRef)(
|
|
1516
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { ref, className: cn("mt-4 flex items-center gap-2", className), ...props })
|
|
1517
|
+
);
|
|
1518
|
+
CardFooter.displayName = "CardFooter";
|
|
1519
|
+
|
|
1520
|
+
// src/components/Background/ParticleBackground.tsx
|
|
1521
|
+
var import_react16 = require("react");
|
|
1522
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1523
|
+
var ParticleBackground = ({
|
|
1524
|
+
items,
|
|
1525
|
+
count,
|
|
1526
|
+
connectionDistance = 180,
|
|
1527
|
+
arrows = false,
|
|
1528
|
+
mouseDistance = 200,
|
|
1529
|
+
color = [110, 120, 220],
|
|
1530
|
+
speed = 1,
|
|
1531
|
+
fontSize = [13, 18],
|
|
1532
|
+
imageSize = 28,
|
|
1533
|
+
lineWidth = 0.6,
|
|
1534
|
+
maxOpacity = 0.25,
|
|
1535
|
+
className
|
|
1536
|
+
}) => {
|
|
1537
|
+
const canvasRef = (0, import_react16.useRef)(null);
|
|
1538
|
+
const nodesRef = (0, import_react16.useRef)([]);
|
|
1539
|
+
const mouseRef = (0, import_react16.useRef)({ x: -9999, y: -9999 });
|
|
1540
|
+
const rafRef = (0, import_react16.useRef)(0);
|
|
1541
|
+
const normalize = (0, import_react16.useCallback)(
|
|
1542
|
+
(item) => {
|
|
1543
|
+
if (typeof item === "string") {
|
|
1544
|
+
if (/^(https?:\/\/|data:image|\/|\.\.?\/)/.test(item)) {
|
|
1545
|
+
return { content: item, type: "image" };
|
|
1546
|
+
}
|
|
1547
|
+
const emojiRegex = /^[\p{Emoji_Presentation}\p{Extended_Pictographic}\u200d\ufe0f]{1,8}$/u;
|
|
1548
|
+
if (emojiRegex.test(item.trim())) {
|
|
1549
|
+
return { content: item.trim(), type: "emoji" };
|
|
1550
|
+
}
|
|
1551
|
+
return { content: item, type: "text" };
|
|
1552
|
+
}
|
|
1553
|
+
return { content: item.content, type: item.type || "text" };
|
|
1554
|
+
},
|
|
1555
|
+
[]
|
|
1556
|
+
);
|
|
1557
|
+
(0, import_react16.useEffect)(() => {
|
|
1558
|
+
const canvas = canvasRef.current;
|
|
1559
|
+
if (!canvas) return;
|
|
1560
|
+
const ctx = canvas.getContext("2d");
|
|
1561
|
+
if (!ctx) return;
|
|
1562
|
+
const [baseR, baseG, baseB] = color;
|
|
1563
|
+
const resize = () => {
|
|
1564
|
+
canvas.width = canvas.offsetWidth;
|
|
1565
|
+
canvas.height = canvas.offsetHeight;
|
|
1566
|
+
};
|
|
1567
|
+
resize();
|
|
1568
|
+
window.addEventListener("resize", resize);
|
|
1569
|
+
const nodeCount = count != null ? count : Math.min(Math.floor(canvas.width * canvas.height / 22e3), 60);
|
|
1570
|
+
const nodes = Array.from({ length: nodeCount }, (_, i) => {
|
|
1571
|
+
const item = normalize(items[i % items.length]);
|
|
1572
|
+
const node = {
|
|
1573
|
+
x: Math.random() * canvas.width,
|
|
1574
|
+
y: Math.random() * canvas.height,
|
|
1575
|
+
vx: (Math.random() - 0.5) * 0.3 * speed,
|
|
1576
|
+
vy: (Math.random() - 0.5) * 0.3 * speed,
|
|
1577
|
+
content: item.content,
|
|
1578
|
+
type: item.type,
|
|
1579
|
+
opacity: Math.random() * (maxOpacity - 0.05) + 0.05,
|
|
1580
|
+
shade: Math.random(),
|
|
1581
|
+
fontSize: fontSize[0] + Math.random() * (fontSize[1] - fontSize[0])
|
|
1582
|
+
};
|
|
1583
|
+
if (item.type === "image") {
|
|
1584
|
+
const img = new Image();
|
|
1585
|
+
img.crossOrigin = "anonymous";
|
|
1586
|
+
img.src = item.content;
|
|
1587
|
+
node.img = img;
|
|
1588
|
+
node.imgLoaded = false;
|
|
1589
|
+
img.onload = () => {
|
|
1590
|
+
node.imgLoaded = true;
|
|
1591
|
+
};
|
|
1592
|
+
}
|
|
1593
|
+
return node;
|
|
1594
|
+
});
|
|
1595
|
+
nodesRef.current = nodes;
|
|
1596
|
+
const onMouse = (e) => {
|
|
1597
|
+
const rect = canvas.getBoundingClientRect();
|
|
1598
|
+
mouseRef.current = { x: e.clientX - rect.left, y: e.clientY - rect.top };
|
|
1599
|
+
};
|
|
1600
|
+
const onMouseLeave = () => {
|
|
1601
|
+
mouseRef.current = { x: -9999, y: -9999 };
|
|
1602
|
+
};
|
|
1603
|
+
canvas.addEventListener("mousemove", onMouse);
|
|
1604
|
+
canvas.addEventListener("mouseleave", onMouseLeave);
|
|
1605
|
+
const getColor = (shade, alpha) => {
|
|
1606
|
+
const v = 40;
|
|
1607
|
+
const r = Math.round(baseR + (shade - 0.5) * v);
|
|
1608
|
+
const g = Math.round(baseG + (shade - 0.5) * v);
|
|
1609
|
+
const b = Math.round(baseB + (shade - 0.5) * (v * 0.3));
|
|
1610
|
+
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
|
|
1611
|
+
};
|
|
1612
|
+
const drawArrow = (fromX, fromY, toX, toY, color2) => {
|
|
1613
|
+
const headLen = 6;
|
|
1614
|
+
const dx = toX - fromX;
|
|
1615
|
+
const dy = toY - fromY;
|
|
1616
|
+
const angle = Math.atan2(dy, dx);
|
|
1617
|
+
const mx = (fromX + toX) / 2;
|
|
1618
|
+
const my = (fromY + toY) / 2;
|
|
1619
|
+
ctx.beginPath();
|
|
1620
|
+
ctx.moveTo(
|
|
1621
|
+
mx - headLen * Math.cos(angle - Math.PI / 6),
|
|
1622
|
+
my - headLen * Math.sin(angle - Math.PI / 6)
|
|
1623
|
+
);
|
|
1624
|
+
ctx.lineTo(mx, my);
|
|
1625
|
+
ctx.lineTo(
|
|
1626
|
+
mx - headLen * Math.cos(angle + Math.PI / 6),
|
|
1627
|
+
my - headLen * Math.sin(angle + Math.PI / 6)
|
|
1628
|
+
);
|
|
1629
|
+
ctx.strokeStyle = color2;
|
|
1630
|
+
ctx.lineWidth = lineWidth;
|
|
1631
|
+
ctx.stroke();
|
|
1632
|
+
};
|
|
1633
|
+
const draw = () => {
|
|
1634
|
+
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
1635
|
+
const mouse = mouseRef.current;
|
|
1636
|
+
for (const n of nodes) {
|
|
1637
|
+
n.x += n.vx;
|
|
1638
|
+
n.y += n.vy;
|
|
1639
|
+
if (n.x < -50) n.x = canvas.width + 50;
|
|
1640
|
+
if (n.x > canvas.width + 50) n.x = -50;
|
|
1641
|
+
if (n.y < -30) n.y = canvas.height + 30;
|
|
1642
|
+
if (n.y > canvas.height + 30) n.y = -30;
|
|
1643
|
+
}
|
|
1644
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
1645
|
+
for (let j = i + 1; j < nodes.length; j++) {
|
|
1646
|
+
const dx = nodes[i].x - nodes[j].x;
|
|
1647
|
+
const dy = nodes[i].y - nodes[j].y;
|
|
1648
|
+
const dist = Math.sqrt(dx * dx + dy * dy);
|
|
1649
|
+
if (dist < connectionDistance) {
|
|
1650
|
+
const avgShade = (nodes[i].shade + nodes[j].shade) / 2;
|
|
1651
|
+
const alpha = (1 - dist / connectionDistance) * 0.1;
|
|
1652
|
+
const c = getColor(avgShade, alpha);
|
|
1653
|
+
ctx.beginPath();
|
|
1654
|
+
ctx.moveTo(nodes[i].x, nodes[i].y);
|
|
1655
|
+
ctx.lineTo(nodes[j].x, nodes[j].y);
|
|
1656
|
+
ctx.strokeStyle = c;
|
|
1657
|
+
ctx.lineWidth = lineWidth;
|
|
1658
|
+
ctx.stroke();
|
|
1659
|
+
if (arrows) {
|
|
1660
|
+
drawArrow(nodes[i].x, nodes[i].y, nodes[j].x, nodes[j].y, c);
|
|
1661
|
+
}
|
|
1662
|
+
}
|
|
1663
|
+
}
|
|
1664
|
+
}
|
|
1665
|
+
for (const n of nodes) {
|
|
1666
|
+
const dx = mouse.x - n.x;
|
|
1667
|
+
const dy = mouse.y - n.y;
|
|
1668
|
+
const dist = Math.sqrt(dx * dx + dy * dy);
|
|
1669
|
+
if (dist < mouseDistance) {
|
|
1670
|
+
const alpha = (1 - dist / mouseDistance) * 0.25;
|
|
1671
|
+
const c = getColor(n.shade, alpha);
|
|
1672
|
+
ctx.beginPath();
|
|
1673
|
+
ctx.moveTo(n.x, n.y);
|
|
1674
|
+
ctx.lineTo(mouse.x, mouse.y);
|
|
1675
|
+
ctx.strokeStyle = c;
|
|
1676
|
+
ctx.lineWidth = lineWidth * 1.2;
|
|
1677
|
+
ctx.stroke();
|
|
1678
|
+
if (arrows) {
|
|
1679
|
+
drawArrow(n.x, n.y, mouse.x, mouse.y, c);
|
|
1680
|
+
}
|
|
1681
|
+
}
|
|
1682
|
+
}
|
|
1683
|
+
for (const n of nodes) {
|
|
1684
|
+
const dx = mouse.x - n.x;
|
|
1685
|
+
const dy = mouse.y - n.y;
|
|
1686
|
+
const dist = Math.sqrt(dx * dx + dy * dy);
|
|
1687
|
+
const hoverBoost = dist < mouseDistance ? (1 - dist / mouseDistance) * 0.35 : 0;
|
|
1688
|
+
const alpha = Math.min(n.opacity + hoverBoost, 1);
|
|
1689
|
+
if (n.type === "image" && n.img && n.imgLoaded) {
|
|
1690
|
+
ctx.globalAlpha = alpha;
|
|
1691
|
+
const s = imageSize;
|
|
1692
|
+
ctx.drawImage(n.img, n.x - s / 2, n.y - s / 2, s, s);
|
|
1693
|
+
ctx.globalAlpha = 1;
|
|
1694
|
+
} else if (n.type === "emoji") {
|
|
1695
|
+
ctx.globalAlpha = alpha;
|
|
1696
|
+
ctx.font = `${n.fontSize + 4}px serif`;
|
|
1697
|
+
ctx.textAlign = "center";
|
|
1698
|
+
ctx.textBaseline = "middle";
|
|
1699
|
+
ctx.fillText(n.content, n.x, n.y);
|
|
1700
|
+
ctx.globalAlpha = 1;
|
|
1701
|
+
} else {
|
|
1702
|
+
ctx.font = `600 ${n.fontSize}px ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`;
|
|
1703
|
+
ctx.textAlign = "center";
|
|
1704
|
+
ctx.textBaseline = "middle";
|
|
1705
|
+
ctx.fillStyle = getColor(n.shade, alpha);
|
|
1706
|
+
ctx.fillText(n.content, n.x, n.y);
|
|
1707
|
+
}
|
|
1708
|
+
}
|
|
1709
|
+
rafRef.current = requestAnimationFrame(draw);
|
|
1710
|
+
};
|
|
1711
|
+
draw();
|
|
1712
|
+
return () => {
|
|
1713
|
+
cancelAnimationFrame(rafRef.current);
|
|
1714
|
+
window.removeEventListener("resize", resize);
|
|
1715
|
+
canvas.removeEventListener("mousemove", onMouse);
|
|
1716
|
+
canvas.removeEventListener("mouseleave", onMouseLeave);
|
|
1717
|
+
};
|
|
1718
|
+
}, [items, count, connectionDistance, arrows, mouseDistance, color, speed, fontSize, imageSize, lineWidth, maxOpacity, normalize]);
|
|
1719
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1720
|
+
"canvas",
|
|
1721
|
+
{
|
|
1722
|
+
ref: canvasRef,
|
|
1723
|
+
className: className != null ? className : "fixed inset-0 -z-10 pointer-events-none w-full h-full",
|
|
1724
|
+
style: { display: "block" }
|
|
1725
|
+
}
|
|
1726
|
+
);
|
|
1727
|
+
};
|
|
1728
|
+
ParticleBackground.displayName = "ParticleBackground";
|
|
1729
|
+
|
|
1730
|
+
// src/components/Background/AuroraBackground.tsx
|
|
1731
|
+
var import_react17 = require("react");
|
|
1732
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1733
|
+
var AuroraBackground = ({
|
|
1734
|
+
colors = ["#8b5cf6", "#3b82f6", "#06b6d4", "#8b5cf6"],
|
|
1735
|
+
speed = 1,
|
|
1736
|
+
blur = 120,
|
|
1737
|
+
opacity = 0.3,
|
|
1738
|
+
className
|
|
1739
|
+
}) => {
|
|
1740
|
+
const canvasRef = (0, import_react17.useRef)(null);
|
|
1741
|
+
const rafRef = (0, import_react17.useRef)(0);
|
|
1742
|
+
(0, import_react17.useEffect)(() => {
|
|
1743
|
+
const canvas = canvasRef.current;
|
|
1744
|
+
if (!canvas) return;
|
|
1745
|
+
const ctx = canvas.getContext("2d");
|
|
1746
|
+
if (!ctx) return;
|
|
1747
|
+
const resize = () => {
|
|
1748
|
+
canvas.width = canvas.offsetWidth;
|
|
1749
|
+
canvas.height = canvas.offsetHeight;
|
|
1750
|
+
};
|
|
1751
|
+
resize();
|
|
1752
|
+
window.addEventListener("resize", resize);
|
|
1753
|
+
let t = 0;
|
|
1754
|
+
const parseColor = (c) => {
|
|
1755
|
+
const tmp = document.createElement("div");
|
|
1756
|
+
tmp.style.color = c;
|
|
1757
|
+
document.body.appendChild(tmp);
|
|
1758
|
+
const computed = getComputedStyle(tmp).color;
|
|
1759
|
+
document.body.removeChild(tmp);
|
|
1760
|
+
const m = computed.match(/\d+/g);
|
|
1761
|
+
return m ? [+m[0], +m[1], +m[2]] : [139, 92, 246];
|
|
1762
|
+
};
|
|
1763
|
+
const rgbColors = colors.map(parseColor);
|
|
1764
|
+
const draw = () => {
|
|
1765
|
+
const w = canvas.width;
|
|
1766
|
+
const h = canvas.height;
|
|
1767
|
+
ctx.clearRect(0, 0, w, h);
|
|
1768
|
+
const blobCount = rgbColors.length;
|
|
1769
|
+
for (let i = 0; i < blobCount; i++) {
|
|
1770
|
+
const phase = i / blobCount * Math.PI * 2;
|
|
1771
|
+
const x = w * 0.5 + Math.sin(t * 0.3 * speed + phase) * w * 0.35;
|
|
1772
|
+
const y = h * 0.4 + Math.cos(t * 0.2 * speed + phase * 1.3) * h * 0.25;
|
|
1773
|
+
const radius = Math.max(w, h) * (0.3 + Math.sin(t * 0.15 * speed + i) * 0.1);
|
|
1774
|
+
const [r, g, b] = rgbColors[i % rgbColors.length];
|
|
1775
|
+
const grad = ctx.createRadialGradient(x, y, 0, x, y, radius);
|
|
1776
|
+
grad.addColorStop(0, `rgba(${r}, ${g}, ${b}, ${opacity})`);
|
|
1777
|
+
grad.addColorStop(1, `rgba(${r}, ${g}, ${b}, 0)`);
|
|
1778
|
+
ctx.fillStyle = grad;
|
|
1779
|
+
ctx.fillRect(0, 0, w, h);
|
|
1780
|
+
}
|
|
1781
|
+
t += 0.016;
|
|
1782
|
+
rafRef.current = requestAnimationFrame(draw);
|
|
1783
|
+
};
|
|
1784
|
+
draw();
|
|
1785
|
+
return () => {
|
|
1786
|
+
cancelAnimationFrame(rafRef.current);
|
|
1787
|
+
window.removeEventListener("resize", resize);
|
|
1788
|
+
};
|
|
1789
|
+
}, [colors, speed, blur, opacity]);
|
|
1790
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1791
|
+
"canvas",
|
|
1792
|
+
{
|
|
1793
|
+
ref: canvasRef,
|
|
1794
|
+
className: className != null ? className : "fixed inset-0 -z-10 pointer-events-none w-full h-full",
|
|
1795
|
+
style: { display: "block", filter: `blur(${blur}px)` }
|
|
1796
|
+
}
|
|
1797
|
+
);
|
|
1798
|
+
};
|
|
1799
|
+
AuroraBackground.displayName = "AuroraBackground";
|
|
1800
|
+
|
|
1801
|
+
// src/components/Background/GridBackground.tsx
|
|
1802
|
+
var import_react18 = require("react");
|
|
1803
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1804
|
+
var gridStyleInjected = false;
|
|
1805
|
+
var GridBackground = ({
|
|
1806
|
+
variant = "grid",
|
|
1807
|
+
size = 40,
|
|
1808
|
+
color = "rgba(255,255,255,0.08)",
|
|
1809
|
+
opacity = 1,
|
|
1810
|
+
followMouse = false,
|
|
1811
|
+
maskRadius = 300,
|
|
1812
|
+
className
|
|
1813
|
+
}) => {
|
|
1814
|
+
const containerRef = (0, import_react18.useRef)(null);
|
|
1815
|
+
(0, import_react18.useEffect)(() => {
|
|
1816
|
+
if (!gridStyleInjected) {
|
|
1817
|
+
gridStyleInjected = true;
|
|
1818
|
+
const style = document.createElement("style");
|
|
1819
|
+
style.textContent = `
|
|
1820
|
+
.uixy-grid-bg {
|
|
1821
|
+
--uixy-grid-mx: 50%;
|
|
1822
|
+
--uixy-grid-my: 50%;
|
|
1823
|
+
}
|
|
1824
|
+
`;
|
|
1825
|
+
document.head.appendChild(style);
|
|
1826
|
+
}
|
|
1827
|
+
}, []);
|
|
1828
|
+
(0, import_react18.useEffect)(() => {
|
|
1829
|
+
if (!followMouse) return;
|
|
1830
|
+
const el = containerRef.current;
|
|
1831
|
+
if (!el) return;
|
|
1832
|
+
const onMove = (e) => {
|
|
1833
|
+
const rect = el.getBoundingClientRect();
|
|
1834
|
+
el.style.setProperty("--uixy-grid-mx", `${e.clientX - rect.left}px`);
|
|
1835
|
+
el.style.setProperty("--uixy-grid-my", `${e.clientY - rect.top}px`);
|
|
1836
|
+
};
|
|
1837
|
+
el.addEventListener("mousemove", onMove);
|
|
1838
|
+
return () => el.removeEventListener("mousemove", onMove);
|
|
1839
|
+
}, [followMouse]);
|
|
1840
|
+
let bgImage;
|
|
1841
|
+
if (variant === "dots") {
|
|
1842
|
+
bgImage = `radial-gradient(circle, ${color} 1px, transparent 1px)`;
|
|
1843
|
+
} else if (variant === "cross") {
|
|
1844
|
+
bgImage = `
|
|
1845
|
+
linear-gradient(${color} 1px, transparent 1px),
|
|
1846
|
+
linear-gradient(90deg, ${color} 1px, transparent 1px),
|
|
1847
|
+
radial-gradient(circle, ${color} 1.5px, transparent 1.5px)
|
|
1848
|
+
`;
|
|
1849
|
+
} else {
|
|
1850
|
+
bgImage = `
|
|
1851
|
+
linear-gradient(${color} 1px, transparent 1px),
|
|
1852
|
+
linear-gradient(90deg, ${color} 1px, transparent 1px)
|
|
1853
|
+
`;
|
|
1854
|
+
}
|
|
1855
|
+
const bgSize = variant === "cross" ? `${size}px ${size}px, ${size}px ${size}px, ${size}px ${size}px` : `${size}px ${size}px`;
|
|
1856
|
+
const maskImage = followMouse ? `radial-gradient(circle ${maskRadius}px at var(--uixy-grid-mx) var(--uixy-grid-my), black, transparent)` : void 0;
|
|
1857
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1858
|
+
"div",
|
|
1859
|
+
{
|
|
1860
|
+
ref: containerRef,
|
|
1861
|
+
className: `uixy-grid-bg ${className != null ? className : "fixed inset-0 -z-10 pointer-events-none w-full h-full"}`,
|
|
1862
|
+
style: {
|
|
1863
|
+
backgroundImage: bgImage,
|
|
1864
|
+
backgroundSize: bgSize,
|
|
1865
|
+
opacity,
|
|
1866
|
+
WebkitMaskImage: maskImage,
|
|
1867
|
+
maskImage
|
|
1868
|
+
}
|
|
1869
|
+
}
|
|
1870
|
+
);
|
|
1871
|
+
};
|
|
1872
|
+
GridBackground.displayName = "GridBackground";
|
|
1873
|
+
|
|
1874
|
+
// src/components/Background/StarfieldBackground.tsx
|
|
1875
|
+
var import_react19 = require("react");
|
|
1876
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1877
|
+
var StarfieldBackground = ({
|
|
1878
|
+
count = 300,
|
|
1879
|
+
speed = 1,
|
|
1880
|
+
color = [200, 200, 255],
|
|
1881
|
+
maxSize = 2.5,
|
|
1882
|
+
warp = false,
|
|
1883
|
+
className
|
|
1884
|
+
}) => {
|
|
1885
|
+
const canvasRef = (0, import_react19.useRef)(null);
|
|
1886
|
+
const rafRef = (0, import_react19.useRef)(0);
|
|
1887
|
+
(0, import_react19.useEffect)(() => {
|
|
1888
|
+
const canvas = canvasRef.current;
|
|
1889
|
+
if (!canvas) return;
|
|
1890
|
+
const ctx = canvas.getContext("2d");
|
|
1891
|
+
if (!ctx) return;
|
|
1892
|
+
const resize = () => {
|
|
1893
|
+
canvas.width = canvas.offsetWidth;
|
|
1894
|
+
canvas.height = canvas.offsetHeight;
|
|
1895
|
+
};
|
|
1896
|
+
resize();
|
|
1897
|
+
window.addEventListener("resize", resize);
|
|
1898
|
+
const stars = Array.from({ length: count }, () => ({
|
|
1899
|
+
x: (Math.random() - 0.5) * 2e3,
|
|
1900
|
+
y: (Math.random() - 0.5) * 2e3,
|
|
1901
|
+
z: Math.random() * 1e3,
|
|
1902
|
+
prevX: 0,
|
|
1903
|
+
prevY: 0
|
|
1904
|
+
}));
|
|
1905
|
+
const baseSpeed = warp ? 8 : 1.5;
|
|
1906
|
+
const draw = () => {
|
|
1907
|
+
const w = canvas.width;
|
|
1908
|
+
const h = canvas.height;
|
|
1909
|
+
const cx = w / 2;
|
|
1910
|
+
const cy = h / 2;
|
|
1911
|
+
const [r, g, b] = color;
|
|
1912
|
+
if (warp) {
|
|
1913
|
+
ctx.fillStyle = "rgba(0, 0, 0, 0.15)";
|
|
1914
|
+
ctx.fillRect(0, 0, w, h);
|
|
1915
|
+
} else {
|
|
1916
|
+
ctx.clearRect(0, 0, w, h);
|
|
1917
|
+
}
|
|
1918
|
+
for (const star of stars) {
|
|
1919
|
+
const prevZ = star.z + baseSpeed * speed;
|
|
1920
|
+
star.prevX = star.x / prevZ * 500 + cx;
|
|
1921
|
+
star.prevY = star.y / prevZ * 500 + cy;
|
|
1922
|
+
star.z -= baseSpeed * speed;
|
|
1923
|
+
if (star.z <= 1) {
|
|
1924
|
+
star.x = (Math.random() - 0.5) * 2e3;
|
|
1925
|
+
star.y = (Math.random() - 0.5) * 2e3;
|
|
1926
|
+
star.z = 1e3;
|
|
1927
|
+
star.prevX = star.x / star.z * 500 + cx;
|
|
1928
|
+
star.prevY = star.y / star.z * 500 + cy;
|
|
1929
|
+
continue;
|
|
1930
|
+
}
|
|
1931
|
+
const sx = star.x / star.z * 500 + cx;
|
|
1932
|
+
const sy = star.y / star.z * 500 + cy;
|
|
1933
|
+
if (sx < -10 || sx > w + 10 || sy < -10 || sy > h + 10) continue;
|
|
1934
|
+
const size = Math.max(0.3, (1 - star.z / 1e3) * maxSize);
|
|
1935
|
+
const alpha = Math.min(1, (1 - star.z / 1e3) * 1.5);
|
|
1936
|
+
if (warp) {
|
|
1937
|
+
ctx.beginPath();
|
|
1938
|
+
ctx.moveTo(star.prevX, star.prevY);
|
|
1939
|
+
ctx.lineTo(sx, sy);
|
|
1940
|
+
ctx.strokeStyle = `rgba(${r}, ${g}, ${b}, ${alpha * 0.6})`;
|
|
1941
|
+
ctx.lineWidth = size * 0.8;
|
|
1942
|
+
ctx.stroke();
|
|
1943
|
+
}
|
|
1944
|
+
ctx.beginPath();
|
|
1945
|
+
ctx.arc(sx, sy, size, 0, Math.PI * 2);
|
|
1946
|
+
ctx.fillStyle = `rgba(${r}, ${g}, ${b}, ${alpha})`;
|
|
1947
|
+
ctx.fill();
|
|
1948
|
+
}
|
|
1949
|
+
rafRef.current = requestAnimationFrame(draw);
|
|
1950
|
+
};
|
|
1951
|
+
draw();
|
|
1952
|
+
return () => {
|
|
1953
|
+
cancelAnimationFrame(rafRef.current);
|
|
1954
|
+
window.removeEventListener("resize", resize);
|
|
1955
|
+
};
|
|
1956
|
+
}, [count, speed, color, maxSize, warp]);
|
|
1957
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1958
|
+
"canvas",
|
|
1959
|
+
{
|
|
1960
|
+
ref: canvasRef,
|
|
1961
|
+
className: className != null ? className : "fixed inset-0 -z-10 pointer-events-none w-full h-full",
|
|
1962
|
+
style: { display: "block", background: "black" }
|
|
1963
|
+
}
|
|
1964
|
+
);
|
|
1965
|
+
};
|
|
1966
|
+
StarfieldBackground.displayName = "StarfieldBackground";
|
|
1967
|
+
|
|
1968
|
+
// src/components/Background/WaveBackground.tsx
|
|
1969
|
+
var import_react20 = require("react");
|
|
1970
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1971
|
+
var WaveBackground = ({
|
|
1972
|
+
colors = ["rgba(139,92,246,0.15)", "rgba(59,130,246,0.12)", "rgba(6,182,212,0.1)"],
|
|
1973
|
+
layers = 3,
|
|
1974
|
+
speed = 1,
|
|
1975
|
+
amplitude = 40,
|
|
1976
|
+
frequency = 8e-3,
|
|
1977
|
+
className
|
|
1978
|
+
}) => {
|
|
1979
|
+
const canvasRef = (0, import_react20.useRef)(null);
|
|
1980
|
+
const rafRef = (0, import_react20.useRef)(0);
|
|
1981
|
+
(0, import_react20.useEffect)(() => {
|
|
1982
|
+
const canvas = canvasRef.current;
|
|
1983
|
+
if (!canvas) return;
|
|
1984
|
+
const ctx = canvas.getContext("2d");
|
|
1985
|
+
if (!ctx) return;
|
|
1986
|
+
const resize = () => {
|
|
1987
|
+
canvas.width = canvas.offsetWidth;
|
|
1988
|
+
canvas.height = canvas.offsetHeight;
|
|
1989
|
+
};
|
|
1990
|
+
resize();
|
|
1991
|
+
window.addEventListener("resize", resize);
|
|
1992
|
+
let t = 0;
|
|
1993
|
+
const draw = () => {
|
|
1994
|
+
const w = canvas.width;
|
|
1995
|
+
const h = canvas.height;
|
|
1996
|
+
ctx.clearRect(0, 0, w, h);
|
|
1997
|
+
for (let l = 0; l < layers; l++) {
|
|
1998
|
+
const color = colors[l % colors.length];
|
|
1999
|
+
const yBase = h * (0.5 + l * 0.12);
|
|
2000
|
+
const amp = amplitude * (1 - l * 0.15);
|
|
2001
|
+
const freq = frequency * (1 + l * 0.3);
|
|
2002
|
+
const phaseOffset = l * 1.2;
|
|
2003
|
+
ctx.beginPath();
|
|
2004
|
+
ctx.moveTo(0, h);
|
|
2005
|
+
for (let x = 0; x <= w; x += 3) {
|
|
2006
|
+
const y = yBase + Math.sin(x * freq + t * speed + phaseOffset) * amp + Math.sin(x * freq * 0.5 + t * speed * 0.7 + phaseOffset * 2) * amp * 0.5;
|
|
2007
|
+
ctx.lineTo(x, y);
|
|
2008
|
+
}
|
|
2009
|
+
ctx.lineTo(w, h);
|
|
2010
|
+
ctx.closePath();
|
|
2011
|
+
ctx.fillStyle = color;
|
|
2012
|
+
ctx.fill();
|
|
2013
|
+
}
|
|
2014
|
+
t += 0.02;
|
|
2015
|
+
rafRef.current = requestAnimationFrame(draw);
|
|
2016
|
+
};
|
|
2017
|
+
draw();
|
|
2018
|
+
return () => {
|
|
2019
|
+
cancelAnimationFrame(rafRef.current);
|
|
2020
|
+
window.removeEventListener("resize", resize);
|
|
2021
|
+
};
|
|
2022
|
+
}, [colors, layers, speed, amplitude, frequency]);
|
|
2023
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2024
|
+
"canvas",
|
|
2025
|
+
{
|
|
2026
|
+
ref: canvasRef,
|
|
2027
|
+
className: className != null ? className : "fixed inset-0 -z-10 pointer-events-none w-full h-full",
|
|
2028
|
+
style: { display: "block" }
|
|
2029
|
+
}
|
|
2030
|
+
);
|
|
2031
|
+
};
|
|
2032
|
+
WaveBackground.displayName = "WaveBackground";
|
|
2033
|
+
|
|
2034
|
+
// src/components/Background/GradientMeshBackground.tsx
|
|
2035
|
+
var import_react21 = require("react");
|
|
2036
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2037
|
+
var meshStyleInjected = false;
|
|
2038
|
+
var GradientMeshBackground = ({
|
|
2039
|
+
colors = ["#8b5cf6", "#3b82f6", "#06b6d4", "#ec4899"],
|
|
2040
|
+
speed = 1,
|
|
2041
|
+
intensity = 1,
|
|
2042
|
+
className
|
|
2043
|
+
}) => {
|
|
2044
|
+
const containerRef = (0, import_react21.useRef)(null);
|
|
2045
|
+
(0, import_react21.useEffect)(() => {
|
|
2046
|
+
if (!meshStyleInjected) {
|
|
2047
|
+
meshStyleInjected = true;
|
|
2048
|
+
const style = document.createElement("style");
|
|
2049
|
+
style.textContent = `
|
|
2050
|
+
@keyframes uixy-mesh-1 {
|
|
2051
|
+
0%, 100% { transform: translate(0%, 0%) scale(1); }
|
|
2052
|
+
25% { transform: translate(30%, -20%) scale(1.1); }
|
|
2053
|
+
50% { transform: translate(-10%, 30%) scale(0.95); }
|
|
2054
|
+
75% { transform: translate(20%, 10%) scale(1.05); }
|
|
2055
|
+
}
|
|
2056
|
+
@keyframes uixy-mesh-2 {
|
|
2057
|
+
0%, 100% { transform: translate(0%, 0%) scale(1); }
|
|
2058
|
+
25% { transform: translate(-25%, 15%) scale(1.05); }
|
|
2059
|
+
50% { transform: translate(20%, -25%) scale(1.1); }
|
|
2060
|
+
75% { transform: translate(-15%, -10%) scale(0.9); }
|
|
2061
|
+
}
|
|
2062
|
+
@keyframes uixy-mesh-3 {
|
|
2063
|
+
0%, 100% { transform: translate(0%, 0%) scale(1.05); }
|
|
2064
|
+
33% { transform: translate(15%, 25%) scale(0.95); }
|
|
2065
|
+
66% { transform: translate(-20%, -15%) scale(1.1); }
|
|
2066
|
+
}
|
|
2067
|
+
@keyframes uixy-mesh-4 {
|
|
2068
|
+
0%, 100% { transform: translate(0%, 0%) scale(0.95); }
|
|
2069
|
+
33% { transform: translate(-30%, 10%) scale(1.1); }
|
|
2070
|
+
66% { transform: translate(10%, -30%) scale(1); }
|
|
2071
|
+
}
|
|
2072
|
+
`;
|
|
2073
|
+
document.head.appendChild(style);
|
|
2074
|
+
}
|
|
2075
|
+
}, []);
|
|
2076
|
+
const animations = [
|
|
2077
|
+
`uixy-mesh-1 ${12 / speed}s ease-in-out infinite`,
|
|
2078
|
+
`uixy-mesh-2 ${15 / speed}s ease-in-out infinite`,
|
|
2079
|
+
`uixy-mesh-3 ${18 / speed}s ease-in-out infinite`,
|
|
2080
|
+
`uixy-mesh-4 ${14 / speed}s ease-in-out infinite`
|
|
2081
|
+
];
|
|
2082
|
+
const positions = [
|
|
2083
|
+
{ top: "10%", left: "15%" },
|
|
2084
|
+
{ top: "60%", right: "10%" },
|
|
2085
|
+
{ bottom: "15%", left: "25%" },
|
|
2086
|
+
{ top: "30%", right: "30%" }
|
|
2087
|
+
];
|
|
2088
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2089
|
+
"div",
|
|
2090
|
+
{
|
|
2091
|
+
ref: containerRef,
|
|
2092
|
+
className: className != null ? className : "fixed inset-0 -z-10 pointer-events-none w-full h-full",
|
|
2093
|
+
style: { overflow: "hidden", position: "relative" },
|
|
2094
|
+
children: colors.slice(0, 4).map((color, i) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2095
|
+
"div",
|
|
2096
|
+
{
|
|
2097
|
+
style: {
|
|
2098
|
+
position: "absolute",
|
|
2099
|
+
width: "60%",
|
|
2100
|
+
height: "60%",
|
|
2101
|
+
borderRadius: "50%",
|
|
2102
|
+
background: `radial-gradient(circle, ${color} 0%, transparent 70%)`,
|
|
2103
|
+
opacity: 0.25 * intensity,
|
|
2104
|
+
filter: "blur(80px)",
|
|
2105
|
+
animation: animations[i],
|
|
2106
|
+
...positions[i]
|
|
2107
|
+
}
|
|
2108
|
+
},
|
|
2109
|
+
i
|
|
2110
|
+
))
|
|
2111
|
+
}
|
|
2112
|
+
);
|
|
2113
|
+
};
|
|
2114
|
+
GradientMeshBackground.displayName = "GradientMeshBackground";
|
|
2115
|
+
|
|
2116
|
+
// src/components/Background/MatrixRainBackground.tsx
|
|
2117
|
+
var import_react22 = require("react");
|
|
2118
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2119
|
+
var MatrixRainBackground = ({
|
|
2120
|
+
charset = "abcdefghijklmnopqrstuvwxyz0123456789@#$%&*<>{}[]",
|
|
2121
|
+
columnWidth = 20,
|
|
2122
|
+
speed = 1,
|
|
2123
|
+
color = "#22c55e",
|
|
2124
|
+
fontSize = 14,
|
|
2125
|
+
className
|
|
2126
|
+
}) => {
|
|
2127
|
+
const canvasRef = (0, import_react22.useRef)(null);
|
|
2128
|
+
const rafRef = (0, import_react22.useRef)(0);
|
|
2129
|
+
(0, import_react22.useEffect)(() => {
|
|
2130
|
+
const canvas = canvasRef.current;
|
|
2131
|
+
if (!canvas) return;
|
|
2132
|
+
const ctx = canvas.getContext("2d");
|
|
2133
|
+
if (!ctx) return;
|
|
2134
|
+
const resize = () => {
|
|
2135
|
+
canvas.width = canvas.offsetWidth;
|
|
2136
|
+
canvas.height = canvas.offsetHeight;
|
|
2137
|
+
};
|
|
2138
|
+
resize();
|
|
2139
|
+
window.addEventListener("resize", resize);
|
|
2140
|
+
const chars = charset.split("");
|
|
2141
|
+
let columns = Math.floor(canvas.width / columnWidth);
|
|
2142
|
+
let drops = Array.from({ length: columns }, () => Math.random() * -100);
|
|
2143
|
+
const draw = () => {
|
|
2144
|
+
const w = canvas.width;
|
|
2145
|
+
const h = canvas.height;
|
|
2146
|
+
const newCols = Math.floor(w / columnWidth);
|
|
2147
|
+
if (newCols !== columns) {
|
|
2148
|
+
columns = newCols;
|
|
2149
|
+
drops = Array.from({ length: columns }, () => Math.random() * -100);
|
|
2150
|
+
}
|
|
2151
|
+
ctx.fillStyle = "rgba(0, 0, 0, 0.06)";
|
|
2152
|
+
ctx.fillRect(0, 0, w, h);
|
|
2153
|
+
ctx.font = `${fontSize}px monospace`;
|
|
2154
|
+
for (let i = 0; i < columns; i++) {
|
|
2155
|
+
const char = chars[Math.floor(Math.random() * chars.length)];
|
|
2156
|
+
const x = i * columnWidth;
|
|
2157
|
+
const y = drops[i] * fontSize;
|
|
2158
|
+
ctx.fillStyle = color;
|
|
2159
|
+
ctx.globalAlpha = 0.9;
|
|
2160
|
+
ctx.fillText(char, x, y);
|
|
2161
|
+
ctx.globalAlpha = 0.3;
|
|
2162
|
+
const trailChar = chars[Math.floor(Math.random() * chars.length)];
|
|
2163
|
+
ctx.fillText(trailChar, x, y - fontSize);
|
|
2164
|
+
ctx.globalAlpha = 1;
|
|
2165
|
+
if (y > h && Math.random() > 0.98) {
|
|
2166
|
+
drops[i] = 0;
|
|
2167
|
+
}
|
|
2168
|
+
drops[i] += speed * 0.5;
|
|
2169
|
+
}
|
|
2170
|
+
rafRef.current = requestAnimationFrame(draw);
|
|
2171
|
+
};
|
|
2172
|
+
draw();
|
|
2173
|
+
return () => {
|
|
2174
|
+
cancelAnimationFrame(rafRef.current);
|
|
2175
|
+
window.removeEventListener("resize", resize);
|
|
2176
|
+
};
|
|
2177
|
+
}, [charset, columnWidth, speed, color, fontSize]);
|
|
2178
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2179
|
+
"canvas",
|
|
2180
|
+
{
|
|
2181
|
+
ref: canvasRef,
|
|
2182
|
+
className: className != null ? className : "fixed inset-0 -z-10 pointer-events-none w-full h-full",
|
|
2183
|
+
style: { display: "block", background: "black" }
|
|
2184
|
+
}
|
|
2185
|
+
);
|
|
2186
|
+
};
|
|
2187
|
+
MatrixRainBackground.displayName = "MatrixRainBackground";
|
|
2188
|
+
|
|
2189
|
+
// src/components/Background/BokehBackground.tsx
|
|
2190
|
+
var import_react23 = require("react");
|
|
2191
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2192
|
+
var bokehStyleInjected = false;
|
|
2193
|
+
var clipPaths = {
|
|
2194
|
+
circle: "",
|
|
2195
|
+
hexagon: "polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%)",
|
|
2196
|
+
diamond: "polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)",
|
|
2197
|
+
triangle: "polygon(50% 0%, 100% 100%, 0% 100%)",
|
|
2198
|
+
star: "polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)",
|
|
2199
|
+
ring: ""
|
|
2200
|
+
};
|
|
2201
|
+
var shapeKeys = ["circle", "hexagon", "diamond", "triangle", "star", "ring"];
|
|
2202
|
+
var BokehBackground = ({
|
|
2203
|
+
count = 15,
|
|
2204
|
+
colors = ["#8b5cf6", "#3b82f6", "#06b6d4", "#ec4899", "#f97316"],
|
|
2205
|
+
shape = "circle",
|
|
2206
|
+
speed = 1,
|
|
2207
|
+
sizeRange = [40, 200],
|
|
2208
|
+
className
|
|
2209
|
+
}) => {
|
|
2210
|
+
const containerRef = (0, import_react23.useRef)(null);
|
|
2211
|
+
(0, import_react23.useEffect)(() => {
|
|
2212
|
+
if (!bokehStyleInjected) {
|
|
2213
|
+
bokehStyleInjected = true;
|
|
2214
|
+
const style = document.createElement("style");
|
|
2215
|
+
style.textContent = `
|
|
2216
|
+
@keyframes uixy-bokeh-float {
|
|
2217
|
+
0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
|
|
2218
|
+
25% { transform: translate(var(--uixy-bk-dx1), var(--uixy-bk-dy1)) scale(var(--uixy-bk-s1)) rotate(var(--uixy-bk-r1)); }
|
|
2219
|
+
50% { transform: translate(var(--uixy-bk-dx2), var(--uixy-bk-dy2)) scale(var(--uixy-bk-s2)) rotate(var(--uixy-bk-r2)); }
|
|
2220
|
+
75% { transform: translate(var(--uixy-bk-dx3), var(--uixy-bk-dy3)) scale(var(--uixy-bk-s3)) rotate(var(--uixy-bk-r3)); }
|
|
2221
|
+
}
|
|
2222
|
+
`;
|
|
2223
|
+
document.head.appendChild(style);
|
|
2224
|
+
}
|
|
2225
|
+
}, []);
|
|
2226
|
+
const elements = Array.from({ length: count }, (_, i) => {
|
|
2227
|
+
const size = sizeRange[0] + Math.random() * (sizeRange[1] - sizeRange[0]);
|
|
2228
|
+
const color = colors[i % colors.length];
|
|
2229
|
+
const duration = (15 + Math.random() * 20) / speed;
|
|
2230
|
+
const rp = () => `${(Math.random() - 0.5) * 60}px`;
|
|
2231
|
+
const rs = () => `${0.8 + Math.random() * 0.4}`;
|
|
2232
|
+
const rr = () => `${(Math.random() - 0.5) * 40}deg`;
|
|
2233
|
+
const s = shape === "mixed" ? shapeKeys[i % shapeKeys.length] : shape;
|
|
2234
|
+
const isRing = s === "ring";
|
|
2235
|
+
const isCircle = s === "circle";
|
|
2236
|
+
const clip = clipPaths[s];
|
|
2237
|
+
const baseStyle = {
|
|
2238
|
+
position: "absolute",
|
|
2239
|
+
left: `${Math.random() * 100}%`,
|
|
2240
|
+
top: `${Math.random() * 100}%`,
|
|
2241
|
+
width: size,
|
|
2242
|
+
height: size,
|
|
2243
|
+
opacity: 0.35 + Math.random() * 0.3,
|
|
2244
|
+
filter: `blur(${1.5 + Math.random() * 3}px)`,
|
|
2245
|
+
animation: `uixy-bokeh-float ${duration}s ease-in-out infinite`,
|
|
2246
|
+
animationDelay: `${-Math.random() * duration}s`,
|
|
2247
|
+
"--uixy-bk-dx1": rp(),
|
|
2248
|
+
"--uixy-bk-dy1": rp(),
|
|
2249
|
+
"--uixy-bk-s1": rs(),
|
|
2250
|
+
"--uixy-bk-r1": rr(),
|
|
2251
|
+
"--uixy-bk-dx2": rp(),
|
|
2252
|
+
"--uixy-bk-dy2": rp(),
|
|
2253
|
+
"--uixy-bk-s2": rs(),
|
|
2254
|
+
"--uixy-bk-r2": rr(),
|
|
2255
|
+
"--uixy-bk-dx3": rp(),
|
|
2256
|
+
"--uixy-bk-dy3": rp(),
|
|
2257
|
+
"--uixy-bk-s3": rs(),
|
|
2258
|
+
"--uixy-bk-r3": rr()
|
|
2259
|
+
};
|
|
2260
|
+
if (isRing) {
|
|
2261
|
+
return {
|
|
2262
|
+
key: i,
|
|
2263
|
+
style: {
|
|
2264
|
+
...baseStyle,
|
|
2265
|
+
borderRadius: "50%",
|
|
2266
|
+
border: `${2 + Math.random() * 3}px solid ${color}50`,
|
|
2267
|
+
background: "transparent"
|
|
2268
|
+
}
|
|
2269
|
+
};
|
|
2270
|
+
}
|
|
2271
|
+
return {
|
|
2272
|
+
key: i,
|
|
2273
|
+
style: {
|
|
2274
|
+
...baseStyle,
|
|
2275
|
+
borderRadius: isCircle ? "50%" : "0",
|
|
2276
|
+
background: isCircle ? `radial-gradient(circle at 35% 35%, ${color}45, ${color}18, transparent)` : `linear-gradient(135deg, ${color}40, ${color}15, transparent)`,
|
|
2277
|
+
border: `1px solid ${color}20`,
|
|
2278
|
+
clipPath: clip || void 0
|
|
2279
|
+
}
|
|
2280
|
+
};
|
|
2281
|
+
});
|
|
2282
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2283
|
+
"div",
|
|
2284
|
+
{
|
|
2285
|
+
ref: containerRef,
|
|
2286
|
+
className: className != null ? className : "fixed inset-0 -z-10 pointer-events-none w-full h-full",
|
|
2287
|
+
style: { overflow: "hidden", position: "relative" },
|
|
2288
|
+
children: elements.map((c) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { style: c.style }, c.key))
|
|
2289
|
+
}
|
|
2290
|
+
);
|
|
2291
|
+
};
|
|
2292
|
+
BokehBackground.displayName = "BokehBackground";
|
|
2293
|
+
|
|
2294
|
+
// src/components/Background/PixelBackground.tsx
|
|
2295
|
+
var import_react24 = require("react");
|
|
2296
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2297
|
+
function hexToRgb(hex) {
|
|
2298
|
+
const h = hex.replace("#", "");
|
|
2299
|
+
return [
|
|
2300
|
+
parseInt(h.substring(0, 2), 16),
|
|
2301
|
+
parseInt(h.substring(2, 4), 16),
|
|
2302
|
+
parseInt(h.substring(4, 6), 16)
|
|
2303
|
+
];
|
|
2304
|
+
}
|
|
2305
|
+
function makeNoise(cols, rows) {
|
|
2306
|
+
const arr = new Float32Array(cols * rows);
|
|
2307
|
+
for (let i = 0; i < arr.length; i++) arr[i] = Math.random();
|
|
2308
|
+
return arr;
|
|
2309
|
+
}
|
|
2310
|
+
function smoothNoise(noise, cols, rows, x, y) {
|
|
2311
|
+
const x0 = Math.floor(x) % cols;
|
|
2312
|
+
const y0 = Math.floor(y) % rows;
|
|
2313
|
+
const x1 = (x0 + 1) % cols;
|
|
2314
|
+
const y1 = (y0 + 1) % rows;
|
|
2315
|
+
const fx = x - Math.floor(x);
|
|
2316
|
+
const fy = y - Math.floor(y);
|
|
2317
|
+
const sx = fx * fx * (3 - 2 * fx);
|
|
2318
|
+
const sy = fy * fy * (3 - 2 * fy);
|
|
2319
|
+
const n00 = noise[y0 * cols + x0];
|
|
2320
|
+
const n10 = noise[y0 * cols + x1];
|
|
2321
|
+
const n01 = noise[y1 * cols + x0];
|
|
2322
|
+
const n11 = noise[y1 * cols + x1];
|
|
2323
|
+
return (n00 * (1 - sx) + n10 * sx) * (1 - sy) + (n01 * (1 - sx) + n11 * sx) * sy;
|
|
2324
|
+
}
|
|
2325
|
+
var PixelBackground = ({
|
|
2326
|
+
variant = "rain",
|
|
2327
|
+
pixelSize = 8,
|
|
2328
|
+
colors,
|
|
2329
|
+
speed = 1,
|
|
2330
|
+
opacity = 0.6,
|
|
2331
|
+
className
|
|
2332
|
+
}) => {
|
|
2333
|
+
const canvasRef = (0, import_react24.useRef)(null);
|
|
2334
|
+
const rafRef = (0, import_react24.useRef)(0);
|
|
2335
|
+
(0, import_react24.useEffect)(() => {
|
|
2336
|
+
const canvas = canvasRef.current;
|
|
2337
|
+
if (!canvas) return;
|
|
2338
|
+
const ctx = canvas.getContext("2d");
|
|
2339
|
+
if (!ctx) return;
|
|
2340
|
+
const resize = () => {
|
|
2341
|
+
canvas.width = canvas.offsetWidth;
|
|
2342
|
+
canvas.height = canvas.offsetHeight;
|
|
2343
|
+
};
|
|
2344
|
+
resize();
|
|
2345
|
+
window.addEventListener("resize", resize);
|
|
2346
|
+
const ps = pixelSize;
|
|
2347
|
+
if (variant === "rain") {
|
|
2348
|
+
const palette = (colors || ["#8b5cf6", "#6366f1", "#3b82f6", "#06b6d4"]).map(hexToRgb);
|
|
2349
|
+
let cols = Math.ceil(canvas.width / ps);
|
|
2350
|
+
const makeDrop = (col, startY) => ({
|
|
2351
|
+
x: col,
|
|
2352
|
+
y: startY != null ? startY : -(Math.random() * 30),
|
|
2353
|
+
len: 4 + Math.floor(Math.random() * 12),
|
|
2354
|
+
speed: 0.15 + Math.random() * 0.25,
|
|
2355
|
+
color: palette[Math.floor(Math.random() * palette.length)]
|
|
2356
|
+
});
|
|
2357
|
+
let drops = [];
|
|
2358
|
+
cols = Math.ceil(canvas.width / ps);
|
|
2359
|
+
for (let c = 0; c < cols; c++) {
|
|
2360
|
+
if (Math.random() < 0.35) {
|
|
2361
|
+
drops.push(makeDrop(c));
|
|
2362
|
+
}
|
|
2363
|
+
}
|
|
2364
|
+
const draw = () => {
|
|
2365
|
+
const w = canvas.width;
|
|
2366
|
+
const h = canvas.height;
|
|
2367
|
+
const rows = Math.ceil(h / ps);
|
|
2368
|
+
cols = Math.ceil(w / ps);
|
|
2369
|
+
ctx.fillStyle = "rgba(0, 0, 0, 0.12)";
|
|
2370
|
+
ctx.fillRect(0, 0, w, h);
|
|
2371
|
+
for (const d of drops) {
|
|
2372
|
+
const headRow = Math.floor(d.y);
|
|
2373
|
+
for (let i = 0; i < d.len; i++) {
|
|
2374
|
+
const row = headRow - i;
|
|
2375
|
+
if (row < 0 || row >= rows) continue;
|
|
2376
|
+
const brightness = 1 - i / d.len;
|
|
2377
|
+
const a = brightness * brightness * opacity;
|
|
2378
|
+
const [r, g, b] = d.color;
|
|
2379
|
+
ctx.fillStyle = `rgba(${r}, ${g}, ${b}, ${a})`;
|
|
2380
|
+
ctx.fillRect(d.x * ps, row * ps, ps - 1, ps - 1);
|
|
2381
|
+
}
|
|
2382
|
+
const hr = Math.floor(d.y);
|
|
2383
|
+
if (hr >= 0 && hr < rows) {
|
|
2384
|
+
const [r, g, b] = d.color;
|
|
2385
|
+
ctx.fillStyle = `rgba(${r}, ${g}, ${b}, ${opacity * 0.3})`;
|
|
2386
|
+
ctx.fillRect(d.x * ps - 1, hr * ps - 1, ps + 2, ps + 2);
|
|
2387
|
+
}
|
|
2388
|
+
d.y += d.speed * speed;
|
|
2389
|
+
}
|
|
2390
|
+
drops = drops.filter((d) => {
|
|
2391
|
+
if ((d.y - d.len) * ps > h) {
|
|
2392
|
+
return false;
|
|
2393
|
+
}
|
|
2394
|
+
return true;
|
|
2395
|
+
});
|
|
2396
|
+
if (Math.random() < 0.3 * speed) {
|
|
2397
|
+
const col = Math.floor(Math.random() * cols);
|
|
2398
|
+
drops.push(makeDrop(col, -2));
|
|
2399
|
+
}
|
|
2400
|
+
rafRef.current = requestAnimationFrame(draw);
|
|
2401
|
+
};
|
|
2402
|
+
draw();
|
|
2403
|
+
} else if (variant === "life") {
|
|
2404
|
+
const palette = colors || ["#22c55e", "#16a34a", "#15803d"];
|
|
2405
|
+
const cols = Math.ceil(canvas.width / ps);
|
|
2406
|
+
const rows = Math.ceil(canvas.height / ps);
|
|
2407
|
+
let grid = Array.from(
|
|
2408
|
+
{ length: rows },
|
|
2409
|
+
() => Array.from({ length: cols }, () => Math.random() > 0.82 ? 1 : 0)
|
|
2410
|
+
);
|
|
2411
|
+
let ages = Array.from(
|
|
2412
|
+
{ length: rows },
|
|
2413
|
+
() => new Float32Array(cols)
|
|
2414
|
+
);
|
|
2415
|
+
let frame = 0;
|
|
2416
|
+
const draw = () => {
|
|
2417
|
+
ctx.fillStyle = "rgba(0, 0, 0, 0.15)";
|
|
2418
|
+
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
2419
|
+
for (let r = 0; r < rows; r++) {
|
|
2420
|
+
for (let c = 0; c < cols; c++) {
|
|
2421
|
+
if (grid[r][c]) {
|
|
2422
|
+
ages[r][c] = Math.min(ages[r][c] + 0.08, 1);
|
|
2423
|
+
} else {
|
|
2424
|
+
ages[r][c] = Math.max(ages[r][c] - 0.05, 0);
|
|
2425
|
+
}
|
|
2426
|
+
if (ages[r][c] > 0.01) {
|
|
2427
|
+
ctx.globalAlpha = ages[r][c] * opacity;
|
|
2428
|
+
ctx.fillStyle = palette[(r + c) % palette.length];
|
|
2429
|
+
ctx.fillRect(c * ps, r * ps, ps - 1, ps - 1);
|
|
2430
|
+
}
|
|
2431
|
+
}
|
|
2432
|
+
}
|
|
2433
|
+
ctx.globalAlpha = 1;
|
|
2434
|
+
frame++;
|
|
2435
|
+
if (frame % Math.max(1, Math.round(6 / speed)) === 0) {
|
|
2436
|
+
const next = grid.map((row) => [...row]);
|
|
2437
|
+
for (let r = 0; r < rows; r++) {
|
|
2438
|
+
for (let c = 0; c < cols; c++) {
|
|
2439
|
+
let n = 0;
|
|
2440
|
+
for (let dr = -1; dr <= 1; dr++) {
|
|
2441
|
+
for (let dc = -1; dc <= 1; dc++) {
|
|
2442
|
+
if (dr === 0 && dc === 0) continue;
|
|
2443
|
+
const nr = (r + dr + rows) % rows;
|
|
2444
|
+
const nc = (c + dc + cols) % cols;
|
|
2445
|
+
n += grid[nr][nc];
|
|
2446
|
+
}
|
|
2447
|
+
}
|
|
2448
|
+
if (grid[r][c]) {
|
|
2449
|
+
next[r][c] = n === 2 || n === 3 ? 1 : 0;
|
|
2450
|
+
} else {
|
|
2451
|
+
next[r][c] = n === 3 ? 1 : 0;
|
|
2452
|
+
}
|
|
2453
|
+
}
|
|
2454
|
+
}
|
|
2455
|
+
grid = next;
|
|
2456
|
+
let alive = 0;
|
|
2457
|
+
for (let r = 0; r < rows; r++) for (let c = 0; c < cols; c++) alive += grid[r][c];
|
|
2458
|
+
if (alive < rows * cols * 0.03) {
|
|
2459
|
+
for (let r = 0; r < rows; r++) {
|
|
2460
|
+
for (let c = 0; c < cols; c++) {
|
|
2461
|
+
if (Math.random() > 0.85) grid[r][c] = 1;
|
|
2462
|
+
}
|
|
2463
|
+
}
|
|
2464
|
+
}
|
|
2465
|
+
}
|
|
2466
|
+
rafRef.current = requestAnimationFrame(draw);
|
|
2467
|
+
};
|
|
2468
|
+
draw();
|
|
2469
|
+
} else if (variant === "terrain") {
|
|
2470
|
+
const palette = colors || ["#0f172a", "#1e3a5f", "#1a4731", "#365314", "#4d7c0f", "#65a30d", "#84cc16", "#a3e635"];
|
|
2471
|
+
const cols = Math.ceil(canvas.width / ps);
|
|
2472
|
+
const rows = Math.ceil(canvas.height / ps);
|
|
2473
|
+
const noise = (x, y, t2) => {
|
|
2474
|
+
return Math.sin(x * 0.04 + t2 * 0.7) * 0.35 + Math.sin(y * 0.06 - t2 * 0.5) * 0.25 + Math.sin((x + y) * 0.025 + t2 * 0.3) * 0.2 + Math.sin(x * 0.1 - y * 0.08 + t2 * 0.4) * 0.2;
|
|
2475
|
+
};
|
|
2476
|
+
let t = 0;
|
|
2477
|
+
const draw = () => {
|
|
2478
|
+
for (let r = 0; r < rows; r++) {
|
|
2479
|
+
for (let c = 0; c < cols; c++) {
|
|
2480
|
+
const n = (noise(c, r, t) + 1) / 2;
|
|
2481
|
+
const idx = Math.min(palette.length - 1, Math.floor(n * palette.length));
|
|
2482
|
+
ctx.globalAlpha = opacity;
|
|
2483
|
+
ctx.fillStyle = palette[idx];
|
|
2484
|
+
ctx.fillRect(c * ps, r * ps, ps, ps);
|
|
2485
|
+
}
|
|
2486
|
+
}
|
|
2487
|
+
ctx.globalAlpha = 1;
|
|
2488
|
+
t += 6e-3 * speed;
|
|
2489
|
+
rafRef.current = requestAnimationFrame(draw);
|
|
2490
|
+
};
|
|
2491
|
+
draw();
|
|
2492
|
+
} else {
|
|
2493
|
+
const palette = (colors || ["#8b5cf6", "#6366f1", "#3b82f6", "#06b6d4", "#14b8a6"]).map(hexToRgb);
|
|
2494
|
+
const cols = Math.ceil(canvas.width / ps);
|
|
2495
|
+
const rows = Math.ceil(canvas.height / ps);
|
|
2496
|
+
const noiseSize = 64;
|
|
2497
|
+
const noise1 = makeNoise(noiseSize, noiseSize);
|
|
2498
|
+
const noise2 = makeNoise(noiseSize, noiseSize);
|
|
2499
|
+
const noise3 = makeNoise(noiseSize, noiseSize);
|
|
2500
|
+
let t = 0;
|
|
2501
|
+
const draw = () => {
|
|
2502
|
+
for (let r = 0; r < rows; r++) {
|
|
2503
|
+
for (let c = 0; c < cols; c++) {
|
|
2504
|
+
const n1 = smoothNoise(noise1, noiseSize, noiseSize, c * 0.08 + t * 0.5, r * 0.08 + t * 0.3);
|
|
2505
|
+
const n2 = smoothNoise(noise2, noiseSize, noiseSize, c * 0.12 - t * 0.4, r * 0.12 + t * 0.2);
|
|
2506
|
+
const n3 = smoothNoise(noise3, noiseSize, noiseSize, c * 0.05 + t * 0.2, r * 0.05 - t * 0.35);
|
|
2507
|
+
const combined = n1 * 0.5 + n2 * 0.3 + n3 * 0.2;
|
|
2508
|
+
const pi = combined * (palette.length - 1);
|
|
2509
|
+
const idx0 = Math.floor(pi);
|
|
2510
|
+
const idx1 = Math.min(idx0 + 1, palette.length - 1);
|
|
2511
|
+
const frac = pi - idx0;
|
|
2512
|
+
const [r0, g0, b0] = palette[idx0];
|
|
2513
|
+
const [r1, g1, b1] = palette[idx1];
|
|
2514
|
+
const fr = Math.round(r0 + (r1 - r0) * frac);
|
|
2515
|
+
const fg = Math.round(g0 + (g1 - g0) * frac);
|
|
2516
|
+
const fb = Math.round(b0 + (b1 - b0) * frac);
|
|
2517
|
+
ctx.globalAlpha = opacity * (0.5 + combined * 0.5);
|
|
2518
|
+
ctx.fillStyle = `rgb(${fr}, ${fg}, ${fb})`;
|
|
2519
|
+
ctx.fillRect(c * ps, r * ps, ps, ps);
|
|
2520
|
+
}
|
|
2521
|
+
}
|
|
2522
|
+
ctx.globalAlpha = 1;
|
|
2523
|
+
t += 0.015 * speed;
|
|
2524
|
+
rafRef.current = requestAnimationFrame(draw);
|
|
2525
|
+
};
|
|
2526
|
+
draw();
|
|
2527
|
+
}
|
|
2528
|
+
return () => {
|
|
2529
|
+
cancelAnimationFrame(rafRef.current);
|
|
2530
|
+
window.removeEventListener("resize", resize);
|
|
2531
|
+
};
|
|
2532
|
+
}, [variant, pixelSize, colors, speed, opacity]);
|
|
2533
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2534
|
+
"canvas",
|
|
2535
|
+
{
|
|
2536
|
+
ref: canvasRef,
|
|
2537
|
+
className: className != null ? className : "fixed inset-0 -z-10 pointer-events-none w-full h-full",
|
|
2538
|
+
style: { display: "block", background: "#09090b", imageRendering: "pixelated" }
|
|
2539
|
+
}
|
|
2540
|
+
);
|
|
2541
|
+
};
|
|
2542
|
+
PixelBackground.displayName = "PixelBackground";
|
|
2543
|
+
|
|
2544
|
+
// src/components/Background/RippleBackground.tsx
|
|
2545
|
+
var import_react25 = require("react");
|
|
2546
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2547
|
+
var rippleStyleInjected = false;
|
|
2548
|
+
var RippleBackground = ({
|
|
2549
|
+
count = 6,
|
|
2550
|
+
color = "rgba(139, 92, 246, 0.15)",
|
|
2551
|
+
duration = 4,
|
|
2552
|
+
className
|
|
2553
|
+
}) => {
|
|
2554
|
+
(0, import_react25.useEffect)(() => {
|
|
2555
|
+
if (rippleStyleInjected) return;
|
|
2556
|
+
rippleStyleInjected = true;
|
|
2557
|
+
const style = document.createElement("style");
|
|
2558
|
+
style.textContent = `
|
|
2559
|
+
@keyframes uixy-ripple {
|
|
2560
|
+
0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
|
|
2561
|
+
100% { transform: translate(-50%, -50%) scale(4); opacity: 0; }
|
|
2562
|
+
}
|
|
2563
|
+
`;
|
|
2564
|
+
document.head.appendChild(style);
|
|
2565
|
+
}, []);
|
|
2566
|
+
const rings = Array.from({ length: count }, (_, i) => ({
|
|
2567
|
+
key: i,
|
|
2568
|
+
style: {
|
|
2569
|
+
position: "absolute",
|
|
2570
|
+
left: "50%",
|
|
2571
|
+
top: "50%",
|
|
2572
|
+
width: "200px",
|
|
2573
|
+
height: "200px",
|
|
2574
|
+
borderRadius: "50%",
|
|
2575
|
+
border: `1.5px solid ${color}`,
|
|
2576
|
+
boxShadow: `0 0 30px 2px ${color}`,
|
|
2577
|
+
animation: `uixy-ripple ${duration}s ease-out infinite`,
|
|
2578
|
+
animationDelay: `${i * duration / count}s`,
|
|
2579
|
+
pointerEvents: "none"
|
|
2580
|
+
}
|
|
2581
|
+
}));
|
|
2582
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2583
|
+
"div",
|
|
2584
|
+
{
|
|
2585
|
+
className: className != null ? className : "fixed inset-0 -z-10 pointer-events-none",
|
|
2586
|
+
style: { overflow: "hidden", position: "relative" },
|
|
2587
|
+
children: rings.map((r) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { style: r.style }, r.key))
|
|
2588
|
+
}
|
|
2589
|
+
);
|
|
2590
|
+
};
|
|
2591
|
+
RippleBackground.displayName = "RippleBackground";
|
|
2592
|
+
|
|
2593
|
+
// src/components/Background/DotPatternBackground.tsx
|
|
2594
|
+
var import_react26 = require("react");
|
|
2595
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2596
|
+
var DotPatternBackground = ({
|
|
2597
|
+
spacing = 24,
|
|
2598
|
+
radius = 1.2,
|
|
2599
|
+
color = "rgba(161, 161, 170, 0.25)",
|
|
2600
|
+
glow = false,
|
|
2601
|
+
glowColor,
|
|
2602
|
+
mouseReactive = true,
|
|
2603
|
+
mouseRadius = 120,
|
|
2604
|
+
className
|
|
2605
|
+
}) => {
|
|
2606
|
+
const canvasRef = (0, import_react26.useRef)(null);
|
|
2607
|
+
const mouseRef = (0, import_react26.useRef)({ x: -9999, y: -9999 });
|
|
2608
|
+
const rafRef = (0, import_react26.useRef)(0);
|
|
2609
|
+
(0, import_react26.useEffect)(() => {
|
|
2610
|
+
const canvas = canvasRef.current;
|
|
2611
|
+
if (!canvas) return;
|
|
2612
|
+
const ctx = canvas.getContext("2d");
|
|
2613
|
+
if (!ctx) return;
|
|
2614
|
+
const resize = () => {
|
|
2615
|
+
canvas.width = canvas.offsetWidth;
|
|
2616
|
+
canvas.height = canvas.offsetHeight;
|
|
2617
|
+
};
|
|
2618
|
+
resize();
|
|
2619
|
+
window.addEventListener("resize", resize);
|
|
2620
|
+
const onMouse = (e) => {
|
|
2621
|
+
const rect = canvas.getBoundingClientRect();
|
|
2622
|
+
mouseRef.current = { x: e.clientX - rect.left, y: e.clientY - rect.top };
|
|
2623
|
+
};
|
|
2624
|
+
if (mouseReactive) window.addEventListener("mousemove", onMouse);
|
|
2625
|
+
const cols = Math.ceil(3e3 / spacing);
|
|
2626
|
+
const rows = Math.ceil(2e3 / spacing);
|
|
2627
|
+
const phases = glow ? Array.from({ length: cols * rows }, () => ({
|
|
2628
|
+
offset: Math.random() * Math.PI * 2,
|
|
2629
|
+
speed: 0.5 + Math.random() * 2
|
|
2630
|
+
})) : [];
|
|
2631
|
+
let t = 0;
|
|
2632
|
+
const gc = glowColor || color;
|
|
2633
|
+
const draw = () => {
|
|
2634
|
+
const w = canvas.width;
|
|
2635
|
+
const h = canvas.height;
|
|
2636
|
+
ctx.clearRect(0, 0, w, h);
|
|
2637
|
+
const curCols = Math.ceil(w / spacing) + 1;
|
|
2638
|
+
const curRows = Math.ceil(h / spacing) + 1;
|
|
2639
|
+
const mx = mouseRef.current.x;
|
|
2640
|
+
const my = mouseRef.current.y;
|
|
2641
|
+
for (let r = 0; r < curRows; r++) {
|
|
2642
|
+
for (let c = 0; c < curCols; c++) {
|
|
2643
|
+
const x = c * spacing;
|
|
2644
|
+
const y = r * spacing;
|
|
2645
|
+
let dotRadius = radius;
|
|
2646
|
+
let dotAlpha = 1;
|
|
2647
|
+
if (mouseReactive) {
|
|
2648
|
+
const dx = mx - x;
|
|
2649
|
+
const dy = my - y;
|
|
2650
|
+
const dist = Math.sqrt(dx * dx + dy * dy);
|
|
2651
|
+
if (dist < mouseRadius) {
|
|
2652
|
+
const factor = 1 - dist / mouseRadius;
|
|
2653
|
+
dotRadius = radius + factor * radius * 2.5;
|
|
2654
|
+
dotAlpha = 1;
|
|
2655
|
+
}
|
|
2656
|
+
}
|
|
2657
|
+
if (glow) {
|
|
2658
|
+
const idx = (r * cols + c) % phases.length;
|
|
2659
|
+
if (idx < phases.length) {
|
|
2660
|
+
const p = phases[idx];
|
|
2661
|
+
const pulse = (Math.sin(t * p.speed + p.offset) + 1) / 2;
|
|
2662
|
+
dotRadius += pulse * radius * 1.5;
|
|
2663
|
+
dotAlpha *= 0.4 + pulse * 0.6;
|
|
2664
|
+
}
|
|
2665
|
+
}
|
|
2666
|
+
ctx.beginPath();
|
|
2667
|
+
ctx.arc(x, y, dotRadius, 0, Math.PI * 2);
|
|
2668
|
+
if (glow && dotRadius > radius * 1.5) {
|
|
2669
|
+
ctx.fillStyle = gc;
|
|
2670
|
+
ctx.shadowBlur = 8;
|
|
2671
|
+
ctx.shadowColor = gc;
|
|
2672
|
+
} else {
|
|
2673
|
+
ctx.fillStyle = color;
|
|
2674
|
+
ctx.shadowBlur = 0;
|
|
2675
|
+
}
|
|
2676
|
+
ctx.globalAlpha = dotAlpha;
|
|
2677
|
+
ctx.fill();
|
|
2678
|
+
}
|
|
2679
|
+
}
|
|
2680
|
+
ctx.globalAlpha = 1;
|
|
2681
|
+
ctx.shadowBlur = 0;
|
|
2682
|
+
t += 0.016;
|
|
2683
|
+
rafRef.current = requestAnimationFrame(draw);
|
|
2684
|
+
};
|
|
2685
|
+
draw();
|
|
2686
|
+
return () => {
|
|
2687
|
+
cancelAnimationFrame(rafRef.current);
|
|
2688
|
+
window.removeEventListener("resize", resize);
|
|
2689
|
+
window.removeEventListener("mousemove", onMouse);
|
|
2690
|
+
};
|
|
2691
|
+
}, [spacing, radius, color, glow, glowColor, mouseReactive, mouseRadius]);
|
|
2692
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2693
|
+
"canvas",
|
|
2694
|
+
{
|
|
2695
|
+
ref: canvasRef,
|
|
2696
|
+
className: className != null ? className : "fixed inset-0 -z-10 pointer-events-none w-full h-full",
|
|
2697
|
+
style: { display: "block" }
|
|
2698
|
+
}
|
|
2699
|
+
);
|
|
2700
|
+
};
|
|
2701
|
+
DotPatternBackground.displayName = "DotPatternBackground";
|
|
2702
|
+
|
|
2703
|
+
// src/components/Background/RetroGridBackground.tsx
|
|
2704
|
+
var import_react27 = require("react");
|
|
2705
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2706
|
+
function hexToRgba(hex, a) {
|
|
2707
|
+
const h = hex.replace("#", "");
|
|
2708
|
+
return `rgba(${parseInt(h.slice(0, 2), 16)},${parseInt(h.slice(2, 4), 16)},${parseInt(h.slice(4, 6), 16)},${a})`;
|
|
2709
|
+
}
|
|
2710
|
+
var RetroGridBackground = ({
|
|
2711
|
+
cellSize = 50,
|
|
2712
|
+
lineColor = "#8b5cf6",
|
|
2713
|
+
speed = 1,
|
|
2714
|
+
glow = true,
|
|
2715
|
+
verticalLines = 25,
|
|
2716
|
+
horizontalLines = 16,
|
|
2717
|
+
className
|
|
2718
|
+
}) => {
|
|
2719
|
+
const canvasRef = (0, import_react27.useRef)(null);
|
|
2720
|
+
const rafRef = (0, import_react27.useRef)(0);
|
|
2721
|
+
(0, import_react27.useEffect)(() => {
|
|
2722
|
+
const canvas = canvasRef.current;
|
|
2723
|
+
if (!canvas) return;
|
|
2724
|
+
const ctx = canvas.getContext("2d");
|
|
2725
|
+
if (!ctx) return;
|
|
2726
|
+
const resize = () => {
|
|
2727
|
+
canvas.width = canvas.offsetWidth;
|
|
2728
|
+
canvas.height = canvas.offsetHeight;
|
|
2729
|
+
};
|
|
2730
|
+
resize();
|
|
2731
|
+
window.addEventListener("resize", resize);
|
|
2732
|
+
let scrollY = 0;
|
|
2733
|
+
const draw = () => {
|
|
2734
|
+
const w = canvas.width;
|
|
2735
|
+
const h = canvas.height;
|
|
2736
|
+
ctx.clearRect(0, 0, w, h);
|
|
2737
|
+
const horizon = h * 0.35;
|
|
2738
|
+
const groundH = h - horizon;
|
|
2739
|
+
const cx = w / 2;
|
|
2740
|
+
ctx.lineWidth = 1;
|
|
2741
|
+
const half = Math.floor(verticalLines / 2);
|
|
2742
|
+
for (let i = -half; i <= half; i++) {
|
|
2743
|
+
const spread = i / half;
|
|
2744
|
+
const bottomX = cx + spread * w * 1.2;
|
|
2745
|
+
const edgeFade = 1 - Math.abs(spread) * 0.5;
|
|
2746
|
+
ctx.strokeStyle = hexToRgba(lineColor, 0.25 * edgeFade);
|
|
2747
|
+
ctx.beginPath();
|
|
2748
|
+
ctx.moveTo(cx, horizon);
|
|
2749
|
+
ctx.lineTo(bottomX, h);
|
|
2750
|
+
ctx.stroke();
|
|
2751
|
+
}
|
|
2752
|
+
const scrollPhase = scrollY % 1;
|
|
2753
|
+
for (let i = 0; i < horizontalLines + 2; i++) {
|
|
2754
|
+
const rawT = (i - scrollPhase) / horizontalLines;
|
|
2755
|
+
if (rawT < 0 || rawT > 1) continue;
|
|
2756
|
+
const perspT = rawT * rawT;
|
|
2757
|
+
const y = horizon + perspT * groundH;
|
|
2758
|
+
const alpha = 0.08 + rawT * 0.3;
|
|
2759
|
+
const thickness = 0.5 + rawT * 1;
|
|
2760
|
+
const spanFactor = rawT * 1.2;
|
|
2761
|
+
const leftX = cx - w * spanFactor;
|
|
2762
|
+
const rightX = cx + w * spanFactor;
|
|
2763
|
+
ctx.strokeStyle = hexToRgba(lineColor, alpha);
|
|
2764
|
+
ctx.lineWidth = thickness;
|
|
2765
|
+
ctx.beginPath();
|
|
2766
|
+
ctx.moveTo(leftX, y);
|
|
2767
|
+
ctx.lineTo(rightX, y);
|
|
2768
|
+
ctx.stroke();
|
|
2769
|
+
}
|
|
2770
|
+
if (glow) {
|
|
2771
|
+
const grad = ctx.createLinearGradient(0, 0, w, 0);
|
|
2772
|
+
grad.addColorStop(0, "transparent");
|
|
2773
|
+
grad.addColorStop(0.2, hexToRgba(lineColor, 0.4));
|
|
2774
|
+
grad.addColorStop(0.5, hexToRgba(lineColor, 0.9));
|
|
2775
|
+
grad.addColorStop(0.8, hexToRgba(lineColor, 0.4));
|
|
2776
|
+
grad.addColorStop(1, "transparent");
|
|
2777
|
+
ctx.strokeStyle = grad;
|
|
2778
|
+
ctx.lineWidth = 1.5;
|
|
2779
|
+
ctx.shadowBlur = 25;
|
|
2780
|
+
ctx.shadowColor = lineColor;
|
|
2781
|
+
ctx.beginPath();
|
|
2782
|
+
ctx.moveTo(0, horizon);
|
|
2783
|
+
ctx.lineTo(w, horizon);
|
|
2784
|
+
ctx.stroke();
|
|
2785
|
+
ctx.shadowBlur = 0;
|
|
2786
|
+
const vGrad = ctx.createLinearGradient(cx, horizon - 80, cx, horizon + 30);
|
|
2787
|
+
vGrad.addColorStop(0, "transparent");
|
|
2788
|
+
vGrad.addColorStop(0.5, hexToRgba(lineColor, 0.15));
|
|
2789
|
+
vGrad.addColorStop(1, "transparent");
|
|
2790
|
+
ctx.fillStyle = vGrad;
|
|
2791
|
+
ctx.fillRect(cx - 60, horizon - 80, 120, 110);
|
|
2792
|
+
const ambGrad = ctx.createRadialGradient(cx, horizon, 10, cx, horizon, w * 0.5);
|
|
2793
|
+
ambGrad.addColorStop(0, hexToRgba(lineColor, 0.06));
|
|
2794
|
+
ambGrad.addColorStop(1, "transparent");
|
|
2795
|
+
ctx.fillStyle = ambGrad;
|
|
2796
|
+
ctx.fillRect(0, horizon - 100, w, 200);
|
|
2797
|
+
ctx.fillStyle = hexToRgba(lineColor, 0.15);
|
|
2798
|
+
for (let i = 0; i < 30; i++) {
|
|
2799
|
+
const sx = i * 137.5 % w;
|
|
2800
|
+
const sy = i * 97.3 % (horizon - 10);
|
|
2801
|
+
const sr = 0.5 + i % 3 * 0.4;
|
|
2802
|
+
ctx.beginPath();
|
|
2803
|
+
ctx.arc(sx, sy, sr, 0, Math.PI * 2);
|
|
2804
|
+
ctx.fill();
|
|
2805
|
+
}
|
|
2806
|
+
}
|
|
2807
|
+
scrollY += 0.02 * speed;
|
|
2808
|
+
rafRef.current = requestAnimationFrame(draw);
|
|
2809
|
+
};
|
|
2810
|
+
draw();
|
|
2811
|
+
return () => {
|
|
2812
|
+
cancelAnimationFrame(rafRef.current);
|
|
2813
|
+
window.removeEventListener("resize", resize);
|
|
2814
|
+
};
|
|
2815
|
+
}, [cellSize, lineColor, speed, glow, verticalLines, horizontalLines]);
|
|
2816
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2817
|
+
"canvas",
|
|
2818
|
+
{
|
|
2819
|
+
ref: canvasRef,
|
|
2820
|
+
className: className != null ? className : "fixed inset-0 -z-10 pointer-events-none w-full h-full",
|
|
2821
|
+
style: { display: "block" }
|
|
2822
|
+
}
|
|
2823
|
+
);
|
|
2824
|
+
};
|
|
2825
|
+
RetroGridBackground.displayName = "RetroGridBackground";
|
|
2826
|
+
|
|
2827
|
+
// src/components/Background/MeteorBackground.tsx
|
|
2828
|
+
var import_react28 = require("react");
|
|
2829
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2830
|
+
var MeteorBackground = ({
|
|
2831
|
+
count = 20,
|
|
2832
|
+
angle = 215,
|
|
2833
|
+
color = "#a1a1aa",
|
|
2834
|
+
tailLength = 80,
|
|
2835
|
+
speed = 1,
|
|
2836
|
+
className
|
|
2837
|
+
}) => {
|
|
2838
|
+
const canvasRef = (0, import_react28.useRef)(null);
|
|
2839
|
+
const rafRef = (0, import_react28.useRef)(0);
|
|
2840
|
+
(0, import_react28.useEffect)(() => {
|
|
2841
|
+
const canvas = canvasRef.current;
|
|
2842
|
+
if (!canvas) return;
|
|
2843
|
+
const ctx = canvas.getContext("2d");
|
|
2844
|
+
if (!ctx) return;
|
|
2845
|
+
const resize = () => {
|
|
2846
|
+
canvas.width = canvas.offsetWidth;
|
|
2847
|
+
canvas.height = canvas.offsetHeight;
|
|
2848
|
+
};
|
|
2849
|
+
resize();
|
|
2850
|
+
window.addEventListener("resize", resize);
|
|
2851
|
+
const rad = angle * Math.PI / 180;
|
|
2852
|
+
const dx = Math.cos(rad);
|
|
2853
|
+
const dy = Math.sin(rad);
|
|
2854
|
+
const spawnMeteor = () => {
|
|
2855
|
+
const w = canvas.width;
|
|
2856
|
+
const h = canvas.height;
|
|
2857
|
+
return {
|
|
2858
|
+
x: Math.random() * (w + 400) - 200,
|
|
2859
|
+
y: -Math.random() * h * 0.5 - 50,
|
|
2860
|
+
speed: (2 + Math.random() * 4) * speed,
|
|
2861
|
+
length: tailLength * (0.5 + Math.random() * 1),
|
|
2862
|
+
opacity: 0.3 + Math.random() * 0.7,
|
|
2863
|
+
width: 0.5 + Math.random() * 1.5
|
|
2864
|
+
};
|
|
2865
|
+
};
|
|
2866
|
+
let meteors = Array.from({ length: count }, () => {
|
|
2867
|
+
const m = spawnMeteor();
|
|
2868
|
+
m.x += dx * Math.random() * canvas.height * 2;
|
|
2869
|
+
m.y += dy * Math.random() * canvas.height * 2;
|
|
2870
|
+
return m;
|
|
2871
|
+
});
|
|
2872
|
+
const draw = () => {
|
|
2873
|
+
const w = canvas.width;
|
|
2874
|
+
const h = canvas.height;
|
|
2875
|
+
ctx.clearRect(0, 0, w, h);
|
|
2876
|
+
for (const m of meteors) {
|
|
2877
|
+
const headX = m.x;
|
|
2878
|
+
const headY = m.y;
|
|
2879
|
+
const tailX = headX - dx * m.length;
|
|
2880
|
+
const tailY = headY - dy * m.length;
|
|
2881
|
+
const grad = ctx.createLinearGradient(tailX, tailY, headX, headY);
|
|
2882
|
+
grad.addColorStop(0, "transparent");
|
|
2883
|
+
grad.addColorStop(0.6, `${color}${Math.round(m.opacity * 100).toString(16).padStart(2, "0")}`);
|
|
2884
|
+
grad.addColorStop(1, color);
|
|
2885
|
+
ctx.beginPath();
|
|
2886
|
+
ctx.moveTo(tailX, tailY);
|
|
2887
|
+
ctx.lineTo(headX, headY);
|
|
2888
|
+
ctx.strokeStyle = grad;
|
|
2889
|
+
ctx.lineWidth = m.width;
|
|
2890
|
+
ctx.lineCap = "round";
|
|
2891
|
+
ctx.globalAlpha = m.opacity;
|
|
2892
|
+
ctx.stroke();
|
|
2893
|
+
ctx.beginPath();
|
|
2894
|
+
ctx.arc(headX, headY, m.width + 0.5, 0, Math.PI * 2);
|
|
2895
|
+
ctx.fillStyle = color;
|
|
2896
|
+
ctx.globalAlpha = m.opacity * 0.8;
|
|
2897
|
+
ctx.shadowBlur = 6;
|
|
2898
|
+
ctx.shadowColor = color;
|
|
2899
|
+
ctx.fill();
|
|
2900
|
+
ctx.shadowBlur = 0;
|
|
2901
|
+
m.x += dx * m.speed;
|
|
2902
|
+
m.y += dy * m.speed;
|
|
2903
|
+
if (m.x < -200 || m.x > w + 200 || m.y > h + 200) {
|
|
2904
|
+
Object.assign(m, spawnMeteor());
|
|
2905
|
+
}
|
|
2906
|
+
}
|
|
2907
|
+
ctx.globalAlpha = 1;
|
|
2908
|
+
rafRef.current = requestAnimationFrame(draw);
|
|
2909
|
+
};
|
|
2910
|
+
draw();
|
|
2911
|
+
return () => {
|
|
2912
|
+
cancelAnimationFrame(rafRef.current);
|
|
2913
|
+
window.removeEventListener("resize", resize);
|
|
2914
|
+
};
|
|
2915
|
+
}, [count, angle, color, tailLength, speed]);
|
|
2916
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2917
|
+
"canvas",
|
|
2918
|
+
{
|
|
2919
|
+
ref: canvasRef,
|
|
2920
|
+
className: className != null ? className : "fixed inset-0 -z-10 pointer-events-none w-full h-full",
|
|
2921
|
+
style: { display: "block" }
|
|
2922
|
+
}
|
|
2923
|
+
);
|
|
2924
|
+
};
|
|
2925
|
+
MeteorBackground.displayName = "MeteorBackground";
|
|
2926
|
+
|
|
2927
|
+
// src/components/Background/BeamsBackground.tsx
|
|
2928
|
+
var import_react29 = require("react");
|
|
2929
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2930
|
+
var beamsStyleInjected = false;
|
|
2931
|
+
var BeamsBackground = ({
|
|
2932
|
+
count = 8,
|
|
2933
|
+
colors = ["#8b5cf6", "#3b82f6", "#06b6d4", "#ec4899"],
|
|
2934
|
+
speed = 1,
|
|
2935
|
+
opacity = 0.12,
|
|
2936
|
+
beamWidth = 300,
|
|
2937
|
+
className
|
|
2938
|
+
}) => {
|
|
2939
|
+
(0, import_react29.useEffect)(() => {
|
|
2940
|
+
if (beamsStyleInjected) return;
|
|
2941
|
+
beamsStyleInjected = true;
|
|
2942
|
+
const style = document.createElement("style");
|
|
2943
|
+
style.textContent = `
|
|
2944
|
+
@keyframes uixy-beam-sway {
|
|
2945
|
+
0%, 100% { transform: rotate(var(--uixy-beam-r0)) scaleY(1); opacity: var(--uixy-beam-o); }
|
|
2946
|
+
25% { transform: rotate(var(--uixy-beam-r1)) scaleY(1.1); opacity: calc(var(--uixy-beam-o) * 1.3); }
|
|
2947
|
+
50% { transform: rotate(var(--uixy-beam-r2)) scaleY(0.9); opacity: var(--uixy-beam-o); }
|
|
2948
|
+
75% { transform: rotate(var(--uixy-beam-r3)) scaleY(1.05); opacity: calc(var(--uixy-beam-o) * 0.8); }
|
|
2949
|
+
}
|
|
2950
|
+
`;
|
|
2951
|
+
document.head.appendChild(style);
|
|
2952
|
+
}, []);
|
|
2953
|
+
const beams = Array.from({ length: count }, (_, i) => {
|
|
2954
|
+
const angle = -30 + i / (count - 1) * 60;
|
|
2955
|
+
const color = colors[i % colors.length];
|
|
2956
|
+
const duration = (12 + Math.random() * 10) / speed;
|
|
2957
|
+
const jitter = (Math.random() - 0.5) * 15;
|
|
2958
|
+
return {
|
|
2959
|
+
key: i,
|
|
2960
|
+
style: {
|
|
2961
|
+
position: "absolute",
|
|
2962
|
+
bottom: "-20%",
|
|
2963
|
+
left: "50%",
|
|
2964
|
+
width: `${beamWidth}px`,
|
|
2965
|
+
height: "160%",
|
|
2966
|
+
marginLeft: `${-beamWidth / 2}px`,
|
|
2967
|
+
transformOrigin: "center bottom",
|
|
2968
|
+
background: `linear-gradient(to top, ${color}00 0%, ${color} 30%, ${color}80 60%, transparent 100%)`,
|
|
2969
|
+
filter: `blur(${40 + Math.random() * 30}px)`,
|
|
2970
|
+
animation: `uixy-beam-sway ${duration}s ease-in-out infinite`,
|
|
2971
|
+
animationDelay: `${-Math.random() * duration}s`,
|
|
2972
|
+
"--uixy-beam-r0": `${angle + jitter}deg`,
|
|
2973
|
+
"--uixy-beam-r1": `${angle + jitter + 5}deg`,
|
|
2974
|
+
"--uixy-beam-r2": `${angle + jitter - 4}deg`,
|
|
2975
|
+
"--uixy-beam-r3": `${angle + jitter + 3}deg`,
|
|
2976
|
+
"--uixy-beam-o": String(opacity),
|
|
2977
|
+
pointerEvents: "none",
|
|
2978
|
+
mixBlendMode: "screen"
|
|
2979
|
+
}
|
|
2980
|
+
};
|
|
2981
|
+
});
|
|
2982
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2983
|
+
"div",
|
|
2984
|
+
{
|
|
2985
|
+
className: className != null ? className : "fixed inset-0 -z-10 pointer-events-none",
|
|
2986
|
+
style: { overflow: "hidden", position: "relative" },
|
|
2987
|
+
children: beams.map((b) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { style: b.style }, b.key))
|
|
2988
|
+
}
|
|
2989
|
+
);
|
|
2990
|
+
};
|
|
2991
|
+
BeamsBackground.displayName = "BeamsBackground";
|
|
2992
|
+
|
|
2993
|
+
// src/components/Other/Badge.tsx
|
|
2994
|
+
var import_react30 = require("react");
|
|
2995
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2996
|
+
var badgeStyleInjected = false;
|
|
2997
|
+
var Badge = (0, import_react30.forwardRef)(
|
|
2998
|
+
({ variant = "default", size = "md", dot, dotColor, pill = true, icon, className, children, ...props }, ref) => {
|
|
2999
|
+
(0, import_react30.useEffect)(() => {
|
|
3000
|
+
if (!badgeStyleInjected) {
|
|
3001
|
+
badgeStyleInjected = true;
|
|
3002
|
+
const style = document.createElement("style");
|
|
3003
|
+
style.textContent = `
|
|
3004
|
+
@keyframes uixy-badge-shimmer {
|
|
3005
|
+
0% { background-position: -200% center; }
|
|
3006
|
+
100% { background-position: 200% center; }
|
|
3007
|
+
}
|
|
3008
|
+
`;
|
|
3009
|
+
document.head.appendChild(style);
|
|
3010
|
+
}
|
|
3011
|
+
}, []);
|
|
3012
|
+
const variants = {
|
|
3013
|
+
default: "bg-violet-500/15 text-violet-400 border-violet-500/20",
|
|
3014
|
+
secondary: "bg-zinc-500/15 text-zinc-400 border-zinc-500/20",
|
|
3015
|
+
outline: "bg-transparent text-zinc-300 border-zinc-600",
|
|
3016
|
+
success: "bg-emerald-500/15 text-emerald-400 border-emerald-500/20",
|
|
3017
|
+
warning: "bg-amber-500/15 text-amber-400 border-amber-500/20",
|
|
3018
|
+
destructive: "bg-red-500/15 text-red-400 border-red-500/20",
|
|
3019
|
+
glow: "bg-violet-500/15 text-violet-400 border-violet-500/30 shadow-[0_0_8px_rgba(139,92,246,0.3)]",
|
|
3020
|
+
gradient: "bg-gradient-to-r from-violet-500/20 to-indigo-500/20 text-violet-300 border-violet-500/20",
|
|
3021
|
+
glass: "bg-white/5 backdrop-blur-md text-zinc-200 border-white/10",
|
|
3022
|
+
neon: "bg-transparent text-cyan-400 border-cyan-400/50 shadow-[0_0_6px_rgba(34,211,238,0.4),inset_0_0_6px_rgba(34,211,238,0.1)]",
|
|
3023
|
+
shimmer: "text-zinc-200 border-zinc-700",
|
|
3024
|
+
soft: "bg-violet-500/8 text-violet-300 border-transparent",
|
|
3025
|
+
info: "bg-blue-500/15 text-blue-400 border-blue-500/20",
|
|
3026
|
+
premium: "bg-gradient-to-r from-amber-500/20 via-yellow-400/20 to-amber-500/20 text-amber-300 border-amber-500/25",
|
|
3027
|
+
new: "bg-gradient-to-r from-emerald-500/20 to-teal-500/20 text-emerald-300 border-emerald-500/20",
|
|
3028
|
+
beta: "bg-gradient-to-r from-indigo-500/20 to-purple-500/20 text-indigo-300 border-indigo-500/20"
|
|
3029
|
+
};
|
|
3030
|
+
const sizes = {
|
|
3031
|
+
sm: "text-[10px] px-1.5 py-0.5 gap-1",
|
|
3032
|
+
md: "text-xs px-2.5 py-0.5 gap-1.5",
|
|
3033
|
+
lg: "text-sm px-3 py-1 gap-1.5"
|
|
3034
|
+
};
|
|
3035
|
+
const dotColors = {
|
|
3036
|
+
default: "bg-violet-400",
|
|
3037
|
+
secondary: "bg-zinc-400",
|
|
3038
|
+
outline: "bg-zinc-400",
|
|
3039
|
+
success: "bg-emerald-400",
|
|
3040
|
+
warning: "bg-amber-400",
|
|
3041
|
+
destructive: "bg-red-400",
|
|
3042
|
+
glow: "bg-violet-400",
|
|
3043
|
+
gradient: "bg-violet-400",
|
|
3044
|
+
glass: "bg-zinc-300",
|
|
3045
|
+
neon: "bg-cyan-400",
|
|
3046
|
+
shimmer: "bg-zinc-400",
|
|
3047
|
+
soft: "bg-violet-400",
|
|
3048
|
+
info: "bg-blue-400",
|
|
3049
|
+
premium: "bg-amber-400",
|
|
3050
|
+
new: "bg-emerald-400",
|
|
3051
|
+
beta: "bg-indigo-400"
|
|
3052
|
+
};
|
|
3053
|
+
const shimmerStyle = variant === "shimmer" ? {
|
|
3054
|
+
backgroundImage: "linear-gradient(90deg, transparent 25%, rgba(255,255,255,0.08) 50%, transparent 75%)",
|
|
3055
|
+
backgroundSize: "200% 100%",
|
|
3056
|
+
animation: "uixy-badge-shimmer 2s ease-in-out infinite"
|
|
3057
|
+
} : {};
|
|
3058
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
3059
|
+
"span",
|
|
3060
|
+
{
|
|
3061
|
+
ref,
|
|
3062
|
+
className: cn(
|
|
3063
|
+
"inline-flex items-center font-medium border whitespace-nowrap transition-colors",
|
|
3064
|
+
pill ? "rounded-full" : "rounded-md",
|
|
3065
|
+
variants[variant],
|
|
3066
|
+
sizes[size],
|
|
3067
|
+
className
|
|
3068
|
+
),
|
|
3069
|
+
style: shimmerStyle,
|
|
3070
|
+
...props,
|
|
3071
|
+
children: [
|
|
3072
|
+
dot && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3073
|
+
"span",
|
|
3074
|
+
{
|
|
3075
|
+
className: cn("w-1.5 h-1.5 rounded-full animate-pulse shrink-0", dotColor ? "" : dotColors[variant]),
|
|
3076
|
+
style: dotColor ? { backgroundColor: dotColor } : void 0
|
|
3077
|
+
}
|
|
3078
|
+
),
|
|
3079
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "shrink-0 [&>svg]:w-3 [&>svg]:h-3", children: icon }),
|
|
3080
|
+
children
|
|
3081
|
+
]
|
|
3082
|
+
}
|
|
3083
|
+
);
|
|
3084
|
+
}
|
|
3085
|
+
);
|
|
3086
|
+
Badge.displayName = "Badge";
|
|
3087
|
+
|
|
3088
|
+
// src/components/Other/Tooltip.tsx
|
|
3089
|
+
var import_react31 = require("react");
|
|
3090
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
3091
|
+
var tooltipStyleInjected = false;
|
|
3092
|
+
var Tooltip = ({
|
|
3093
|
+
content,
|
|
3094
|
+
side = "top",
|
|
3095
|
+
variant = "default",
|
|
3096
|
+
delay = 300,
|
|
3097
|
+
arrow = true,
|
|
3098
|
+
children,
|
|
3099
|
+
className
|
|
3100
|
+
}) => {
|
|
3101
|
+
const [state, setState] = (0, import_react31.useState)("hidden");
|
|
3102
|
+
const timerRef = (0, import_react31.useRef)();
|
|
3103
|
+
(0, import_react31.useEffect)(() => {
|
|
3104
|
+
if (!tooltipStyleInjected) {
|
|
3105
|
+
tooltipStyleInjected = true;
|
|
3106
|
+
const style = document.createElement("style");
|
|
3107
|
+
style.textContent = `
|
|
3108
|
+
.uixy-tt { pointer-events: none; }
|
|
3109
|
+
.uixy-tt[data-state="entering"] { opacity: 0; transform: translateY(var(--uixy-tt-dy,0)) translateX(var(--uixy-tt-dx,0)) scale(0.95); }
|
|
3110
|
+
.uixy-tt[data-state="visible"] { opacity: 1; transform: translateY(0) translateX(0) scale(1); transition: opacity .15s ease-out, transform .15s ease-out; }
|
|
3111
|
+
.uixy-tt[data-state="leaving"] { opacity: 0; transform: scale(0.97); transition: opacity .1s ease-in, transform .1s ease-in; }
|
|
3112
|
+
`;
|
|
3113
|
+
document.head.appendChild(style);
|
|
3114
|
+
}
|
|
3115
|
+
}, []);
|
|
3116
|
+
const show = (0, import_react31.useCallback)(() => {
|
|
3117
|
+
clearTimeout(timerRef.current);
|
|
3118
|
+
timerRef.current = setTimeout(() => {
|
|
3119
|
+
setState("entering");
|
|
3120
|
+
requestAnimationFrame(() => {
|
|
3121
|
+
requestAnimationFrame(() => setState("visible"));
|
|
3122
|
+
});
|
|
3123
|
+
}, delay);
|
|
3124
|
+
}, [delay]);
|
|
3125
|
+
const hide = (0, import_react31.useCallback)(() => {
|
|
3126
|
+
clearTimeout(timerRef.current);
|
|
3127
|
+
setState("leaving");
|
|
3128
|
+
timerRef.current = setTimeout(() => setState("hidden"), 120);
|
|
3129
|
+
}, []);
|
|
3130
|
+
(0, import_react31.useEffect)(() => () => clearTimeout(timerRef.current), []);
|
|
3131
|
+
const variants = {
|
|
3132
|
+
default: "bg-zinc-800 text-zinc-100 border border-zinc-700",
|
|
3133
|
+
dark: "bg-zinc-950 text-zinc-100 border border-zinc-800",
|
|
3134
|
+
light: "bg-zinc-100 text-zinc-900 border border-zinc-200",
|
|
3135
|
+
gradient: "bg-gradient-to-r from-violet-600 to-indigo-600 text-white",
|
|
3136
|
+
glass: "bg-white/10 backdrop-blur-md text-zinc-100 border border-white/20",
|
|
3137
|
+
outlined: "bg-transparent text-zinc-300 border-2 border-zinc-500",
|
|
3138
|
+
neon: "bg-zinc-950 text-violet-300 border border-violet-500/50 shadow-[0_0_12px_rgba(139,92,246,0.3)]",
|
|
3139
|
+
success: "bg-emerald-950 text-emerald-200 border border-emerald-700/50",
|
|
3140
|
+
warning: "bg-amber-950 text-amber-200 border border-amber-700/50",
|
|
3141
|
+
error: "bg-red-950 text-red-200 border border-red-700/50"
|
|
3142
|
+
};
|
|
3143
|
+
const arrowBg = {
|
|
3144
|
+
default: "bg-zinc-800 border-zinc-700",
|
|
3145
|
+
dark: "bg-zinc-950 border-zinc-800",
|
|
3146
|
+
light: "bg-zinc-100 border-zinc-200",
|
|
3147
|
+
gradient: "bg-violet-600 border-violet-600",
|
|
3148
|
+
glass: "bg-white/10 border-white/20",
|
|
3149
|
+
outlined: "bg-zinc-950 border-zinc-500",
|
|
3150
|
+
neon: "bg-zinc-950 border-violet-500/50",
|
|
3151
|
+
success: "bg-emerald-950 border-emerald-700/50",
|
|
3152
|
+
warning: "bg-amber-950 border-amber-700/50",
|
|
3153
|
+
error: "bg-red-950 border-red-700/50"
|
|
3154
|
+
};
|
|
3155
|
+
const slideVars = {
|
|
3156
|
+
top: { "--uixy-tt-dy": "4px", "--uixy-tt-dx": "0" },
|
|
3157
|
+
bottom: { "--uixy-tt-dy": "-4px", "--uixy-tt-dx": "0" },
|
|
3158
|
+
left: { "--uixy-tt-dx": "4px", "--uixy-tt-dy": "0" },
|
|
3159
|
+
right: { "--uixy-tt-dx": "-4px", "--uixy-tt-dy": "0" }
|
|
3160
|
+
};
|
|
3161
|
+
const positionStyle = {
|
|
3162
|
+
top: { bottom: "100%", left: "50%", transform: "translateX(-50%)", marginBottom: 8 },
|
|
3163
|
+
bottom: { top: "100%", left: "50%", transform: "translateX(-50%)", marginTop: 8 },
|
|
3164
|
+
left: { right: "100%", top: "50%", transform: "translateY(-50%)", marginRight: 8 },
|
|
3165
|
+
right: { left: "100%", top: "50%", transform: "translateY(-50%)", marginLeft: 8 }
|
|
3166
|
+
};
|
|
3167
|
+
const arrowSide = {
|
|
3168
|
+
top: { bottom: -4, left: "50%", marginLeft: -4 },
|
|
3169
|
+
bottom: { top: -4, left: "50%", marginLeft: -4 },
|
|
3170
|
+
left: { right: -4, top: "50%", marginTop: -4 },
|
|
3171
|
+
right: { left: -4, top: "50%", marginTop: -4 }
|
|
3172
|
+
};
|
|
3173
|
+
const arrowBorderSide = {
|
|
3174
|
+
top: "border-b border-r",
|
|
3175
|
+
bottom: "border-t border-l",
|
|
3176
|
+
left: "border-t border-r",
|
|
3177
|
+
right: "border-b border-l"
|
|
3178
|
+
};
|
|
3179
|
+
if (state === "hidden") {
|
|
3180
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "relative inline-flex", onMouseEnter: show, onMouseLeave: hide, onFocus: show, onBlur: hide, children });
|
|
3181
|
+
}
|
|
3182
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "relative inline-flex", onMouseEnter: show, onMouseLeave: hide, onFocus: show, onBlur: hide, children: [
|
|
3183
|
+
children,
|
|
3184
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
3185
|
+
"div",
|
|
3186
|
+
{
|
|
3187
|
+
className: cn(
|
|
3188
|
+
"uixy-tt absolute z-50 px-3 py-1.5 text-xs font-medium rounded-lg whitespace-nowrap shadow-lg",
|
|
3189
|
+
variants[variant],
|
|
3190
|
+
className
|
|
3191
|
+
),
|
|
3192
|
+
style: { ...positionStyle[side], ...slideVars[side] },
|
|
3193
|
+
"data-state": state,
|
|
3194
|
+
role: "tooltip",
|
|
3195
|
+
children: [
|
|
3196
|
+
content,
|
|
3197
|
+
arrow && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3198
|
+
"span",
|
|
3199
|
+
{
|
|
3200
|
+
className: cn("absolute w-2 h-2 rotate-45", arrowBorderSide[side], arrowBg[variant]),
|
|
3201
|
+
style: arrowSide[side]
|
|
3202
|
+
}
|
|
3203
|
+
)
|
|
3204
|
+
]
|
|
3205
|
+
}
|
|
3206
|
+
)
|
|
3207
|
+
] });
|
|
3208
|
+
};
|
|
3209
|
+
Tooltip.displayName = "Tooltip";
|
|
3210
|
+
|
|
3211
|
+
// src/components/Other/Toggle.tsx
|
|
3212
|
+
var import_react32 = require("react");
|
|
3213
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
3214
|
+
var toggleStyleInjected = false;
|
|
3215
|
+
var Toggle = (0, import_react32.forwardRef)(
|
|
3216
|
+
({ size = "md", variant = "default", color, label, className, checked, disabled, ...props }, ref) => {
|
|
3217
|
+
(0, import_react32.useEffect)(() => {
|
|
3218
|
+
if (!toggleStyleInjected) {
|
|
3219
|
+
toggleStyleInjected = true;
|
|
3220
|
+
const style = document.createElement("style");
|
|
3221
|
+
style.textContent = `
|
|
3222
|
+
.uixy-toggle-thumb {
|
|
3223
|
+
transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
|
|
3224
|
+
}
|
|
3225
|
+
.uixy-toggle-track {
|
|
3226
|
+
transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
|
|
3227
|
+
}
|
|
3228
|
+
`;
|
|
3229
|
+
document.head.appendChild(style);
|
|
3230
|
+
}
|
|
3231
|
+
}, []);
|
|
3232
|
+
const sizes = {
|
|
3233
|
+
sm: { trackW: 32, trackH: 18, thumb: 14, pad: 2 },
|
|
3234
|
+
md: { trackW: 44, trackH: 24, thumb: 18, pad: 3 },
|
|
3235
|
+
lg: { trackW: 56, trackH: 30, thumb: 24, pad: 3 }
|
|
3236
|
+
};
|
|
3237
|
+
const s = sizes[size];
|
|
3238
|
+
const translatePx = s.trackW - s.thumb - s.pad * 2;
|
|
3239
|
+
const activeColor = color || "#8b5cf6";
|
|
3240
|
+
const trackStyles = { width: s.trackW, height: s.trackH };
|
|
3241
|
+
const thumbStyles = {
|
|
3242
|
+
width: s.thumb,
|
|
3243
|
+
height: s.thumb,
|
|
3244
|
+
transform: checked ? `translateX(${translatePx}px)` : "translateX(0px)"
|
|
3245
|
+
};
|
|
3246
|
+
let trackClasses = "uixy-toggle-track rounded-full relative cursor-pointer";
|
|
3247
|
+
let thumbClasses = "uixy-toggle-thumb absolute rounded-full shadow-sm";
|
|
3248
|
+
if (variant === "default" || variant === "ios") {
|
|
3249
|
+
trackStyles.backgroundColor = checked ? activeColor : "rgb(63, 63, 70)";
|
|
3250
|
+
thumbStyles.backgroundColor = "white";
|
|
3251
|
+
thumbStyles.top = s.pad;
|
|
3252
|
+
thumbStyles.left = s.pad;
|
|
3253
|
+
if (variant === "ios" && checked) {
|
|
3254
|
+
thumbStyles.boxShadow = "0 2px 8px rgba(0,0,0,0.2)";
|
|
3255
|
+
}
|
|
3256
|
+
} else if (variant === "material") {
|
|
3257
|
+
trackStyles.backgroundColor = checked ? `${activeColor}60` : "rgb(82, 82, 91)";
|
|
3258
|
+
thumbStyles.backgroundColor = checked ? activeColor : "rgb(161, 161, 170)";
|
|
3259
|
+
thumbStyles.top = s.pad - 1;
|
|
3260
|
+
thumbStyles.left = s.pad;
|
|
3261
|
+
thumbStyles.width = s.thumb + 2;
|
|
3262
|
+
thumbStyles.height = s.thumb + 2;
|
|
3263
|
+
thumbStyles.boxShadow = "0 2px 6px rgba(0,0,0,0.3)";
|
|
3264
|
+
} else if (variant === "outline") {
|
|
3265
|
+
trackStyles.backgroundColor = "transparent";
|
|
3266
|
+
trackStyles.border = `2px solid ${checked ? activeColor : "rgb(113, 113, 122)"}`;
|
|
3267
|
+
thumbStyles.backgroundColor = checked ? activeColor : "rgb(161, 161, 170)";
|
|
3268
|
+
thumbStyles.top = s.pad;
|
|
3269
|
+
thumbStyles.left = s.pad;
|
|
3270
|
+
} else if (variant === "glow") {
|
|
3271
|
+
trackStyles.backgroundColor = checked ? activeColor : "rgb(63, 63, 70)";
|
|
3272
|
+
if (checked) {
|
|
3273
|
+
trackStyles.boxShadow = `0 0 12px ${activeColor}60, 0 0 24px ${activeColor}30`;
|
|
3274
|
+
}
|
|
3275
|
+
thumbStyles.backgroundColor = "white";
|
|
3276
|
+
thumbStyles.top = s.pad;
|
|
3277
|
+
thumbStyles.left = s.pad;
|
|
3278
|
+
} else if (variant === "pill") {
|
|
3279
|
+
trackStyles.backgroundColor = checked ? activeColor : "rgb(63, 63, 70)";
|
|
3280
|
+
trackClasses += " " + (size === "sm" ? "!rounded-sm" : size === "md" ? "!rounded-md" : "!rounded-lg");
|
|
3281
|
+
thumbClasses = thumbClasses.replace("rounded-full", size === "sm" ? "rounded-[2px]" : size === "md" ? "rounded-[4px]" : "rounded-[6px]");
|
|
3282
|
+
thumbStyles.backgroundColor = "white";
|
|
3283
|
+
thumbStyles.top = s.pad;
|
|
3284
|
+
thumbStyles.left = s.pad;
|
|
3285
|
+
} else if (variant === "slim") {
|
|
3286
|
+
trackStyles.height = Math.round(s.trackH * 0.55);
|
|
3287
|
+
trackStyles.backgroundColor = checked ? `${activeColor}60` : "rgb(63, 63, 70)";
|
|
3288
|
+
trackStyles.borderRadius = s.trackH;
|
|
3289
|
+
thumbStyles.backgroundColor = checked ? activeColor : "rgb(161, 161, 170)";
|
|
3290
|
+
thumbStyles.top = -Math.round((s.thumb - Math.round(s.trackH * 0.55)) / 2);
|
|
3291
|
+
thumbStyles.left = s.pad;
|
|
3292
|
+
thumbStyles.boxShadow = "0 1px 4px rgba(0,0,0,0.3)";
|
|
3293
|
+
} else if (variant === "labeled") {
|
|
3294
|
+
trackStyles.backgroundColor = checked ? activeColor : "rgb(63, 63, 70)";
|
|
3295
|
+
thumbStyles.backgroundColor = "white";
|
|
3296
|
+
thumbStyles.top = s.pad;
|
|
3297
|
+
thumbStyles.left = s.pad;
|
|
3298
|
+
}
|
|
3299
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("label", { className: cn("inline-flex items-center gap-2.5 cursor-pointer select-none", disabled && "opacity-50 cursor-not-allowed", className), children: [
|
|
3300
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "relative", children: [
|
|
3301
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("input", { ref, type: "checkbox", className: "sr-only peer", checked, disabled, ...props }),
|
|
3302
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: trackClasses, style: trackStyles, children: variant === "labeled" && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
3303
|
+
"span",
|
|
3304
|
+
{
|
|
3305
|
+
className: "absolute inset-0 flex items-center text-white font-bold select-none",
|
|
3306
|
+
style: { fontSize: Math.round(s.thumb * 0.45), paddingLeft: s.pad + 3, paddingRight: s.pad + 3, justifyContent: checked ? "flex-start" : "flex-end" },
|
|
3307
|
+
children: checked ? "ON" : "OFF"
|
|
3308
|
+
}
|
|
3309
|
+
) }),
|
|
3310
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: thumbClasses, style: thumbStyles })
|
|
3311
|
+
] }),
|
|
3312
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-sm text-zinc-300", children: label })
|
|
3313
|
+
] });
|
|
3314
|
+
}
|
|
3315
|
+
);
|
|
3316
|
+
Toggle.displayName = "Toggle";
|
|
3317
|
+
|
|
3318
|
+
// src/components/Other/Separator.tsx
|
|
3319
|
+
var import_react33 = require("react");
|
|
3320
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
3321
|
+
var Separator = (0, import_react33.forwardRef)(
|
|
3322
|
+
({ orientation = "horizontal", variant = "default", label, className, ...props }, ref) => {
|
|
3323
|
+
const isH = orientation === "horizontal";
|
|
3324
|
+
if (variant === "gradient") {
|
|
3325
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3326
|
+
"div",
|
|
3327
|
+
{
|
|
3328
|
+
ref,
|
|
3329
|
+
role: "separator",
|
|
3330
|
+
className: cn(
|
|
3331
|
+
isH ? "w-full h-px" : "h-full w-px",
|
|
3332
|
+
className
|
|
3333
|
+
),
|
|
3334
|
+
style: {
|
|
3335
|
+
background: isH ? "linear-gradient(to right, transparent, rgba(113,113,122,0.5), transparent)" : "linear-gradient(to bottom, transparent, rgba(113,113,122,0.5), transparent)"
|
|
3336
|
+
},
|
|
3337
|
+
...props
|
|
3338
|
+
}
|
|
3339
|
+
);
|
|
3340
|
+
}
|
|
3341
|
+
const styles = {
|
|
3342
|
+
default: "border-solid",
|
|
3343
|
+
dashed: "border-dashed",
|
|
3344
|
+
dotted: "border-dotted"
|
|
3345
|
+
};
|
|
3346
|
+
if (label && isH) {
|
|
3347
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { ref, role: "separator", className: cn("flex items-center gap-3", className), ...props, children: [
|
|
3348
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: cn("flex-1 border-t border-zinc-800", styles[variant]) }),
|
|
3349
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-xs text-zinc-500 whitespace-nowrap", children: label }),
|
|
3350
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: cn("flex-1 border-t border-zinc-800", styles[variant]) })
|
|
3351
|
+
] });
|
|
3352
|
+
}
|
|
3353
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3354
|
+
"div",
|
|
3355
|
+
{
|
|
3356
|
+
ref,
|
|
3357
|
+
role: "separator",
|
|
3358
|
+
className: cn(
|
|
3359
|
+
isH ? cn("w-full border-t border-zinc-800", styles[variant]) : cn("h-full border-l border-zinc-800", styles[variant]),
|
|
3360
|
+
className
|
|
3361
|
+
),
|
|
3362
|
+
...props
|
|
3363
|
+
}
|
|
3364
|
+
);
|
|
3365
|
+
}
|
|
3366
|
+
);
|
|
3367
|
+
Separator.displayName = "Separator";
|
|
3368
|
+
|
|
3369
|
+
// src/components/Other/Skeleton.tsx
|
|
3370
|
+
var import_react34 = require("react");
|
|
3371
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
3372
|
+
var skeletonStyleInjected = false;
|
|
3373
|
+
var Skeleton = ({
|
|
3374
|
+
variant = "rectangle",
|
|
3375
|
+
width,
|
|
3376
|
+
height,
|
|
3377
|
+
animation = "shimmer",
|
|
3378
|
+
className,
|
|
3379
|
+
...props
|
|
3380
|
+
}) => {
|
|
3381
|
+
(0, import_react34.useEffect)(() => {
|
|
3382
|
+
if (!skeletonStyleInjected) {
|
|
3383
|
+
skeletonStyleInjected = true;
|
|
3384
|
+
const style = document.createElement("style");
|
|
3385
|
+
style.textContent = `
|
|
3386
|
+
@keyframes uixy-skeleton-shimmer {
|
|
3387
|
+
0% { background-position: -200% 0; }
|
|
3388
|
+
100% { background-position: 200% 0; }
|
|
3389
|
+
}
|
|
3390
|
+
`;
|
|
3391
|
+
document.head.appendChild(style);
|
|
3392
|
+
}
|
|
3393
|
+
}, []);
|
|
3394
|
+
const shapes = {
|
|
3395
|
+
rectangle: "rounded-md",
|
|
3396
|
+
circle: "rounded-full",
|
|
3397
|
+
text: "rounded h-4"
|
|
3398
|
+
};
|
|
3399
|
+
const animStyles = {
|
|
3400
|
+
pulse: {},
|
|
3401
|
+
shimmer: {
|
|
3402
|
+
background: "linear-gradient(90deg, rgba(63,63,70,0.4) 25%, rgba(82,82,91,0.6) 50%, rgba(63,63,70,0.4) 75%)",
|
|
3403
|
+
backgroundSize: "400% 100%",
|
|
3404
|
+
animation: "uixy-skeleton-shimmer 1.5s ease-in-out infinite"
|
|
3405
|
+
},
|
|
3406
|
+
none: {}
|
|
3407
|
+
};
|
|
3408
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3409
|
+
"div",
|
|
3410
|
+
{
|
|
3411
|
+
className: cn(
|
|
3412
|
+
shapes[variant],
|
|
3413
|
+
animation === "pulse" && "animate-pulse bg-zinc-800",
|
|
3414
|
+
animation === "none" && "bg-zinc-800",
|
|
3415
|
+
className
|
|
3416
|
+
),
|
|
3417
|
+
style: {
|
|
3418
|
+
width: width != null ? width : variant === "circle" ? 40 : "100%",
|
|
3419
|
+
height: height != null ? height : variant === "circle" ? 40 : variant === "text" ? 16 : 20,
|
|
3420
|
+
...animation === "shimmer" ? animStyles.shimmer : {}
|
|
3421
|
+
},
|
|
3422
|
+
...props
|
|
3423
|
+
}
|
|
3424
|
+
);
|
|
3425
|
+
};
|
|
3426
|
+
Skeleton.displayName = "Skeleton";
|
|
3427
|
+
|
|
3428
|
+
// src/components/Other/Progress.tsx
|
|
3429
|
+
var import_react35 = require("react");
|
|
3430
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
3431
|
+
var progressStyleInjected = false;
|
|
3432
|
+
var Progress = (0, import_react35.forwardRef)(
|
|
3433
|
+
({ value = 0, variant = "default", size = "md", showValue, color, className, ...props }, ref) => {
|
|
3434
|
+
(0, import_react35.useEffect)(() => {
|
|
3435
|
+
if (!progressStyleInjected) {
|
|
3436
|
+
progressStyleInjected = true;
|
|
3437
|
+
const style = document.createElement("style");
|
|
3438
|
+
style.textContent = `
|
|
3439
|
+
@keyframes uixy-progress-stripes {
|
|
3440
|
+
0% { background-position: 1rem 0; }
|
|
3441
|
+
100% { background-position: 0 0; }
|
|
3442
|
+
}
|
|
3443
|
+
`;
|
|
3444
|
+
document.head.appendChild(style);
|
|
3445
|
+
}
|
|
3446
|
+
}, []);
|
|
3447
|
+
const clamped = Math.min(100, Math.max(0, value));
|
|
3448
|
+
const sizes = {
|
|
3449
|
+
sm: "h-1.5",
|
|
3450
|
+
md: "h-2.5",
|
|
3451
|
+
lg: "h-4"
|
|
3452
|
+
};
|
|
3453
|
+
const barBase = "h-full rounded-full transition-all duration-500 ease-out";
|
|
3454
|
+
const barStyles = {
|
|
3455
|
+
default: color || "#8b5cf6",
|
|
3456
|
+
gradient: "",
|
|
3457
|
+
striped: color || "#8b5cf6",
|
|
3458
|
+
glow: color || "#8b5cf6"
|
|
3459
|
+
};
|
|
3460
|
+
const barCss = {
|
|
3461
|
+
width: `${clamped}%`
|
|
3462
|
+
};
|
|
3463
|
+
if (variant === "gradient") {
|
|
3464
|
+
barCss.background = "linear-gradient(90deg, #8b5cf6, #3b82f6, #06b6d4)";
|
|
3465
|
+
} else if (variant === "striped") {
|
|
3466
|
+
barCss.backgroundColor = barStyles.striped;
|
|
3467
|
+
barCss.backgroundImage = "linear-gradient(45deg, rgba(255,255,255,0.1) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.1) 75%, transparent 75%, transparent)";
|
|
3468
|
+
barCss.backgroundSize = "1rem 1rem";
|
|
3469
|
+
barCss.animation = "uixy-progress-stripes 0.6s linear infinite";
|
|
3470
|
+
} else if (variant === "glow") {
|
|
3471
|
+
barCss.backgroundColor = barStyles.glow;
|
|
3472
|
+
barCss.boxShadow = `0 0 8px ${color || "#8b5cf6"}80, 0 0 20px ${color || "#8b5cf6"}40`;
|
|
3473
|
+
} else {
|
|
3474
|
+
barCss.backgroundColor = barStyles.default;
|
|
3475
|
+
}
|
|
3476
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { ref, className: cn("relative w-full", className), ...props, children: [
|
|
3477
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: cn("w-full rounded-full bg-zinc-800 overflow-hidden", sizes[size]), children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: barBase, style: barCss }) }),
|
|
3478
|
+
showValue && size === "lg" && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: "absolute right-2 top-1/2 -translate-y-1/2 text-[10px] font-medium text-white", children: [
|
|
3479
|
+
Math.round(clamped),
|
|
3480
|
+
"%"
|
|
3481
|
+
] }),
|
|
3482
|
+
showValue && size !== "lg" && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: "text-[10px] text-zinc-400 mt-1 block text-right", children: [
|
|
3483
|
+
Math.round(clamped),
|
|
3484
|
+
"%"
|
|
3485
|
+
] })
|
|
3486
|
+
] });
|
|
3487
|
+
}
|
|
3488
|
+
);
|
|
3489
|
+
Progress.displayName = "Progress";
|
|
3490
|
+
|
|
3491
|
+
// src/components/Other/Avatar.tsx
|
|
3492
|
+
var import_react36 = require("react");
|
|
3493
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
3494
|
+
var Avatar = (0, import_react36.forwardRef)(
|
|
3495
|
+
({ src, alt, fallback, size = 40, shape = "circle", status, ring, ringColor, className, ...props }, ref) => {
|
|
3496
|
+
const [imgError, setImgError] = (0, import_react36.useState)(false);
|
|
3497
|
+
const statusColors = {
|
|
3498
|
+
online: "bg-emerald-500",
|
|
3499
|
+
offline: "bg-zinc-500",
|
|
3500
|
+
busy: "bg-red-500",
|
|
3501
|
+
away: "bg-amber-500"
|
|
3502
|
+
};
|
|
3503
|
+
const showFallback = !src || imgError;
|
|
3504
|
+
const dotSize = Math.max(10, Math.round(size * 0.28));
|
|
3505
|
+
const borderW = Math.max(2, Math.round(size * 0.06));
|
|
3506
|
+
const angle = 45 * (Math.PI / 180);
|
|
3507
|
+
const radius = size / 2;
|
|
3508
|
+
const dotX = radius + radius * Math.cos(angle) - dotSize / 2;
|
|
3509
|
+
const dotY = radius + radius * Math.sin(angle) - dotSize / 2;
|
|
3510
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
3511
|
+
"div",
|
|
3512
|
+
{
|
|
3513
|
+
ref,
|
|
3514
|
+
className: cn("relative inline-flex shrink-0", className),
|
|
3515
|
+
style: { width: size, height: size },
|
|
3516
|
+
...props,
|
|
3517
|
+
children: [
|
|
3518
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3519
|
+
"div",
|
|
3520
|
+
{
|
|
3521
|
+
className: cn(
|
|
3522
|
+
"flex items-center justify-center bg-zinc-800 overflow-hidden",
|
|
3523
|
+
shape === "circle" ? "rounded-full" : "rounded-lg",
|
|
3524
|
+
ring && "ring-2 ring-offset-2 ring-offset-zinc-950"
|
|
3525
|
+
),
|
|
3526
|
+
style: {
|
|
3527
|
+
width: size,
|
|
3528
|
+
height: size,
|
|
3529
|
+
...ring ? { "--tw-ring-color": ringColor || "#8b5cf6" } : {}
|
|
3530
|
+
},
|
|
3531
|
+
children: !showFallback ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3532
|
+
"img",
|
|
3533
|
+
{
|
|
3534
|
+
src,
|
|
3535
|
+
alt: alt || "",
|
|
3536
|
+
onError: () => setImgError(true),
|
|
3537
|
+
className: "w-full h-full object-cover"
|
|
3538
|
+
}
|
|
3539
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "font-medium text-zinc-300 select-none", style: { fontSize: size * 0.38 }, children: fallback || "?" })
|
|
3540
|
+
}
|
|
3541
|
+
),
|
|
3542
|
+
status && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3543
|
+
"span",
|
|
3544
|
+
{
|
|
3545
|
+
className: cn("absolute rounded-full", statusColors[status]),
|
|
3546
|
+
style: {
|
|
3547
|
+
width: dotSize,
|
|
3548
|
+
height: dotSize,
|
|
3549
|
+
left: shape === "circle" ? dotX : void 0,
|
|
3550
|
+
top: shape === "circle" ? dotY : void 0,
|
|
3551
|
+
bottom: shape !== "circle" ? -dotSize / 4 : void 0,
|
|
3552
|
+
right: shape !== "circle" ? -dotSize / 4 : void 0,
|
|
3553
|
+
border: `${borderW}px solid #09090b`,
|
|
3554
|
+
zIndex: 1
|
|
3555
|
+
}
|
|
3556
|
+
}
|
|
3557
|
+
)
|
|
3558
|
+
]
|
|
3559
|
+
}
|
|
3560
|
+
);
|
|
3561
|
+
}
|
|
3562
|
+
);
|
|
3563
|
+
Avatar.displayName = "Avatar";
|
|
3564
|
+
|
|
3565
|
+
// src/components/Other/Marquee.tsx
|
|
3566
|
+
var import_react37 = require("react");
|
|
3567
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
3568
|
+
var marqueeStyleInjected = false;
|
|
3569
|
+
var Marquee = ({
|
|
3570
|
+
children,
|
|
3571
|
+
speed = 30,
|
|
3572
|
+
direction = "left",
|
|
3573
|
+
pauseOnHover = true,
|
|
3574
|
+
fade = true,
|
|
3575
|
+
repeat = 4,
|
|
3576
|
+
className
|
|
3577
|
+
}) => {
|
|
3578
|
+
(0, import_react37.useEffect)(() => {
|
|
3579
|
+
if (!marqueeStyleInjected) {
|
|
3580
|
+
marqueeStyleInjected = true;
|
|
3581
|
+
const style = document.createElement("style");
|
|
3582
|
+
style.textContent = `
|
|
3583
|
+
@keyframes uixy-marquee-h { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
|
|
3584
|
+
@keyframes uixy-marquee-v { 0% { transform: translateY(0); } 100% { transform: translateY(-50%); } }
|
|
3585
|
+
`;
|
|
3586
|
+
document.head.appendChild(style);
|
|
3587
|
+
}
|
|
3588
|
+
}, []);
|
|
3589
|
+
const isVertical = direction === "up" || direction === "down";
|
|
3590
|
+
const isReverse = direction === "right" || direction === "down";
|
|
3591
|
+
const animName = isVertical ? "uixy-marquee-v" : "uixy-marquee-h";
|
|
3592
|
+
const animDir = isReverse ? "reverse" : "normal";
|
|
3593
|
+
const fadeDir = isVertical ? "to bottom" : "to right";
|
|
3594
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3595
|
+
"div",
|
|
3596
|
+
{
|
|
3597
|
+
className: cn("overflow-hidden relative", className),
|
|
3598
|
+
style: fade ? {
|
|
3599
|
+
maskImage: `linear-gradient(${fadeDir}, transparent 0%, black 10%, black 90%, transparent 100%)`,
|
|
3600
|
+
WebkitMaskImage: `linear-gradient(${fadeDir}, transparent 0%, black 10%, black 90%, transparent 100%)`
|
|
3601
|
+
} : void 0,
|
|
3602
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3603
|
+
"div",
|
|
3604
|
+
{
|
|
3605
|
+
className: cn(
|
|
3606
|
+
isVertical ? "flex flex-col" : "flex",
|
|
3607
|
+
pauseOnHover && "hover:[animation-play-state:paused]"
|
|
3608
|
+
),
|
|
3609
|
+
style: {
|
|
3610
|
+
animation: `${animName} ${speed}s linear infinite`,
|
|
3611
|
+
animationDirection: animDir
|
|
3612
|
+
},
|
|
3613
|
+
children: Array.from({ length: repeat }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: cn(isVertical ? "flex flex-col" : "flex", "shrink-0"), children }, i))
|
|
3614
|
+
}
|
|
3615
|
+
)
|
|
3616
|
+
}
|
|
3617
|
+
);
|
|
3618
|
+
};
|
|
3619
|
+
Marquee.displayName = "Marquee";
|
|
3620
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
3621
|
+
0 && (module.exports = {
|
|
3622
|
+
AuroraBackground,
|
|
3623
|
+
Avatar,
|
|
3624
|
+
Badge,
|
|
3625
|
+
BeamsBackground,
|
|
3626
|
+
BlurText,
|
|
3627
|
+
BokehBackground,
|
|
3628
|
+
Button,
|
|
3629
|
+
Card,
|
|
3630
|
+
CardContent,
|
|
3631
|
+
CardDescription,
|
|
3632
|
+
CardFooter,
|
|
3633
|
+
CardHeader,
|
|
3634
|
+
CardTitle,
|
|
3635
|
+
CounterText,
|
|
3636
|
+
DotPatternBackground,
|
|
3637
|
+
GlitchText,
|
|
3638
|
+
GradientMeshBackground,
|
|
3639
|
+
GradientText,
|
|
3640
|
+
GridBackground,
|
|
3641
|
+
HighlightText,
|
|
3642
|
+
Input,
|
|
3643
|
+
Label,
|
|
3644
|
+
Marquee,
|
|
3645
|
+
MatrixRainBackground,
|
|
3646
|
+
MediaText,
|
|
3647
|
+
MeteorBackground,
|
|
3648
|
+
OTPInput,
|
|
3649
|
+
ParticleBackground,
|
|
3650
|
+
PasswordInput,
|
|
3651
|
+
PixelBackground,
|
|
3652
|
+
Progress,
|
|
3653
|
+
RetroGridBackground,
|
|
3654
|
+
RippleBackground,
|
|
3655
|
+
SearchInput,
|
|
3656
|
+
Separator,
|
|
3657
|
+
ShimmerText,
|
|
3658
|
+
Skeleton,
|
|
3659
|
+
SparklesText,
|
|
3660
|
+
StarfieldBackground,
|
|
3661
|
+
Toggle,
|
|
3662
|
+
Tooltip,
|
|
3663
|
+
TypewriterText,
|
|
3664
|
+
WaveBackground,
|
|
3665
|
+
WaveText,
|
|
3666
|
+
cn
|
|
3667
|
+
});
|
|
3668
|
+
//# sourceMappingURL=index.js.map
|