@levo-so/studio 0.1.5 → 0.1.6

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.
@@ -0,0 +1,127 @@
1
+ "use client";
2
+ import { jsx as e, jsxs as i } from "react/jsx-runtime";
3
+ import y from "react";
4
+ import { cn as w } from "@levo-so/react";
5
+ import { m as h } from "./index-DXb2tXBX.js";
6
+ const M = y.memo(
7
+ ({
8
+ className: p,
9
+ primaryColor: o = "#3b82f6",
10
+ secondaryColor: n = "#8b5cf6",
11
+ amplitude: c = 50,
12
+ frequency: d = 0.02,
13
+ speed: l = 1
14
+ }) => {
15
+ const f = Array.from({ length: 3 }, (t, a) => a), s = (t) => {
16
+ const a = [], m = t * 60;
17
+ for (let r = 0; r <= 1e3; r += 10) {
18
+ const u = 200 + Math.sin(r * d + m) * c;
19
+ a.push(`${r},${u}`);
20
+ }
21
+ return `M 0,200 Q ${a.join(" ")} 1000,200 L 1000,400 L 0,400 Z`;
22
+ };
23
+ return /* @__PURE__ */ e(
24
+ "div",
25
+ {
26
+ className: w(
27
+ "absolute inset-0 flex h-full w-full items-center justify-center overflow-hidden",
28
+ "z-[-1]",
29
+ p
30
+ ),
31
+ children: /* @__PURE__ */ i(
32
+ "svg",
33
+ {
34
+ className: "pointer-events-none absolute z-0 h-full w-full",
35
+ width: "100%",
36
+ height: "100%",
37
+ viewBox: "0 0 1000 400",
38
+ preserveAspectRatio: "xMidYMid slice",
39
+ xmlns: "http://www.w3.org/2000/svg",
40
+ children: [
41
+ /* @__PURE__ */ i("defs", { children: [
42
+ /* @__PURE__ */ i("linearGradient", { id: "waveGradient1", x1: "0%", y1: "0%", x2: "100%", y2: "100%", children: [
43
+ /* @__PURE__ */ e("stop", { offset: "0%", stopColor: o, stopOpacity: "0.3" }),
44
+ /* @__PURE__ */ e("stop", { offset: "100%", stopColor: n, stopOpacity: "0.1" })
45
+ ] }),
46
+ /* @__PURE__ */ i("linearGradient", { id: "waveGradient2", x1: "0%", y1: "0%", x2: "100%", y2: "100%", children: [
47
+ /* @__PURE__ */ e("stop", { offset: "0%", stopColor: n, stopOpacity: "0.2" }),
48
+ /* @__PURE__ */ e("stop", { offset: "100%", stopColor: o, stopOpacity: "0.05" })
49
+ ] }),
50
+ /* @__PURE__ */ i("linearGradient", { id: "waveGradient3", x1: "0%", y1: "0%", x2: "100%", y2: "100%", children: [
51
+ /* @__PURE__ */ e("stop", { offset: "0%", stopColor: o, stopOpacity: "0.1" }),
52
+ /* @__PURE__ */ e("stop", { offset: "100%", stopColor: n, stopOpacity: "0.3" })
53
+ ] })
54
+ ] }),
55
+ f.map((t) => /* @__PURE__ */ e(
56
+ h.path,
57
+ {
58
+ d: s(t),
59
+ fill: `url(#waveGradient${t + 1})`,
60
+ initial: { x: -100 },
61
+ animate: {
62
+ x: [-100, 100],
63
+ d: [
64
+ s(t),
65
+ s(t + 0.5),
66
+ s(t)
67
+ ]
68
+ },
69
+ transition: {
70
+ x: {
71
+ duration: 20 / l,
72
+ repeat: 1 / 0,
73
+ ease: "linear"
74
+ },
75
+ d: {
76
+ duration: 8 / l,
77
+ repeat: 1 / 0,
78
+ ease: "easeInOut"
79
+ }
80
+ },
81
+ style: {
82
+ filter: `blur(${t * 0.5}px)`
83
+ }
84
+ },
85
+ `wave-${t}`
86
+ )),
87
+ Array.from({ length: 15 }, (t, a) => /* @__PURE__ */ e(
88
+ h.circle,
89
+ {
90
+ cx: Math.random() * 1e3,
91
+ cy: Math.random() * 400,
92
+ r: Math.random() * 3 + 1,
93
+ fill: a % 2 === 0 ? o : n,
94
+ initial: { opacity: 0.3 },
95
+ animate: {
96
+ opacity: [0.3, 0.8, 0.3],
97
+ cy: [
98
+ Math.random() * 400,
99
+ Math.random() * 400,
100
+ Math.random() * 400
101
+ ],
102
+ cx: [
103
+ Math.random() * 1e3,
104
+ Math.random() * 1e3,
105
+ Math.random() * 1e3
106
+ ]
107
+ },
108
+ transition: {
109
+ duration: Math.random() * 10 + 5,
110
+ repeat: 1 / 0,
111
+ ease: "easeInOut",
112
+ delay: Math.random() * 5
113
+ }
114
+ },
115
+ `particle-${a}`
116
+ ))
117
+ ]
118
+ }
119
+ )
120
+ }
121
+ );
122
+ }
123
+ );
124
+ M.displayName = "BackgroundWaves";
125
+ export {
126
+ M as BackgroundWaves
127
+ };