@yyc3/music-ai 0.0.0-stage → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +27 -0
- package/README.md +79 -2
- package/dist/components/AIAssistant.d.ts +20 -0
- package/dist/components/AIAssistant.d.ts.map +1 -0
- package/dist/components/AILyricsGenerator.d.ts +11 -0
- package/dist/components/AILyricsGenerator.d.ts.map +1 -0
- package/dist/components/CreationStudio.d.ts +27 -0
- package/dist/components/CreationStudio.d.ts.map +1 -0
- package/dist/components/MVCreator.d.ts +17 -0
- package/dist/components/MVCreator.d.ts.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2130 -0
- package/dist/index.js.map +1 -0
- package/package.json +52 -3
package/dist/index.js
ADDED
|
@@ -0,0 +1,2130 @@
|
|
|
1
|
+
import { jsxs as i, Fragment as z, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useState as u, useRef as we, useEffect as ye, useCallback as P } from "react";
|
|
3
|
+
import { AnimatePresence as F, motion as m } from "motion/react";
|
|
4
|
+
import { clsx as y } from "clsx";
|
|
5
|
+
import { X as ae, Mic as pe, BrainCircuit as Pe, ChevronDown as dt, Clock as Oe, MicOff as Ve, MessageSquare as qe, Smile as Ue, Frown as Qe, Zap as _e, Cloud as Ye, Heart as Xe, Wand2 as We, Plus as xe, Minus as Te, Loader2 as fe, Sparkles as Ie, RefreshCw as ht, Check as ee, Copy as ge, Volume2 as mt, Music as $e, ArrowLeft as pt, Settings2 as xt, Layers as De, FolderOpen as ut, Film as He, ExternalLink as bt, ChevronRight as wt, Trash2 as gt, Share2 as ft, Play as yt, Pause as Nt, Camera as vt, Maximize2 as kt } from "lucide-react";
|
|
6
|
+
import { useI18n as je, useAudioComposer as et } from "@yyc3/music-hooks";
|
|
7
|
+
import { apiFetch as Q } from "@yyc3/music-utils";
|
|
8
|
+
const Ct = [
|
|
9
|
+
{ cmd: '"播放"', desc: "播放音乐" },
|
|
10
|
+
{ cmd: '"暂停"', desc: "暂停音乐" },
|
|
11
|
+
{ cmd: '"下一首"', desc: "下一首歌" },
|
|
12
|
+
{ cmd: '"上一首"', desc: "上一首歌" },
|
|
13
|
+
{ cmd: '"喜欢"', desc: "点赞" },
|
|
14
|
+
{ cmd: '"随机播放"', desc: "切换随机" },
|
|
15
|
+
{ cmd: '"音量大"', desc: "增大音量" },
|
|
16
|
+
{ cmd: '"音量小"', desc: "减小音量" },
|
|
17
|
+
{ cmd: '"静音"', desc: "静音切换" },
|
|
18
|
+
{ cmd: '"播放列表"', desc: "打开列表" },
|
|
19
|
+
{ cmd: '"创作"', desc: "AI歌词" },
|
|
20
|
+
{ cmd: '"排行"', desc: "排行榜" },
|
|
21
|
+
{ cmd: '"评论"', desc: "打开评论" },
|
|
22
|
+
{ cmd: '"社区"', desc: "社区动态" },
|
|
23
|
+
{ cmd: '"分析"', desc: "数据分析" }
|
|
24
|
+
], St = [
|
|
25
|
+
{ cmd: '"play"', desc: "Play music" },
|
|
26
|
+
{ cmd: '"pause"', desc: "Pause music" },
|
|
27
|
+
{ cmd: '"next"', desc: "Next track" },
|
|
28
|
+
{ cmd: '"previous"', desc: "Previous track" },
|
|
29
|
+
{ cmd: '"like"', desc: "Like song" },
|
|
30
|
+
{ cmd: '"shuffle"', desc: "Toggle shuffle" },
|
|
31
|
+
{ cmd: '"volume up"', desc: "Increase volume" },
|
|
32
|
+
{ cmd: '"volume down"', desc: "Decrease volume" },
|
|
33
|
+
{ cmd: '"mute"', desc: "Mute toggle" },
|
|
34
|
+
{ cmd: '"playlist"', desc: "Open playlist" },
|
|
35
|
+
{ cmd: '"create"', desc: "AI Lyrics" },
|
|
36
|
+
{ cmd: '"leaderboard"', desc: "Rankings" },
|
|
37
|
+
{ cmd: '"comment"', desc: "Comments" },
|
|
38
|
+
{ cmd: '"community"', desc: "Community" },
|
|
39
|
+
{ cmd: '"analytics"', desc: "Analytics" }
|
|
40
|
+
], Pt = ({
|
|
41
|
+
activeTips: M,
|
|
42
|
+
onDismissTip: $,
|
|
43
|
+
onExecuteAction: b,
|
|
44
|
+
isListening: g,
|
|
45
|
+
onToggleListening: K,
|
|
46
|
+
voiceSupported: p,
|
|
47
|
+
voiceFeedback: B,
|
|
48
|
+
voiceHistory: J,
|
|
49
|
+
sessionInsight: T,
|
|
50
|
+
isPlaying: j,
|
|
51
|
+
audioEnergy: O,
|
|
52
|
+
externalExpanded: W,
|
|
53
|
+
onExternalExpandedChange: l
|
|
54
|
+
}) => {
|
|
55
|
+
const { t: N, lang: S } = je(), [f, U] = u(!1), [q, L] = u(!1), _ = we(null), E = S === "zh" ? Ct : St;
|
|
56
|
+
ye(() => {
|
|
57
|
+
W !== void 0 && U(W);
|
|
58
|
+
}, [W]);
|
|
59
|
+
const Z = (s) => {
|
|
60
|
+
U(s), l?.(s);
|
|
61
|
+
};
|
|
62
|
+
ye(() => {
|
|
63
|
+
}, [M.length]);
|
|
64
|
+
const I = {
|
|
65
|
+
emotion: "from-pink-500/20 to-purple-500/20 border-pink-500/30",
|
|
66
|
+
achievement: "from-yellow-500/20 to-amber-500/20 border-yellow-500/30",
|
|
67
|
+
streak: "from-orange-500/20 to-red-500/20 border-orange-500/30",
|
|
68
|
+
discovery: "from-blue-500/20 to-cyan-500/20 border-blue-500/30",
|
|
69
|
+
interaction: "from-green-500/20 to-teal-500/20 border-green-500/30",
|
|
70
|
+
voice: "from-indigo-500/20 to-violet-500/20 border-indigo-500/30",
|
|
71
|
+
system: "from-gray-500/20 to-slate-500/20 border-white/10"
|
|
72
|
+
};
|
|
73
|
+
return /* @__PURE__ */ i(z, { children: [
|
|
74
|
+
/* @__PURE__ */ e(
|
|
75
|
+
"div",
|
|
76
|
+
{
|
|
77
|
+
ref: _,
|
|
78
|
+
className: "fixed top-20 left-4 z-[45] flex flex-col gap-2 max-w-[340px] pointer-events-none",
|
|
79
|
+
children: /* @__PURE__ */ e(F, { mode: "popLayout", children: M.map((s) => /* @__PURE__ */ i(
|
|
80
|
+
m.div,
|
|
81
|
+
{
|
|
82
|
+
initial: { opacity: 0, x: -50, scale: 0.9 },
|
|
83
|
+
animate: { opacity: 1, x: 0, scale: 1 },
|
|
84
|
+
exit: { opacity: 0, x: -50, scale: 0.9 },
|
|
85
|
+
transition: { type: "spring", damping: 25, stiffness: 300 },
|
|
86
|
+
className: y(
|
|
87
|
+
"pointer-events-auto bg-gradient-to-r backdrop-blur-2xl rounded-xl border p-3 shadow-2xl",
|
|
88
|
+
I[s.category] || I.system
|
|
89
|
+
),
|
|
90
|
+
children: [
|
|
91
|
+
/* @__PURE__ */ i("div", { className: "flex items-start gap-2.5", children: [
|
|
92
|
+
/* @__PURE__ */ e("span", { className: "text-lg flex-shrink-0 mt-0.5", children: s.icon }),
|
|
93
|
+
/* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
|
|
94
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-white/80 leading-relaxed", children: s.message }),
|
|
95
|
+
s.actionLabel && s.actionKey && /* @__PURE__ */ e(
|
|
96
|
+
"button",
|
|
97
|
+
{
|
|
98
|
+
onClick: () => {
|
|
99
|
+
b(s.actionKey), $(s.id);
|
|
100
|
+
},
|
|
101
|
+
className: "mt-2 text-[11px] font-medium px-3 py-1 rounded-full bg-white/10 hover:bg-white/20 text-white/90 transition-colors border border-white/10",
|
|
102
|
+
children: s.actionLabel
|
|
103
|
+
}
|
|
104
|
+
)
|
|
105
|
+
] }),
|
|
106
|
+
/* @__PURE__ */ e(
|
|
107
|
+
"button",
|
|
108
|
+
{
|
|
109
|
+
onClick: () => $(s.id),
|
|
110
|
+
className: "text-white/30 hover:text-white/60 transition-colors flex-shrink-0 p-0.5",
|
|
111
|
+
children: /* @__PURE__ */ e(ae, { className: "w-3 h-3" })
|
|
112
|
+
}
|
|
113
|
+
)
|
|
114
|
+
] }),
|
|
115
|
+
/* @__PURE__ */ e(
|
|
116
|
+
m.div,
|
|
117
|
+
{
|
|
118
|
+
className: "absolute bottom-0 left-0 h-[2px] bg-white/20 rounded-b-xl",
|
|
119
|
+
initial: { width: "100%" },
|
|
120
|
+
animate: { width: "0%" },
|
|
121
|
+
transition: { duration: 30, ease: "linear" }
|
|
122
|
+
}
|
|
123
|
+
)
|
|
124
|
+
]
|
|
125
|
+
},
|
|
126
|
+
s.id
|
|
127
|
+
)) })
|
|
128
|
+
}
|
|
129
|
+
),
|
|
130
|
+
/* @__PURE__ */ e(F, { children: B && /* @__PURE__ */ e(
|
|
131
|
+
m.div,
|
|
132
|
+
{
|
|
133
|
+
initial: { opacity: 0, y: 20, scale: 0.9 },
|
|
134
|
+
animate: { opacity: 1, y: 0, scale: 1 },
|
|
135
|
+
exit: { opacity: 0, y: 20, scale: 0.9 },
|
|
136
|
+
className: "fixed bottom-32 left-1/2 -translate-x-1/2 z-[70] bg-black/70 backdrop-blur-2xl rounded-2xl px-5 py-3 border border-white/10 shadow-2xl",
|
|
137
|
+
children: /* @__PURE__ */ e("p", { className: "text-sm text-white/90 font-medium whitespace-nowrap", children: B })
|
|
138
|
+
},
|
|
139
|
+
"voice-fb"
|
|
140
|
+
) }),
|
|
141
|
+
/* @__PURE__ */ e(F, { children: g && /* @__PURE__ */ i(
|
|
142
|
+
m.div,
|
|
143
|
+
{
|
|
144
|
+
initial: { opacity: 0 },
|
|
145
|
+
animate: { opacity: 1 },
|
|
146
|
+
exit: { opacity: 0 },
|
|
147
|
+
className: "fixed inset-0 z-[65] pointer-events-none flex items-center justify-center",
|
|
148
|
+
children: [
|
|
149
|
+
[0, 1, 2].map((s) => /* @__PURE__ */ e(
|
|
150
|
+
m.div,
|
|
151
|
+
{
|
|
152
|
+
className: "absolute rounded-full border border-purple-400/20",
|
|
153
|
+
animate: {
|
|
154
|
+
width: [80, 200 + s * 60],
|
|
155
|
+
height: [80, 200 + s * 60],
|
|
156
|
+
opacity: [0.4, 0]
|
|
157
|
+
},
|
|
158
|
+
transition: {
|
|
159
|
+
duration: 2,
|
|
160
|
+
repeat: 1 / 0,
|
|
161
|
+
delay: s * 0.5,
|
|
162
|
+
ease: "easeOut"
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
s
|
|
166
|
+
)),
|
|
167
|
+
/* @__PURE__ */ e(
|
|
168
|
+
m.div,
|
|
169
|
+
{
|
|
170
|
+
className: "w-20 h-20 rounded-full bg-purple-600/30 backdrop-blur-xl border border-purple-400/40 flex items-center justify-center shadow-2xl shadow-purple-500/30",
|
|
171
|
+
animate: { scale: [1, 1.1, 1] },
|
|
172
|
+
transition: { duration: 1, repeat: 1 / 0, ease: "easeInOut" },
|
|
173
|
+
children: /* @__PURE__ */ e(pe, { className: "w-8 h-8 text-purple-300" })
|
|
174
|
+
}
|
|
175
|
+
),
|
|
176
|
+
/* @__PURE__ */ e(
|
|
177
|
+
m.p,
|
|
178
|
+
{
|
|
179
|
+
className: "absolute mt-32 text-sm text-purple-300/80 font-medium",
|
|
180
|
+
animate: { opacity: [0.5, 1, 0.5] },
|
|
181
|
+
transition: { duration: 2, repeat: 1 / 0 },
|
|
182
|
+
children: S === "zh" ? "正在聆听..." : "Listening..."
|
|
183
|
+
}
|
|
184
|
+
)
|
|
185
|
+
]
|
|
186
|
+
},
|
|
187
|
+
"listening-overlay"
|
|
188
|
+
) }),
|
|
189
|
+
/* @__PURE__ */ i("div", { className: "fixed bottom-[120px] md:bottom-28 left-4 z-[55] hidden md:flex flex-col items-start gap-2", children: [
|
|
190
|
+
/* @__PURE__ */ e(F, { children: f && /* @__PURE__ */ i(
|
|
191
|
+
m.div,
|
|
192
|
+
{
|
|
193
|
+
initial: { opacity: 0, y: 20, scale: 0.9 },
|
|
194
|
+
animate: { opacity: 1, y: 0, scale: 1 },
|
|
195
|
+
exit: { opacity: 0, y: 20, scale: 0.9 },
|
|
196
|
+
transition: { type: "spring", damping: 25, stiffness: 300 },
|
|
197
|
+
className: "w-72 md:w-80 bg-[#0D1235]/95 backdrop-blur-2xl rounded-2xl border border-white/10 shadow-2xl overflow-hidden",
|
|
198
|
+
children: [
|
|
199
|
+
/* @__PURE__ */ i("div", { className: "flex items-center justify-between px-4 py-3 border-b border-white/[0.06]", children: [
|
|
200
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
201
|
+
/* @__PURE__ */ e(Pe, { className: "w-4 h-4 text-purple-400" }),
|
|
202
|
+
/* @__PURE__ */ e("span", { className: "text-sm font-semibold text-white/90", children: S === "zh" ? "AI 助手" : "AI Assistant" })
|
|
203
|
+
] }),
|
|
204
|
+
/* @__PURE__ */ e(
|
|
205
|
+
"button",
|
|
206
|
+
{
|
|
207
|
+
onClick: () => Z(!1),
|
|
208
|
+
className: "p-1 rounded-lg text-white/30 hover:text-white/60 hover:bg-white/5 transition-colors",
|
|
209
|
+
children: /* @__PURE__ */ e(dt, { className: "w-4 h-4" })
|
|
210
|
+
}
|
|
211
|
+
)
|
|
212
|
+
] }),
|
|
213
|
+
/* @__PURE__ */ i("div", { className: "p-4 space-y-4 max-h-[50vh] overflow-y-auto", style: { scrollbarWidth: "none" }, children: [
|
|
214
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-2 px-3 py-2 bg-white/[0.03] rounded-lg border border-white/[0.06]", children: [
|
|
215
|
+
/* @__PURE__ */ e(Oe, { className: "w-3.5 h-3.5 text-white/30 flex-shrink-0" }),
|
|
216
|
+
/* @__PURE__ */ e("p", { className: "text-[11px] text-white/50", children: T })
|
|
217
|
+
] }),
|
|
218
|
+
/* @__PURE__ */ i("div", { children: [
|
|
219
|
+
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-2", children: [
|
|
220
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-white/40 font-medium uppercase tracking-wider", children: S === "zh" ? "语音指令" : "Voice Commands" }),
|
|
221
|
+
/* @__PURE__ */ e(
|
|
222
|
+
"button",
|
|
223
|
+
{
|
|
224
|
+
onClick: () => L(!q),
|
|
225
|
+
className: "text-[10px] text-purple-400/60 hover:text-purple-400 transition-colors",
|
|
226
|
+
children: q ? S === "zh" ? "收起" : "Hide" : S === "zh" ? "查看指令表" : "Show commands"
|
|
227
|
+
}
|
|
228
|
+
)
|
|
229
|
+
] }),
|
|
230
|
+
p ? /* @__PURE__ */ e(
|
|
231
|
+
"button",
|
|
232
|
+
{
|
|
233
|
+
onClick: K,
|
|
234
|
+
className: y(
|
|
235
|
+
"w-full flex items-center justify-center gap-2 py-2.5 rounded-xl border transition-all",
|
|
236
|
+
g ? "bg-purple-600/20 border-purple-500/40 text-purple-300" : "bg-white/[0.03] border-white/[0.08] text-white/50 hover:text-white/80 hover:bg-white/[0.06]"
|
|
237
|
+
),
|
|
238
|
+
children: g ? /* @__PURE__ */ i(z, { children: [
|
|
239
|
+
/* @__PURE__ */ e(
|
|
240
|
+
m.div,
|
|
241
|
+
{
|
|
242
|
+
animate: { scale: [1, 1.2, 1] },
|
|
243
|
+
transition: { duration: 1, repeat: 1 / 0 },
|
|
244
|
+
children: /* @__PURE__ */ e(pe, { className: "w-4 h-4" })
|
|
245
|
+
}
|
|
246
|
+
),
|
|
247
|
+
/* @__PURE__ */ e("span", { className: "text-sm", children: S === "zh" ? "正在聆听..." : "Listening..." })
|
|
248
|
+
] }) : /* @__PURE__ */ i(z, { children: [
|
|
249
|
+
/* @__PURE__ */ e(pe, { className: "w-4 h-4" }),
|
|
250
|
+
/* @__PURE__ */ e("span", { className: "text-sm", children: S === "zh" ? "点击说出指令" : "Tap to speak" })
|
|
251
|
+
] })
|
|
252
|
+
}
|
|
253
|
+
) : /* @__PURE__ */ i("div", { className: "flex items-center gap-2 px-3 py-2 bg-white/[0.02] rounded-lg text-white/30 text-xs", children: [
|
|
254
|
+
/* @__PURE__ */ e(Ve, { className: "w-3.5 h-3.5" }),
|
|
255
|
+
S === "zh" ? "当前浏览器不支持语音识别" : "Voice not supported in this browser"
|
|
256
|
+
] }),
|
|
257
|
+
/* @__PURE__ */ e(F, { children: q && /* @__PURE__ */ e(
|
|
258
|
+
m.div,
|
|
259
|
+
{
|
|
260
|
+
initial: { height: 0, opacity: 0 },
|
|
261
|
+
animate: { height: "auto", opacity: 1 },
|
|
262
|
+
exit: { height: 0, opacity: 0 },
|
|
263
|
+
className: "overflow-hidden",
|
|
264
|
+
children: /* @__PURE__ */ e("div", { className: "mt-2 grid grid-cols-2 gap-1", children: E.map((s, v) => /* @__PURE__ */ i("div", { className: "flex items-center gap-1.5 px-2 py-1 rounded-lg bg-white/[0.02]", children: [
|
|
265
|
+
/* @__PURE__ */ e("span", { className: "text-[10px] text-purple-400 font-mono", children: s.cmd }),
|
|
266
|
+
/* @__PURE__ */ e("span", { className: "text-[10px] text-white/30", children: s.desc })
|
|
267
|
+
] }, v)) })
|
|
268
|
+
}
|
|
269
|
+
) }),
|
|
270
|
+
J.length > 0 && /* @__PURE__ */ i("div", { className: "mt-2 space-y-1", children: [
|
|
271
|
+
/* @__PURE__ */ e("p", { className: "text-[10px] text-white/25 uppercase tracking-wider", children: S === "zh" ? "最近指令" : "Recent" }),
|
|
272
|
+
J.slice(-3).reverse().map((s, v) => /* @__PURE__ */ i("div", { className: "flex items-center gap-2 px-2 py-1 rounded-lg bg-white/[0.02]", children: [
|
|
273
|
+
/* @__PURE__ */ e(qe, { className: "w-3 h-3 text-white/20 flex-shrink-0" }),
|
|
274
|
+
/* @__PURE__ */ i("span", { className: "text-[10px] text-white/40 truncate", children: [
|
|
275
|
+
'"',
|
|
276
|
+
s.transcript,
|
|
277
|
+
'"'
|
|
278
|
+
] }),
|
|
279
|
+
/* @__PURE__ */ e("span", { className: "text-[10px] text-green-400/60 ml-auto flex-shrink-0", children: "✓" })
|
|
280
|
+
] }, v))
|
|
281
|
+
] })
|
|
282
|
+
] }),
|
|
283
|
+
M.length > 0 && /* @__PURE__ */ i("div", { children: [
|
|
284
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-white/40 font-medium uppercase tracking-wider mb-2", children: S === "zh" ? "智能提示" : "AI Insights" }),
|
|
285
|
+
/* @__PURE__ */ e("div", { className: "space-y-2", children: M.map((s) => /* @__PURE__ */ i(
|
|
286
|
+
"div",
|
|
287
|
+
{
|
|
288
|
+
className: y(
|
|
289
|
+
"flex items-start gap-2 px-3 py-2 rounded-lg bg-gradient-to-r border",
|
|
290
|
+
I[s.category] || I.system
|
|
291
|
+
),
|
|
292
|
+
children: [
|
|
293
|
+
/* @__PURE__ */ e("span", { className: "text-sm flex-shrink-0", children: s.icon }),
|
|
294
|
+
/* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
|
|
295
|
+
/* @__PURE__ */ e("p", { className: "text-[11px] text-white/70 leading-relaxed", children: s.message }),
|
|
296
|
+
s.actionLabel && s.actionKey && /* @__PURE__ */ e(
|
|
297
|
+
"button",
|
|
298
|
+
{
|
|
299
|
+
onClick: () => {
|
|
300
|
+
b(s.actionKey), $(s.id);
|
|
301
|
+
},
|
|
302
|
+
className: "mt-1 text-[10px] font-medium px-2 py-0.5 rounded-full bg-white/10 hover:bg-white/20 text-white/80 transition-colors",
|
|
303
|
+
children: s.actionLabel
|
|
304
|
+
}
|
|
305
|
+
)
|
|
306
|
+
] }),
|
|
307
|
+
/* @__PURE__ */ e(
|
|
308
|
+
"button",
|
|
309
|
+
{
|
|
310
|
+
onClick: () => $(s.id),
|
|
311
|
+
className: "text-white/20 hover:text-white/50 flex-shrink-0",
|
|
312
|
+
children: /* @__PURE__ */ e(ae, { className: "w-3 h-3" })
|
|
313
|
+
}
|
|
314
|
+
)
|
|
315
|
+
]
|
|
316
|
+
},
|
|
317
|
+
s.id
|
|
318
|
+
)) })
|
|
319
|
+
] })
|
|
320
|
+
] })
|
|
321
|
+
]
|
|
322
|
+
}
|
|
323
|
+
) }),
|
|
324
|
+
/* @__PURE__ */ i(
|
|
325
|
+
m.button,
|
|
326
|
+
{
|
|
327
|
+
onClick: () => Z(!f),
|
|
328
|
+
whileHover: { scale: 1.05 },
|
|
329
|
+
whileTap: { scale: 0.95 },
|
|
330
|
+
className: y(
|
|
331
|
+
"relative w-12 h-12 rounded-full flex items-center justify-center shadow-2xl transition-all border",
|
|
332
|
+
g ? "bg-purple-600 border-purple-400/50 shadow-purple-500/40" : f ? "bg-[#0D1235] border-purple-500/30" : "bg-[#0D1235]/90 backdrop-blur-xl border-white/10 hover:border-purple-500/30"
|
|
333
|
+
),
|
|
334
|
+
style: {
|
|
335
|
+
boxShadow: g ? `0 0 ${15 + O * 20}px rgba(139,92,246,0.4)` : j ? `0 0 ${8 + O * 12}px rgba(139,92,246,0.15)` : void 0
|
|
336
|
+
},
|
|
337
|
+
children: [
|
|
338
|
+
g ? /* @__PURE__ */ e(
|
|
339
|
+
m.div,
|
|
340
|
+
{
|
|
341
|
+
animate: { scale: [1, 1.2, 1] },
|
|
342
|
+
transition: { duration: 0.8, repeat: 1 / 0 },
|
|
343
|
+
children: /* @__PURE__ */ e(pe, { className: "w-5 h-5 text-white" })
|
|
344
|
+
}
|
|
345
|
+
) : /* @__PURE__ */ e(Pe, { className: "w-5 h-5 text-purple-400" }),
|
|
346
|
+
M.length > 0 && !f && /* @__PURE__ */ e(
|
|
347
|
+
m.div,
|
|
348
|
+
{
|
|
349
|
+
initial: { scale: 0 },
|
|
350
|
+
animate: { scale: 1 },
|
|
351
|
+
className: "absolute -top-1 -right-1 w-4 h-4 rounded-full bg-pink-500 text-white text-[9px] font-bold flex items-center justify-center",
|
|
352
|
+
children: M.length
|
|
353
|
+
}
|
|
354
|
+
),
|
|
355
|
+
j && !g && /* @__PURE__ */ e(
|
|
356
|
+
m.div,
|
|
357
|
+
{
|
|
358
|
+
className: "absolute inset-0 rounded-full border border-purple-500/20",
|
|
359
|
+
animate: { scale: [1, 1.4, 1], opacity: [0.3, 0, 0.3] },
|
|
360
|
+
transition: { duration: 3, repeat: 1 / 0, ease: "easeInOut" }
|
|
361
|
+
}
|
|
362
|
+
)
|
|
363
|
+
]
|
|
364
|
+
}
|
|
365
|
+
),
|
|
366
|
+
p && !f && /* @__PURE__ */ e(
|
|
367
|
+
m.button,
|
|
368
|
+
{
|
|
369
|
+
onClick: K,
|
|
370
|
+
whileHover: { scale: 1.1 },
|
|
371
|
+
whileTap: { scale: 0.9 },
|
|
372
|
+
className: y(
|
|
373
|
+
"w-9 h-9 rounded-full flex items-center justify-center border transition-all",
|
|
374
|
+
g ? "bg-purple-600 border-purple-400/50 text-white" : "bg-[#0D1235]/80 backdrop-blur-xl border-white/10 text-white/40 hover:text-purple-400 hover:border-purple-500/30"
|
|
375
|
+
),
|
|
376
|
+
children: g ? /* @__PURE__ */ e(Ve, { className: "w-3.5 h-3.5" }) : /* @__PURE__ */ e(pe, { className: "w-3.5 h-3.5" })
|
|
377
|
+
}
|
|
378
|
+
)
|
|
379
|
+
] }),
|
|
380
|
+
/* @__PURE__ */ e(F, { children: f && /* @__PURE__ */ i(z, { children: [
|
|
381
|
+
/* @__PURE__ */ e(
|
|
382
|
+
m.div,
|
|
383
|
+
{
|
|
384
|
+
initial: { opacity: 0 },
|
|
385
|
+
animate: { opacity: 1 },
|
|
386
|
+
exit: { opacity: 0 },
|
|
387
|
+
className: "md:hidden fixed inset-0 z-[55] bg-black/40",
|
|
388
|
+
onClick: () => Z(!1)
|
|
389
|
+
},
|
|
390
|
+
"mobile-ai-backdrop"
|
|
391
|
+
),
|
|
392
|
+
/* @__PURE__ */ i(
|
|
393
|
+
m.div,
|
|
394
|
+
{
|
|
395
|
+
initial: { opacity: 0, y: 30 },
|
|
396
|
+
animate: { opacity: 1, y: 0 },
|
|
397
|
+
exit: { opacity: 0, y: 30 },
|
|
398
|
+
transition: { type: "spring", damping: 25, stiffness: 300 },
|
|
399
|
+
className: "md:hidden fixed left-3 right-3 top-14 z-[56] max-h-[70vh] bg-[#0D1235]/98 backdrop-blur-2xl rounded-2xl border border-white/10 shadow-2xl overflow-hidden",
|
|
400
|
+
children: [
|
|
401
|
+
/* @__PURE__ */ i("div", { className: "flex items-center justify-between px-4 py-3 border-b border-white/[0.06]", children: [
|
|
402
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
403
|
+
/* @__PURE__ */ e(Pe, { className: "w-4 h-4 text-purple-400" }),
|
|
404
|
+
/* @__PURE__ */ e("span", { className: "text-sm font-semibold text-white/90", children: S === "zh" ? "AI 助手" : "AI Assistant" })
|
|
405
|
+
] }),
|
|
406
|
+
/* @__PURE__ */ e(
|
|
407
|
+
"button",
|
|
408
|
+
{
|
|
409
|
+
onClick: () => Z(!1),
|
|
410
|
+
className: "p-1.5 rounded-lg text-white/40 hover:text-white/70 hover:bg-white/5",
|
|
411
|
+
children: /* @__PURE__ */ e(ae, { className: "w-4 h-4" })
|
|
412
|
+
}
|
|
413
|
+
)
|
|
414
|
+
] }),
|
|
415
|
+
/* @__PURE__ */ i("div", { className: "p-4 space-y-3 max-h-[60vh] overflow-y-auto", style: { scrollbarWidth: "none" }, children: [
|
|
416
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-2 px-3 py-2 bg-white/[0.03] rounded-lg border border-white/[0.06]", children: [
|
|
417
|
+
/* @__PURE__ */ e(Oe, { className: "w-3.5 h-3.5 text-white/30 flex-shrink-0" }),
|
|
418
|
+
/* @__PURE__ */ e("p", { className: "text-[11px] text-white/50", children: T })
|
|
419
|
+
] }),
|
|
420
|
+
p && /* @__PURE__ */ i(
|
|
421
|
+
"button",
|
|
422
|
+
{
|
|
423
|
+
onClick: K,
|
|
424
|
+
className: y(
|
|
425
|
+
"w-full flex items-center justify-center gap-2 py-3 rounded-xl border transition-all",
|
|
426
|
+
g ? "bg-purple-600/20 border-purple-500/40 text-purple-300" : "bg-white/[0.03] border-white/[0.08] text-white/50"
|
|
427
|
+
),
|
|
428
|
+
children: [
|
|
429
|
+
/* @__PURE__ */ e(pe, { className: "w-5 h-5" }),
|
|
430
|
+
/* @__PURE__ */ e("span", { className: "text-sm", children: g ? S === "zh" ? "正在聆听..." : "Listening..." : S === "zh" ? "点击说出指令" : "Tap to speak" })
|
|
431
|
+
]
|
|
432
|
+
}
|
|
433
|
+
),
|
|
434
|
+
M.length > 0 && /* @__PURE__ */ i("div", { className: "space-y-2", children: [
|
|
435
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-white/40 font-medium uppercase tracking-wider", children: S === "zh" ? "智能提示" : "AI Tips" }),
|
|
436
|
+
M.map((s) => /* @__PURE__ */ i("div", { className: y("flex items-start gap-2 px-3 py-2 rounded-lg bg-gradient-to-r border", I[s.category] || I.system), children: [
|
|
437
|
+
/* @__PURE__ */ e("span", { className: "text-sm flex-shrink-0", children: s.icon }),
|
|
438
|
+
/* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
|
|
439
|
+
/* @__PURE__ */ e("p", { className: "text-[11px] text-white/70 leading-relaxed", children: s.message }),
|
|
440
|
+
s.actionLabel && s.actionKey && /* @__PURE__ */ e("button", { onClick: () => {
|
|
441
|
+
b(s.actionKey), $(s.id);
|
|
442
|
+
}, className: "mt-1 text-[10px] font-medium px-2 py-0.5 rounded-full bg-white/10 text-white/80", children: s.actionLabel })
|
|
443
|
+
] }),
|
|
444
|
+
/* @__PURE__ */ e("button", { onClick: () => $(s.id), className: "text-white/20", children: /* @__PURE__ */ e(ae, { className: "w-3 h-3" }) })
|
|
445
|
+
] }, s.id))
|
|
446
|
+
] }),
|
|
447
|
+
J.length > 0 && /* @__PURE__ */ i("div", { className: "space-y-1", children: [
|
|
448
|
+
/* @__PURE__ */ e("p", { className: "text-[10px] text-white/25 uppercase tracking-wider", children: S === "zh" ? "最近指令" : "Recent" }),
|
|
449
|
+
J.slice(-3).reverse().map((s, v) => /* @__PURE__ */ i("div", { className: "flex items-center gap-2 px-2 py-1 rounded-lg bg-white/[0.02]", children: [
|
|
450
|
+
/* @__PURE__ */ e(qe, { className: "w-3 h-3 text-white/20 flex-shrink-0" }),
|
|
451
|
+
/* @__PURE__ */ i("span", { className: "text-[10px] text-white/40 truncate", children: [
|
|
452
|
+
'"',
|
|
453
|
+
s.transcript,
|
|
454
|
+
'"'
|
|
455
|
+
] }),
|
|
456
|
+
/* @__PURE__ */ e("span", { className: "text-[10px] text-green-400/60 ml-auto", children: "✓" })
|
|
457
|
+
] }, v))
|
|
458
|
+
] })
|
|
459
|
+
] })
|
|
460
|
+
]
|
|
461
|
+
},
|
|
462
|
+
"mobile-ai-overlay"
|
|
463
|
+
)
|
|
464
|
+
] }) })
|
|
465
|
+
] });
|
|
466
|
+
}, Fe = [
|
|
467
|
+
{ id: "happy", label: "Happy", labelZh: "快乐", icon: Ue, color: "text-yellow-400", bg: "from-yellow-500/20 to-orange-500/20" },
|
|
468
|
+
{ id: "sad", label: "Sad", labelZh: "忧伤", icon: Qe, color: "text-blue-400", bg: "from-blue-500/20 to-indigo-500/20" },
|
|
469
|
+
{ id: "energetic", label: "Energetic", labelZh: "活力", icon: _e, color: "text-red-400", bg: "from-red-500/20 to-orange-500/20" },
|
|
470
|
+
{ id: "calm", label: "Calm", labelZh: "宁静", icon: Ye, color: "text-cyan-400", bg: "from-cyan-500/20 to-teal-500/20" },
|
|
471
|
+
{ id: "love", label: "Love", labelZh: "爱情", icon: Xe, color: "text-pink-400", bg: "from-pink-500/20 to-red-500/20" }
|
|
472
|
+
], Ot = ({
|
|
473
|
+
isOpen: M,
|
|
474
|
+
onClose: $,
|
|
475
|
+
onCreateTrack: b
|
|
476
|
+
}) => {
|
|
477
|
+
const [g, K] = u("happy"), [p, B] = u([]), [J, T] = u(""), [j, O] = u(8), [W, l] = u(!1), [N, S] = u(null), [f, U] = u(!1), [q, L] = u(0), [_, E] = u(!1), [Z, I] = u("idle"), s = et(), { t: v, lang: te } = je(), h = P(() => {
|
|
478
|
+
const c = J.trim();
|
|
479
|
+
c && p.length < 5 && !p.includes(c) && (B((R) => [...R, c]), T(""));
|
|
480
|
+
}, [J, p]), a = P((c) => {
|
|
481
|
+
B((R) => R.filter((Y) => Y !== c));
|
|
482
|
+
}, []), d = P(async () => {
|
|
483
|
+
l(!0);
|
|
484
|
+
try {
|
|
485
|
+
const c = await Q("/ai/lyrics", {
|
|
486
|
+
method: "POST",
|
|
487
|
+
headers: { "Content-Type": "application/json" },
|
|
488
|
+
body: JSON.stringify({
|
|
489
|
+
theme: g,
|
|
490
|
+
keywords: p,
|
|
491
|
+
lines: j
|
|
492
|
+
})
|
|
493
|
+
});
|
|
494
|
+
c?.lyrics && (S(c.lyrics), L((R) => R + 1));
|
|
495
|
+
} catch (c) {
|
|
496
|
+
console.error("AI lyrics generation failed:", c);
|
|
497
|
+
} finally {
|
|
498
|
+
l(!1);
|
|
499
|
+
}
|
|
500
|
+
}, [g, p, j]), x = P(() => {
|
|
501
|
+
N && (navigator.clipboard.writeText(N.join(`
|
|
502
|
+
`)), U(!0), setTimeout(() => U(!1), 2e3));
|
|
503
|
+
}, [N]), de = P(async () => {
|
|
504
|
+
if (!(!N || !b)) {
|
|
505
|
+
I("composing-params");
|
|
506
|
+
try {
|
|
507
|
+
navigator.vibrate?.(25);
|
|
508
|
+
} catch {
|
|
509
|
+
}
|
|
510
|
+
try {
|
|
511
|
+
const c = await Q("/ai/compose", {
|
|
512
|
+
method: "POST",
|
|
513
|
+
headers: { "Content-Type": "application/json" },
|
|
514
|
+
body: JSON.stringify({
|
|
515
|
+
theme: g,
|
|
516
|
+
lyrics: N,
|
|
517
|
+
lineCount: j
|
|
518
|
+
})
|
|
519
|
+
});
|
|
520
|
+
if (!c?.composition) {
|
|
521
|
+
b(N, g), E(!0), I("done"), setTimeout(() => {
|
|
522
|
+
E(!1), I("idle");
|
|
523
|
+
}, 2500);
|
|
524
|
+
return;
|
|
525
|
+
}
|
|
526
|
+
I("synthesizing");
|
|
527
|
+
const R = await s.compose(c.composition);
|
|
528
|
+
b(N, g, R, c.composition), E(!0), I("done");
|
|
529
|
+
try {
|
|
530
|
+
navigator.vibrate?.([10, 30, 10, 30, 40]);
|
|
531
|
+
} catch {
|
|
532
|
+
}
|
|
533
|
+
setTimeout(() => {
|
|
534
|
+
E(!1), I("idle");
|
|
535
|
+
}, 2500);
|
|
536
|
+
} catch (c) {
|
|
537
|
+
console.error("Composition pipeline failed:", c), b(N, g), E(!0), I("done"), setTimeout(() => {
|
|
538
|
+
E(!1), I("idle");
|
|
539
|
+
}, 2500);
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
}, [N, b, g, j, s]), w = Fe.find((c) => c.id === g);
|
|
543
|
+
return /* @__PURE__ */ e(F, { children: M && /* @__PURE__ */ i(z, { children: [
|
|
544
|
+
/* @__PURE__ */ e(
|
|
545
|
+
m.div,
|
|
546
|
+
{
|
|
547
|
+
initial: { opacity: 0 },
|
|
548
|
+
animate: { opacity: 1 },
|
|
549
|
+
exit: { opacity: 0 },
|
|
550
|
+
className: "fixed inset-0 z-[60] bg-black/50 backdrop-blur-sm",
|
|
551
|
+
onClick: $
|
|
552
|
+
}
|
|
553
|
+
),
|
|
554
|
+
/* @__PURE__ */ i(
|
|
555
|
+
m.div,
|
|
556
|
+
{
|
|
557
|
+
initial: { y: "100%", opacity: 0 },
|
|
558
|
+
animate: { y: 0, opacity: 1 },
|
|
559
|
+
exit: { y: "100%", opacity: 0 },
|
|
560
|
+
transition: { type: "spring", damping: 28, stiffness: 300 },
|
|
561
|
+
className: "fixed inset-x-0 bottom-0 z-[61] max-h-[90vh] bg-[#0D1235]/95 backdrop-blur-2xl border-t border-white/10 rounded-t-3xl flex flex-col shadow-2xl md:inset-x-auto md:left-1/2 md:-translate-x-1/2 md:w-full md:max-w-lg md:bottom-auto md:top-1/2 md:-translate-y-1/2 md:rounded-2xl md:border md:max-h-[85vh]",
|
|
562
|
+
children: [
|
|
563
|
+
/* @__PURE__ */ i("div", { className: "flex items-center justify-between p-5 pb-3 border-b border-white/[0.06] flex-shrink-0", children: [
|
|
564
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-3", children: [
|
|
565
|
+
/* @__PURE__ */ e("div", { className: "w-9 h-9 rounded-xl bg-gradient-to-tr from-purple-500/20 to-pink-500/20 border border-white/10 flex items-center justify-center", children: /* @__PURE__ */ e(We, { className: "w-4.5 h-4.5 text-purple-400" }) }),
|
|
566
|
+
/* @__PURE__ */ i("div", { children: [
|
|
567
|
+
/* @__PURE__ */ e("h3", { className: "text-white font-semibold text-sm leading-tight", children: v("aiLyrics.title") }),
|
|
568
|
+
/* @__PURE__ */ e("p", { className: "text-white/30 text-xs", children: v("aiLyrics.subtitle") })
|
|
569
|
+
] })
|
|
570
|
+
] }),
|
|
571
|
+
/* @__PURE__ */ e(
|
|
572
|
+
"button",
|
|
573
|
+
{
|
|
574
|
+
onClick: $,
|
|
575
|
+
className: "p-2 rounded-lg text-white/40 hover:text-white/70 hover:bg-white/5 transition-colors",
|
|
576
|
+
children: /* @__PURE__ */ e(ae, { className: "w-4 h-4" })
|
|
577
|
+
}
|
|
578
|
+
)
|
|
579
|
+
] }),
|
|
580
|
+
/* @__PURE__ */ i("div", { className: "flex-1 overflow-y-auto p-5 space-y-5", style: { scrollbarWidth: "none" }, children: [
|
|
581
|
+
/* @__PURE__ */ i("div", { children: [
|
|
582
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-white/40 font-medium uppercase tracking-wider mb-3", children: v("aiLyrics.theme") }),
|
|
583
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-5 gap-2", children: Fe.map((c) => {
|
|
584
|
+
const R = c.icon, Y = g === c.id;
|
|
585
|
+
return /* @__PURE__ */ i(
|
|
586
|
+
"button",
|
|
587
|
+
{
|
|
588
|
+
onClick: () => K(c.id),
|
|
589
|
+
className: y(
|
|
590
|
+
"p-3 rounded-xl border transition-all text-center",
|
|
591
|
+
Y ? `bg-gradient-to-br ${c.bg} border-white/15 shadow-lg` : "bg-white/[0.02] border-white/[0.06] hover:bg-white/[0.05]"
|
|
592
|
+
),
|
|
593
|
+
children: [
|
|
594
|
+
/* @__PURE__ */ e(
|
|
595
|
+
R,
|
|
596
|
+
{
|
|
597
|
+
className: y(
|
|
598
|
+
"w-5 h-5 mx-auto mb-1",
|
|
599
|
+
Y ? c.color : "text-white/30"
|
|
600
|
+
)
|
|
601
|
+
}
|
|
602
|
+
),
|
|
603
|
+
/* @__PURE__ */ e("p", { className: y("text-[10px]", Y ? "text-white/80" : "text-white/30"), children: te === "zh" ? c.labelZh : c.label })
|
|
604
|
+
]
|
|
605
|
+
},
|
|
606
|
+
c.id
|
|
607
|
+
);
|
|
608
|
+
}) })
|
|
609
|
+
] }),
|
|
610
|
+
/* @__PURE__ */ i("div", { children: [
|
|
611
|
+
/* @__PURE__ */ i("p", { className: "text-xs text-white/40 font-medium uppercase tracking-wider mb-3", children: [
|
|
612
|
+
v("aiLyrics.keywords"),
|
|
613
|
+
" ",
|
|
614
|
+
/* @__PURE__ */ i("span", { className: "text-white/20", children: [
|
|
615
|
+
"(",
|
|
616
|
+
p.length,
|
|
617
|
+
"/5)"
|
|
618
|
+
] })
|
|
619
|
+
] }),
|
|
620
|
+
/* @__PURE__ */ i("div", { className: "flex gap-2 mb-2", children: [
|
|
621
|
+
/* @__PURE__ */ e(
|
|
622
|
+
"input",
|
|
623
|
+
{
|
|
624
|
+
type: "text",
|
|
625
|
+
value: J,
|
|
626
|
+
onChange: (c) => T(c.target.value),
|
|
627
|
+
onKeyDown: (c) => c.key === "Enter" && h(),
|
|
628
|
+
placeholder: v("aiLyrics.enterKeyword"),
|
|
629
|
+
className: "flex-1 bg-white/5 border border-white/10 rounded-lg py-2 px-3 text-sm text-white placeholder:text-white/20 focus:outline-none focus:border-purple-500/50"
|
|
630
|
+
}
|
|
631
|
+
),
|
|
632
|
+
/* @__PURE__ */ e(
|
|
633
|
+
"button",
|
|
634
|
+
{
|
|
635
|
+
onClick: h,
|
|
636
|
+
disabled: !J.trim() || p.length >= 5,
|
|
637
|
+
className: "p-2 rounded-lg bg-white/5 border border-white/[0.08] text-white/60 hover:text-white hover:bg-white/10 transition-colors disabled:opacity-30",
|
|
638
|
+
children: /* @__PURE__ */ e(xe, { className: "w-4 h-4" })
|
|
639
|
+
}
|
|
640
|
+
)
|
|
641
|
+
] }),
|
|
642
|
+
p.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1.5", children: p.map((c) => /* @__PURE__ */ i(
|
|
643
|
+
m.span,
|
|
644
|
+
{
|
|
645
|
+
initial: { scale: 0.8, opacity: 0 },
|
|
646
|
+
animate: { scale: 1, opacity: 1 },
|
|
647
|
+
exit: { scale: 0.8, opacity: 0 },
|
|
648
|
+
className: "inline-flex items-center gap-1 px-2.5 py-1 bg-purple-500/10 border border-purple-500/20 rounded-full text-xs text-purple-300",
|
|
649
|
+
children: [
|
|
650
|
+
c,
|
|
651
|
+
/* @__PURE__ */ e("button", { onClick: () => a(c), className: "text-purple-400/60 hover:text-purple-300", children: /* @__PURE__ */ e(ae, { className: "w-3 h-3" }) })
|
|
652
|
+
]
|
|
653
|
+
},
|
|
654
|
+
c
|
|
655
|
+
)) })
|
|
656
|
+
] }),
|
|
657
|
+
/* @__PURE__ */ i("div", { children: [
|
|
658
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-white/40 font-medium uppercase tracking-wider mb-3", children: v("aiLyrics.lines") }),
|
|
659
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-3", children: [
|
|
660
|
+
/* @__PURE__ */ e(
|
|
661
|
+
"button",
|
|
662
|
+
{
|
|
663
|
+
onClick: () => O(Math.max(4, j - 2)),
|
|
664
|
+
className: "p-2 rounded-lg bg-white/5 border border-white/[0.08] text-white/60 hover:text-white transition-colors",
|
|
665
|
+
children: /* @__PURE__ */ e(Te, { className: "w-4 h-4" })
|
|
666
|
+
}
|
|
667
|
+
),
|
|
668
|
+
/* @__PURE__ */ i("div", { className: "flex-1 text-center", children: [
|
|
669
|
+
/* @__PURE__ */ e("span", { className: "text-2xl font-bold text-white font-mono", children: j }),
|
|
670
|
+
/* @__PURE__ */ e("span", { className: "text-xs text-white/30 ml-1", children: v("aiLyrics.linesUnit") })
|
|
671
|
+
] }),
|
|
672
|
+
/* @__PURE__ */ e(
|
|
673
|
+
"button",
|
|
674
|
+
{
|
|
675
|
+
onClick: () => O(Math.min(16, j + 2)),
|
|
676
|
+
className: "p-2 rounded-lg bg-white/5 border border-white/[0.08] text-white/60 hover:text-white transition-colors",
|
|
677
|
+
children: /* @__PURE__ */ e(xe, { className: "w-4 h-4" })
|
|
678
|
+
}
|
|
679
|
+
)
|
|
680
|
+
] })
|
|
681
|
+
] }),
|
|
682
|
+
/* @__PURE__ */ e(
|
|
683
|
+
m.button,
|
|
684
|
+
{
|
|
685
|
+
onClick: d,
|
|
686
|
+
disabled: W,
|
|
687
|
+
whileHover: { scale: 1.01 },
|
|
688
|
+
whileTap: { scale: 0.98 },
|
|
689
|
+
className: "w-full py-3 rounded-xl bg-gradient-to-r from-purple-600 via-pink-600 to-blue-600 text-white font-medium flex items-center justify-center gap-2 shadow-lg shadow-purple-500/20 disabled:opacity-50 transition-opacity",
|
|
690
|
+
children: W ? /* @__PURE__ */ i(z, { children: [
|
|
691
|
+
/* @__PURE__ */ e(fe, { className: "w-4 h-4 animate-spin" }),
|
|
692
|
+
v("aiLyrics.generating")
|
|
693
|
+
] }) : /* @__PURE__ */ i(z, { children: [
|
|
694
|
+
/* @__PURE__ */ e(Ie, { className: "w-4 h-4" }),
|
|
695
|
+
q > 0 ? v("aiLyrics.regenerate") : v("aiLyrics.generate")
|
|
696
|
+
] })
|
|
697
|
+
}
|
|
698
|
+
),
|
|
699
|
+
/* @__PURE__ */ e(F, { children: N && /* @__PURE__ */ i(
|
|
700
|
+
m.div,
|
|
701
|
+
{
|
|
702
|
+
initial: { opacity: 0, y: 20 },
|
|
703
|
+
animate: { opacity: 1, y: 0 },
|
|
704
|
+
exit: { opacity: 0, y: 20 },
|
|
705
|
+
className: "space-y-3",
|
|
706
|
+
children: [
|
|
707
|
+
/* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
708
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
709
|
+
/* @__PURE__ */ e(w.icon, { className: y("w-4 h-4", w.color) }),
|
|
710
|
+
/* @__PURE__ */ i("p", { className: "text-xs text-white/50", children: [
|
|
711
|
+
v("aiLyrics.generated"),
|
|
712
|
+
" · ",
|
|
713
|
+
te === "zh" ? w.labelZh : w.label,
|
|
714
|
+
" ",
|
|
715
|
+
v("aiLyrics.themeSuffix")
|
|
716
|
+
] })
|
|
717
|
+
] }),
|
|
718
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-1.5", children: [
|
|
719
|
+
/* @__PURE__ */ e(
|
|
720
|
+
"button",
|
|
721
|
+
{
|
|
722
|
+
onClick: d,
|
|
723
|
+
disabled: W,
|
|
724
|
+
className: "p-1.5 rounded-lg text-white/30 hover:text-white/60 hover:bg-white/5 transition-colors",
|
|
725
|
+
title: "Regenerate",
|
|
726
|
+
children: /* @__PURE__ */ e(ht, { className: y("w-3.5 h-3.5", W && "animate-spin") })
|
|
727
|
+
}
|
|
728
|
+
),
|
|
729
|
+
/* @__PURE__ */ e(
|
|
730
|
+
"button",
|
|
731
|
+
{
|
|
732
|
+
onClick: x,
|
|
733
|
+
className: "flex items-center gap-1 px-2.5 py-1 rounded-lg bg-white/5 border border-white/[0.08] text-xs text-white/50 hover:text-white/80 transition-colors",
|
|
734
|
+
children: f ? /* @__PURE__ */ i(z, { children: [
|
|
735
|
+
/* @__PURE__ */ e(ee, { className: "w-3 h-3 text-green-400" }),
|
|
736
|
+
/* @__PURE__ */ e("span", { className: "text-green-400", children: v("aiLyrics.copied") })
|
|
737
|
+
] }) : /* @__PURE__ */ i(z, { children: [
|
|
738
|
+
/* @__PURE__ */ e(ge, { className: "w-3 h-3" }),
|
|
739
|
+
v("aiLyrics.copy")
|
|
740
|
+
] })
|
|
741
|
+
}
|
|
742
|
+
),
|
|
743
|
+
b && /* @__PURE__ */ e(
|
|
744
|
+
"button",
|
|
745
|
+
{
|
|
746
|
+
onClick: de,
|
|
747
|
+
disabled: Z !== "idle" && Z !== "done",
|
|
748
|
+
className: y(
|
|
749
|
+
"flex items-center gap-1 px-2.5 py-1 rounded-lg border text-xs transition-colors",
|
|
750
|
+
Z === "idle" || Z === "done" ? "bg-white/5 border-white/[0.08] text-white/50 hover:text-white/80" : "bg-purple-500/10 border-purple-500/20 text-purple-300"
|
|
751
|
+
),
|
|
752
|
+
children: _ ? /* @__PURE__ */ i(z, { children: [
|
|
753
|
+
/* @__PURE__ */ e(ee, { className: "w-3 h-3 text-green-400" }),
|
|
754
|
+
/* @__PURE__ */ e("span", { className: "text-green-400", children: v("aiLyrics.trackCreated") })
|
|
755
|
+
] }) : Z === "composing-params" ? /* @__PURE__ */ i(z, { children: [
|
|
756
|
+
/* @__PURE__ */ e(fe, { className: "w-3 h-3 animate-spin text-purple-400" }),
|
|
757
|
+
/* @__PURE__ */ e("span", { children: te === "zh" ? "编曲中..." : "Composing..." })
|
|
758
|
+
] }) : Z === "synthesizing" ? /* @__PURE__ */ i(z, { children: [
|
|
759
|
+
/* @__PURE__ */ e(mt, { className: "w-3 h-3 animate-pulse text-purple-400" }),
|
|
760
|
+
/* @__PURE__ */ e("span", { children: te === "zh" ? `合成 ${Math.round(s.progress * 100)}%` : `Synth ${Math.round(s.progress * 100)}%` })
|
|
761
|
+
] }) : /* @__PURE__ */ i(z, { children: [
|
|
762
|
+
/* @__PURE__ */ e($e, { className: "w-3 h-3" }),
|
|
763
|
+
te === "zh" ? "创建歌曲" : "Create Track"
|
|
764
|
+
] })
|
|
765
|
+
}
|
|
766
|
+
)
|
|
767
|
+
] })
|
|
768
|
+
] }),
|
|
769
|
+
/* @__PURE__ */ e("div", { className: y("rounded-xl border p-4 bg-gradient-to-br", w.bg, "border-white/[0.08]"), children: /* @__PURE__ */ e("div", { className: "space-y-2", children: N.map((c, R) => /* @__PURE__ */ e(
|
|
770
|
+
m.p,
|
|
771
|
+
{
|
|
772
|
+
initial: { opacity: 0, x: -10 },
|
|
773
|
+
animate: { opacity: 1, x: 0 },
|
|
774
|
+
transition: { delay: R * 0.08 },
|
|
775
|
+
className: "text-sm text-white/80 leading-relaxed",
|
|
776
|
+
children: c
|
|
777
|
+
},
|
|
778
|
+
`${q}-${R}`
|
|
779
|
+
)) }) })
|
|
780
|
+
]
|
|
781
|
+
}
|
|
782
|
+
) })
|
|
783
|
+
] })
|
|
784
|
+
]
|
|
785
|
+
}
|
|
786
|
+
)
|
|
787
|
+
] }) });
|
|
788
|
+
}, Me = [
|
|
789
|
+
{ id: "happy", label: "Happy", labelZh: "快乐", icon: Ue, color: "text-yellow-400", bg: "from-yellow-500/20 to-orange-500/20" },
|
|
790
|
+
{ id: "sad", label: "Sad", labelZh: "忧伤", icon: Qe, color: "text-blue-400", bg: "from-blue-500/20 to-indigo-500/20" },
|
|
791
|
+
{ id: "energetic", label: "Energetic", labelZh: "活力", icon: _e, color: "text-red-400", bg: "from-red-500/20 to-orange-500/20", premium: !0, spCost: 200 },
|
|
792
|
+
{ id: "calm", label: "Calm", labelZh: "宁静", icon: Ye, color: "text-cyan-400", bg: "from-cyan-500/20 to-teal-500/20" },
|
|
793
|
+
{ id: "love", label: "Love", labelZh: "爱情", icon: Xe, color: "text-pink-400", bg: "from-pink-500/20 to-red-500/20", premium: !0, spCost: 200 }
|
|
794
|
+
], ze = [
|
|
795
|
+
{
|
|
796
|
+
id: "quick",
|
|
797
|
+
label: "Quick Song",
|
|
798
|
+
labelZh: "极简写歌",
|
|
799
|
+
icon: Ie,
|
|
800
|
+
desc: "AI lyrics + auto compose in seconds",
|
|
801
|
+
descZh: "一键AI写词作曲,秒出成品",
|
|
802
|
+
gradient: "from-purple-500 to-pink-500"
|
|
803
|
+
},
|
|
804
|
+
{
|
|
805
|
+
id: "master",
|
|
806
|
+
label: "Master Mode",
|
|
807
|
+
labelZh: "大师写歌",
|
|
808
|
+
icon: xt,
|
|
809
|
+
desc: "Full control over theme, structure & style",
|
|
810
|
+
descZh: "精细控制主题、结构与风格",
|
|
811
|
+
gradient: "from-indigo-500 to-blue-500"
|
|
812
|
+
},
|
|
813
|
+
{
|
|
814
|
+
id: "remix",
|
|
815
|
+
label: "Remix & Cover",
|
|
816
|
+
labelZh: "热歌改编",
|
|
817
|
+
icon: De,
|
|
818
|
+
desc: "Transform existing tracks with AI",
|
|
819
|
+
descZh: "AI改编翻唱热门曲目",
|
|
820
|
+
gradient: "from-orange-500 to-red-500"
|
|
821
|
+
},
|
|
822
|
+
{
|
|
823
|
+
id: "works",
|
|
824
|
+
label: "My Works",
|
|
825
|
+
labelZh: "作品管理",
|
|
826
|
+
icon: ut,
|
|
827
|
+
desc: "View & manage your creations",
|
|
828
|
+
descZh: "查看管理你的创作",
|
|
829
|
+
gradient: "from-emerald-500 to-teal-500"
|
|
830
|
+
},
|
|
831
|
+
{
|
|
832
|
+
id: "mv",
|
|
833
|
+
label: "MV Creator",
|
|
834
|
+
labelZh: "MV 创作",
|
|
835
|
+
icon: He,
|
|
836
|
+
desc: "Visualize music with AI effects",
|
|
837
|
+
descZh: "AI驱动音乐可视化MV",
|
|
838
|
+
gradient: "from-cyan-500 to-blue-500"
|
|
839
|
+
}
|
|
840
|
+
], Mt = [
|
|
841
|
+
{ id: "verse-chorus", label: "Verse-Chorus", labelZh: "主副歌" },
|
|
842
|
+
{ id: "verse-bridge", label: "Verse-Bridge", labelZh: "主歌-桥段" },
|
|
843
|
+
{ id: "aaba", label: "AABA", labelZh: "AABA经典" },
|
|
844
|
+
{ id: "through", label: "Through-composed", labelZh: "通谱体" }
|
|
845
|
+
], zt = [
|
|
846
|
+
{ id: "piano", label: "Piano", labelZh: "钢琴", emoji: "🎹" },
|
|
847
|
+
{ id: "guitar", label: "Guitar", labelZh: "吉他", emoji: "🎸" },
|
|
848
|
+
{ id: "synth", label: "Synth", labelZh: "合成器", emoji: "🎛️" },
|
|
849
|
+
{ id: "strings", label: "Strings", labelZh: "弦乐", emoji: "🎻" },
|
|
850
|
+
{ id: "drums", label: "Drums", labelZh: "鼓", emoji: "🥁" },
|
|
851
|
+
{ id: "bass", label: "Bass", labelZh: "贝斯", emoji: "🎸" }
|
|
852
|
+
], Wt = ({
|
|
853
|
+
isOpen: M,
|
|
854
|
+
onClose: $,
|
|
855
|
+
onCreateTrack: b,
|
|
856
|
+
playlist: g,
|
|
857
|
+
currentTrackIndex: K,
|
|
858
|
+
onHaptic: p,
|
|
859
|
+
onShareWork: B,
|
|
860
|
+
onOpenMV: J,
|
|
861
|
+
user: T,
|
|
862
|
+
starPower: j = 0,
|
|
863
|
+
onStarPowerUpdate: O
|
|
864
|
+
}) => {
|
|
865
|
+
const { t: W, lang: l } = je(), [N, S] = u(null), [f, U] = u(/* @__PURE__ */ new Set());
|
|
866
|
+
ye(() => {
|
|
867
|
+
if (!T) {
|
|
868
|
+
try {
|
|
869
|
+
const t = localStorage.getItem("dmusic-unlocked-themes");
|
|
870
|
+
t && U(new Set(JSON.parse(t)));
|
|
871
|
+
} catch {
|
|
872
|
+
}
|
|
873
|
+
return;
|
|
874
|
+
}
|
|
875
|
+
(async () => {
|
|
876
|
+
try {
|
|
877
|
+
const t = await Q(`/user/${T.id}/unlocked-themes`);
|
|
878
|
+
if (t?.themes && t.themes.length > 0)
|
|
879
|
+
U(new Set(t.themes));
|
|
880
|
+
else
|
|
881
|
+
try {
|
|
882
|
+
const o = localStorage.getItem("dmusic-unlocked-themes");
|
|
883
|
+
if (o) {
|
|
884
|
+
const n = JSON.parse(o);
|
|
885
|
+
if (n.length > 0) {
|
|
886
|
+
U(new Set(n));
|
|
887
|
+
for (const C of n)
|
|
888
|
+
await Q(`/user/${T.id}/unlocked-themes`, {
|
|
889
|
+
method: "POST",
|
|
890
|
+
headers: { "Content-Type": "application/json" },
|
|
891
|
+
body: JSON.stringify({ themeId: C })
|
|
892
|
+
});
|
|
893
|
+
localStorage.removeItem("dmusic-unlocked-themes");
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
} catch {
|
|
897
|
+
}
|
|
898
|
+
} catch {
|
|
899
|
+
try {
|
|
900
|
+
const t = localStorage.getItem("dmusic-unlocked-themes");
|
|
901
|
+
t && U(new Set(JSON.parse(t)));
|
|
902
|
+
} catch {
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
})();
|
|
906
|
+
}, [T]);
|
|
907
|
+
const q = async (t, o) => {
|
|
908
|
+
if (!(!T || j < o))
|
|
909
|
+
try {
|
|
910
|
+
const n = await Q(`/starpower/${T.id}/consume`, {
|
|
911
|
+
method: "POST",
|
|
912
|
+
headers: { "Content-Type": "application/json" },
|
|
913
|
+
body: JSON.stringify({ amount: o, purpose: "template_unlock", targetId: t })
|
|
914
|
+
});
|
|
915
|
+
if (n?.success) {
|
|
916
|
+
O?.(n.starPower);
|
|
917
|
+
const C = new Set(f);
|
|
918
|
+
C.add(t), U(C), await Q(`/user/${T.id}/unlocked-themes`, {
|
|
919
|
+
method: "POST",
|
|
920
|
+
headers: { "Content-Type": "application/json" },
|
|
921
|
+
body: JSON.stringify({ themeId: t })
|
|
922
|
+
});
|
|
923
|
+
}
|
|
924
|
+
} catch (n) {
|
|
925
|
+
console.error("Theme unlock error:", n);
|
|
926
|
+
}
|
|
927
|
+
}, [L, _] = u("happy"), [E, Z] = u(""), [I, s] = u(!1), [v, te] = u(null), [h, a] = u("idle"), d = et(), [x, de] = u("calm"), [w, c] = u([]), [R, Y] = u(""), [re, Ne] = u(10), [ve, ue] = u("verse-chorus"), [r, A] = u(["piano", "strings"]), [D, V] = u(100), [k, H] = u(!1), [X, G] = u(null), [ke, le] = u("idle"), [ne, tt] = u(null), [se, it] = u("energetic"), [at, Ge] = u(!1), [Ae, rt] = u(null), [Ce, oe] = u("idle"), [he, Re] = u([]), [ce, Ke] = u(null);
|
|
928
|
+
ye(() => {
|
|
929
|
+
if (M)
|
|
930
|
+
try {
|
|
931
|
+
const t = localStorage.getItem("d-music-works");
|
|
932
|
+
t && Re(JSON.parse(t));
|
|
933
|
+
} catch {
|
|
934
|
+
}
|
|
935
|
+
}, [M]);
|
|
936
|
+
const ie = P((t) => {
|
|
937
|
+
Re((o) => {
|
|
938
|
+
const n = [t, ...o].slice(0, 50);
|
|
939
|
+
try {
|
|
940
|
+
localStorage.setItem("d-music-works", JSON.stringify(n));
|
|
941
|
+
} catch {
|
|
942
|
+
}
|
|
943
|
+
return n;
|
|
944
|
+
});
|
|
945
|
+
}, []), lt = P((t) => {
|
|
946
|
+
Re((o) => {
|
|
947
|
+
const n = o.filter((C) => C.id !== t);
|
|
948
|
+
try {
|
|
949
|
+
localStorage.setItem("d-music-works", JSON.stringify(n));
|
|
950
|
+
} catch {
|
|
951
|
+
}
|
|
952
|
+
return n;
|
|
953
|
+
});
|
|
954
|
+
}, []), Be = P(async () => {
|
|
955
|
+
s(!0), a("lyrics"), p?.("medium");
|
|
956
|
+
try {
|
|
957
|
+
const t = await Q("/ai/lyrics", {
|
|
958
|
+
method: "POST",
|
|
959
|
+
headers: { "Content-Type": "application/json" },
|
|
960
|
+
body: JSON.stringify({
|
|
961
|
+
theme: L,
|
|
962
|
+
keywords: E ? E.split(/[,,\s]+/).filter(Boolean) : [],
|
|
963
|
+
lines: 8
|
|
964
|
+
})
|
|
965
|
+
});
|
|
966
|
+
if (!t?.lyrics) throw new Error("Lyrics generation failed");
|
|
967
|
+
te(t.lyrics), a("composing");
|
|
968
|
+
const o = await Q("/ai/compose", {
|
|
969
|
+
method: "POST",
|
|
970
|
+
headers: { "Content-Type": "application/json" },
|
|
971
|
+
body: JSON.stringify({
|
|
972
|
+
theme: L,
|
|
973
|
+
lyrics: t.lyrics,
|
|
974
|
+
lineCount: 8
|
|
975
|
+
})
|
|
976
|
+
});
|
|
977
|
+
if (!o?.composition) {
|
|
978
|
+
b?.(t.lyrics, L), ie({
|
|
979
|
+
id: `work-${Date.now()}`,
|
|
980
|
+
title: `${L} · Quick Song`,
|
|
981
|
+
theme: L,
|
|
982
|
+
lyrics: t.lyrics,
|
|
983
|
+
createdAt: Date.now(),
|
|
984
|
+
mode: "quick"
|
|
985
|
+
}), a("done"), p?.("success"), setTimeout(() => a("idle"), 2e3);
|
|
986
|
+
return;
|
|
987
|
+
}
|
|
988
|
+
a("synth");
|
|
989
|
+
const n = await d.compose(o.composition);
|
|
990
|
+
b?.(t.lyrics, L, n, o.composition), ie({
|
|
991
|
+
id: `work-${Date.now()}`,
|
|
992
|
+
title: `${L} · Quick Song`,
|
|
993
|
+
theme: L,
|
|
994
|
+
lyrics: t.lyrics,
|
|
995
|
+
createdAt: Date.now(),
|
|
996
|
+
mode: "quick"
|
|
997
|
+
}), a("done"), p?.("success"), setTimeout(() => a("idle"), 2500);
|
|
998
|
+
} catch (t) {
|
|
999
|
+
console.error("Quick create failed:", t), v && b?.(v, L), a("idle");
|
|
1000
|
+
} finally {
|
|
1001
|
+
s(!1);
|
|
1002
|
+
}
|
|
1003
|
+
}, [L, E, b, d, p, v, ie]), st = P(async () => {
|
|
1004
|
+
H(!0), le("lyrics"), p?.("medium");
|
|
1005
|
+
try {
|
|
1006
|
+
const t = await Q("/ai/lyrics", {
|
|
1007
|
+
method: "POST",
|
|
1008
|
+
headers: { "Content-Type": "application/json" },
|
|
1009
|
+
body: JSON.stringify({
|
|
1010
|
+
theme: x,
|
|
1011
|
+
keywords: w,
|
|
1012
|
+
lines: re
|
|
1013
|
+
})
|
|
1014
|
+
});
|
|
1015
|
+
if (!t?.lyrics) throw new Error("Lyrics generation failed");
|
|
1016
|
+
G(t.lyrics), le("composing");
|
|
1017
|
+
const o = await Q("/ai/compose", {
|
|
1018
|
+
method: "POST",
|
|
1019
|
+
headers: { "Content-Type": "application/json" },
|
|
1020
|
+
body: JSON.stringify({
|
|
1021
|
+
theme: x,
|
|
1022
|
+
lyrics: t.lyrics,
|
|
1023
|
+
lineCount: re
|
|
1024
|
+
})
|
|
1025
|
+
});
|
|
1026
|
+
if (!o?.composition) {
|
|
1027
|
+
b?.(t.lyrics, x), ie({
|
|
1028
|
+
id: `work-${Date.now()}`,
|
|
1029
|
+
title: `${x} · Master Work`,
|
|
1030
|
+
theme: x,
|
|
1031
|
+
lyrics: t.lyrics,
|
|
1032
|
+
createdAt: Date.now(),
|
|
1033
|
+
mode: "master"
|
|
1034
|
+
}), le("done"), p?.("success"), setTimeout(() => le("idle"), 2e3);
|
|
1035
|
+
return;
|
|
1036
|
+
}
|
|
1037
|
+
le("synth");
|
|
1038
|
+
const n = await d.compose(o.composition);
|
|
1039
|
+
b?.(t.lyrics, x, n, o.composition), ie({
|
|
1040
|
+
id: `work-${Date.now()}`,
|
|
1041
|
+
title: `${x} · Master Work`,
|
|
1042
|
+
theme: x,
|
|
1043
|
+
lyrics: t.lyrics,
|
|
1044
|
+
createdAt: Date.now(),
|
|
1045
|
+
mode: "master"
|
|
1046
|
+
}), le("done"), p?.("success"), setTimeout(() => le("idle"), 2500);
|
|
1047
|
+
} catch (t) {
|
|
1048
|
+
console.error("Master create failed:", t), le("idle");
|
|
1049
|
+
} finally {
|
|
1050
|
+
H(!1);
|
|
1051
|
+
}
|
|
1052
|
+
}, [x, w, re, b, d, p, ie]), ot = P(async () => {
|
|
1053
|
+
if (ne !== null) {
|
|
1054
|
+
Ge(!0), oe("lyrics"), p?.("medium");
|
|
1055
|
+
try {
|
|
1056
|
+
const t = g[ne], o = t.lyrics.slice(1, 5).map((Ze) => Ze.text).join(" ").split(" ").filter((Ze) => Ze.length > 3).slice(0, 5), n = await Q("/ai/lyrics", {
|
|
1057
|
+
method: "POST",
|
|
1058
|
+
headers: { "Content-Type": "application/json" },
|
|
1059
|
+
body: JSON.stringify({
|
|
1060
|
+
theme: se,
|
|
1061
|
+
keywords: o,
|
|
1062
|
+
lines: 8
|
|
1063
|
+
})
|
|
1064
|
+
});
|
|
1065
|
+
if (!n?.lyrics) throw new Error("Remix lyrics failed");
|
|
1066
|
+
rt(n.lyrics), oe("composing");
|
|
1067
|
+
const C = await Q("/ai/compose", {
|
|
1068
|
+
method: "POST",
|
|
1069
|
+
headers: { "Content-Type": "application/json" },
|
|
1070
|
+
body: JSON.stringify({
|
|
1071
|
+
theme: se,
|
|
1072
|
+
lyrics: n.lyrics,
|
|
1073
|
+
lineCount: 8
|
|
1074
|
+
})
|
|
1075
|
+
}), me = `Remix · ${t.title}`;
|
|
1076
|
+
if (!C?.composition) {
|
|
1077
|
+
b?.(n.lyrics, se), ie({ id: `work-${Date.now()}`, title: me, theme: se, lyrics: n.lyrics, createdAt: Date.now(), mode: "remix" }), oe("done"), p?.("success"), setTimeout(() => oe("idle"), 2e3);
|
|
1078
|
+
return;
|
|
1079
|
+
}
|
|
1080
|
+
oe("synth");
|
|
1081
|
+
const be = await d.compose(C.composition);
|
|
1082
|
+
b?.(n.lyrics, se, be, C.composition), ie({ id: `work-${Date.now()}`, title: me, theme: se, lyrics: n.lyrics, createdAt: Date.now(), mode: "remix" }), oe("done"), p?.("success"), setTimeout(() => oe("idle"), 2500);
|
|
1083
|
+
} catch (t) {
|
|
1084
|
+
console.error("Remix failed:", t), oe("idle");
|
|
1085
|
+
} finally {
|
|
1086
|
+
Ge(!1);
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
}, [ne, se, g, b, p, ie, d]), Se = P((t, o) => {
|
|
1090
|
+
navigator.clipboard.writeText(t.join(`
|
|
1091
|
+
`)), Ke(o), setTimeout(() => Ke(null), 2e3);
|
|
1092
|
+
}, []), Je = P(() => {
|
|
1093
|
+
const t = R.trim();
|
|
1094
|
+
t && w.length < 8 && !w.includes(t) && (c((o) => [...o, t]), Y(""));
|
|
1095
|
+
}, [R, w]), nt = P((t) => {
|
|
1096
|
+
A(
|
|
1097
|
+
(o) => o.includes(t) ? o.filter((n) => n !== t) : [...o, t]
|
|
1098
|
+
);
|
|
1099
|
+
}, []), ct = P((t) => {
|
|
1100
|
+
const o = new Date(t);
|
|
1101
|
+
return `${o.getMonth() + 1}/${o.getDate()} ${o.getHours()}:${o.getMinutes().toString().padStart(2, "0")}`;
|
|
1102
|
+
}, []), Le = (t) => t === "lyrics" ? l === "zh" ? "AI 写词中..." : "Generating lyrics..." : t === "composing" ? l === "zh" ? "编曲设计中..." : "Composing..." : t === "synth" ? l === "zh" ? `音频合成 ${Math.round(d.progress * 100)}%` : `Synthesizing ${Math.round(d.progress * 100)}%` : t === "done" ? l === "zh" ? "创作完成!" : "Complete!" : "";
|
|
1103
|
+
return /* @__PURE__ */ e(F, { children: M && /* @__PURE__ */ i(z, { children: [
|
|
1104
|
+
/* @__PURE__ */ e(
|
|
1105
|
+
m.div,
|
|
1106
|
+
{
|
|
1107
|
+
initial: { opacity: 0 },
|
|
1108
|
+
animate: { opacity: 1 },
|
|
1109
|
+
exit: { opacity: 0 },
|
|
1110
|
+
className: "fixed inset-0 z-[60] bg-black/60 backdrop-blur-md",
|
|
1111
|
+
onClick: $
|
|
1112
|
+
}
|
|
1113
|
+
),
|
|
1114
|
+
/* @__PURE__ */ i(
|
|
1115
|
+
m.div,
|
|
1116
|
+
{
|
|
1117
|
+
initial: { y: "100%", opacity: 0 },
|
|
1118
|
+
animate: { y: 0, opacity: 1 },
|
|
1119
|
+
exit: { y: "100%", opacity: 0 },
|
|
1120
|
+
transition: { type: "spring", damping: 28, stiffness: 300 },
|
|
1121
|
+
className: "fixed inset-x-0 bottom-0 z-[61] max-h-[92vh] bg-[#0B1030]/98 backdrop-blur-2xl border-t border-white/10 rounded-t-3xl flex flex-col shadow-2xl md:inset-x-auto md:left-1/2 md:-translate-x-1/2 md:w-full md:max-w-xl md:bottom-auto md:top-1/2 md:-translate-y-1/2 md:rounded-2xl md:border md:max-h-[88vh]",
|
|
1122
|
+
children: [
|
|
1123
|
+
/* @__PURE__ */ i("div", { className: "flex items-center justify-between p-5 pb-3 border-b border-white/[0.06] flex-shrink-0", children: [
|
|
1124
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-3", children: [
|
|
1125
|
+
N && /* @__PURE__ */ e(
|
|
1126
|
+
"button",
|
|
1127
|
+
{
|
|
1128
|
+
onClick: () => {
|
|
1129
|
+
S(null), p?.("light");
|
|
1130
|
+
},
|
|
1131
|
+
className: "p-1.5 rounded-lg text-white/40 hover:text-white/70 hover:bg-white/5 transition-colors mr-1",
|
|
1132
|
+
children: /* @__PURE__ */ e(pt, { className: "w-4 h-4" })
|
|
1133
|
+
}
|
|
1134
|
+
),
|
|
1135
|
+
/* @__PURE__ */ e("div", { className: "w-9 h-9 rounded-xl bg-gradient-to-tr from-purple-500/20 to-pink-500/20 border border-white/10 flex items-center justify-center", children: /* @__PURE__ */ e(We, { className: "w-4 h-4 text-purple-400" }) }),
|
|
1136
|
+
/* @__PURE__ */ i("div", { children: [
|
|
1137
|
+
/* @__PURE__ */ e("h3", { className: "text-white font-semibold text-sm leading-tight", children: N ? ze.find((t) => t.id === N)?.[l === "zh" ? "labelZh" : "label"] : l === "zh" ? "AI 创作工坊" : "AI Creation Studio" }),
|
|
1138
|
+
/* @__PURE__ */ e("p", { className: "text-white/30 text-xs", children: N ? ze.find((t) => t.id === N)?.[l === "zh" ? "descZh" : "desc"] : l === "zh" ? "选择创作模式开始" : "Choose a creation mode" })
|
|
1139
|
+
] })
|
|
1140
|
+
] }),
|
|
1141
|
+
/* @__PURE__ */ e(
|
|
1142
|
+
"button",
|
|
1143
|
+
{
|
|
1144
|
+
onClick: $,
|
|
1145
|
+
className: "p-2 rounded-lg text-white/40 hover:text-white/70 hover:bg-white/5 transition-colors",
|
|
1146
|
+
children: /* @__PURE__ */ e(ae, { className: "w-4 h-4" })
|
|
1147
|
+
}
|
|
1148
|
+
)
|
|
1149
|
+
] }),
|
|
1150
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto", style: { scrollbarWidth: "none" }, children: /* @__PURE__ */ i(F, { mode: "wait", children: [
|
|
1151
|
+
!N && /* @__PURE__ */ i(
|
|
1152
|
+
m.div,
|
|
1153
|
+
{
|
|
1154
|
+
initial: { opacity: 0, y: 10 },
|
|
1155
|
+
animate: { opacity: 1, y: 0 },
|
|
1156
|
+
exit: { opacity: 0, y: -10 },
|
|
1157
|
+
className: "p-5 space-y-3",
|
|
1158
|
+
children: [
|
|
1159
|
+
ze.map((t, o) => {
|
|
1160
|
+
const n = t.icon;
|
|
1161
|
+
return /* @__PURE__ */ i(
|
|
1162
|
+
m.button,
|
|
1163
|
+
{
|
|
1164
|
+
initial: { opacity: 0, x: -20 },
|
|
1165
|
+
animate: { opacity: 1, x: 0 },
|
|
1166
|
+
transition: { delay: o * 0.08 },
|
|
1167
|
+
onClick: () => {
|
|
1168
|
+
if (t.id === "mv") {
|
|
1169
|
+
J?.(), p?.("selection");
|
|
1170
|
+
return;
|
|
1171
|
+
}
|
|
1172
|
+
S(t.id), p?.("selection");
|
|
1173
|
+
},
|
|
1174
|
+
className: "w-full flex items-center gap-4 p-4 rounded-xl bg-white/[0.03] border border-white/[0.06] hover:bg-white/[0.06] hover:border-white/[0.12] transition-all group text-left",
|
|
1175
|
+
children: [
|
|
1176
|
+
/* @__PURE__ */ e("div", { className: y(
|
|
1177
|
+
"w-12 h-12 rounded-xl bg-gradient-to-br flex items-center justify-center flex-shrink-0",
|
|
1178
|
+
t.gradient
|
|
1179
|
+
), children: /* @__PURE__ */ e(n, { className: "w-5 h-5 text-white" }) }),
|
|
1180
|
+
/* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
|
|
1181
|
+
/* @__PURE__ */ e("p", { className: "text-sm font-semibold text-white/90 group-hover:text-white transition-colors", children: l === "zh" ? t.labelZh : t.label }),
|
|
1182
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-white/30 mt-0.5", children: l === "zh" ? t.descZh : t.desc })
|
|
1183
|
+
] }),
|
|
1184
|
+
t.id === "mv" ? /* @__PURE__ */ e(bt, { className: "w-4 h-4 text-cyan-400/40 group-hover:text-cyan-400/70 transition-colors flex-shrink-0" }) : /* @__PURE__ */ e(wt, { className: "w-4 h-4 text-white/20 group-hover:text-white/40 transition-colors flex-shrink-0" })
|
|
1185
|
+
]
|
|
1186
|
+
},
|
|
1187
|
+
t.id
|
|
1188
|
+
);
|
|
1189
|
+
}),
|
|
1190
|
+
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mt-4 pt-4 border-t border-white/[0.04]", children: [
|
|
1191
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-1.5 text-white/20 text-xs", children: [
|
|
1192
|
+
/* @__PURE__ */ e($e, { className: "w-3.5 h-3.5" }),
|
|
1193
|
+
/* @__PURE__ */ e("span", { children: l === "zh" ? `${he.length} 首作品` : `${he.length} works` })
|
|
1194
|
+
] }),
|
|
1195
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-1.5 text-white/20 text-xs", children: [
|
|
1196
|
+
/* @__PURE__ */ e(Ie, { className: "w-3.5 h-3.5" }),
|
|
1197
|
+
/* @__PURE__ */ e("span", { children: l === "zh" ? "AI驱动创作" : "AI-powered creation" })
|
|
1198
|
+
] })
|
|
1199
|
+
] })
|
|
1200
|
+
]
|
|
1201
|
+
},
|
|
1202
|
+
"hub"
|
|
1203
|
+
),
|
|
1204
|
+
N === "quick" && /* @__PURE__ */ i(
|
|
1205
|
+
m.div,
|
|
1206
|
+
{
|
|
1207
|
+
initial: { opacity: 0, x: 20 },
|
|
1208
|
+
animate: { opacity: 1, x: 0 },
|
|
1209
|
+
exit: { opacity: 0, x: -20 },
|
|
1210
|
+
className: "p-5 space-y-5",
|
|
1211
|
+
children: [
|
|
1212
|
+
/* @__PURE__ */ i("div", { children: [
|
|
1213
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-white/40 font-medium uppercase tracking-wider mb-3", children: l === "zh" ? "选择情绪主题" : "Choose Mood" }),
|
|
1214
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-5 gap-2", children: Me.map((t) => {
|
|
1215
|
+
const o = t.icon, n = L === t.id, C = t.premium && !f.has(t.id);
|
|
1216
|
+
return /* @__PURE__ */ i(
|
|
1217
|
+
"button",
|
|
1218
|
+
{
|
|
1219
|
+
onClick: () => {
|
|
1220
|
+
if (C) {
|
|
1221
|
+
T && j >= (t.spCost || 200) && q(t.id, t.spCost || 200);
|
|
1222
|
+
return;
|
|
1223
|
+
}
|
|
1224
|
+
_(t.id), p?.("selection");
|
|
1225
|
+
},
|
|
1226
|
+
className: y(
|
|
1227
|
+
"p-3 rounded-xl border transition-all text-center relative",
|
|
1228
|
+
C ? "bg-white/[0.01] border-white/[0.04] opacity-60" : n ? `bg-gradient-to-br ${t.bg} border-white/15 shadow-lg` : "bg-white/[0.02] border-white/[0.06] hover:bg-white/[0.05]"
|
|
1229
|
+
),
|
|
1230
|
+
children: [
|
|
1231
|
+
C && /* @__PURE__ */ i("span", { className: "absolute -top-1 -right-1 text-[8px] px-1 py-0.5 rounded-full bg-yellow-500/20 text-yellow-300 border border-yellow-500/20 font-medium", children: [
|
|
1232
|
+
t.spCost,
|
|
1233
|
+
"SP"
|
|
1234
|
+
] }),
|
|
1235
|
+
/* @__PURE__ */ e(o, { className: y("w-5 h-5 mx-auto mb-1", n ? t.color : C ? "text-white/15" : "text-white/30") }),
|
|
1236
|
+
/* @__PURE__ */ e("p", { className: y("text-[10px]", n ? "text-white/80" : "text-white/30"), children: l === "zh" ? t.labelZh : t.label })
|
|
1237
|
+
]
|
|
1238
|
+
},
|
|
1239
|
+
t.id
|
|
1240
|
+
);
|
|
1241
|
+
}) })
|
|
1242
|
+
] }),
|
|
1243
|
+
/* @__PURE__ */ i("div", { children: [
|
|
1244
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-white/40 font-medium uppercase tracking-wider mb-2", children: l === "zh" ? "灵感关键词(可选)" : "Inspiration Keywords (optional)" }),
|
|
1245
|
+
/* @__PURE__ */ e(
|
|
1246
|
+
"input",
|
|
1247
|
+
{
|
|
1248
|
+
type: "text",
|
|
1249
|
+
value: E,
|
|
1250
|
+
onChange: (t) => Z(t.target.value),
|
|
1251
|
+
onKeyDown: (t) => t.key === "Enter" && Be(),
|
|
1252
|
+
placeholder: l === "zh" ? "输入关键词,用逗号分隔..." : "Enter keywords, comma separated...",
|
|
1253
|
+
className: "w-full bg-white/5 border border-white/10 rounded-lg py-2.5 px-3 text-sm text-white placeholder:text-white/20 focus:outline-none focus:border-purple-500/50"
|
|
1254
|
+
}
|
|
1255
|
+
)
|
|
1256
|
+
] }),
|
|
1257
|
+
/* @__PURE__ */ e(
|
|
1258
|
+
m.button,
|
|
1259
|
+
{
|
|
1260
|
+
onClick: Be,
|
|
1261
|
+
disabled: I,
|
|
1262
|
+
whileHover: { scale: 1.01 },
|
|
1263
|
+
whileTap: { scale: 0.98 },
|
|
1264
|
+
className: "w-full py-4 rounded-xl bg-gradient-to-r from-purple-600 via-pink-600 to-blue-600 text-white font-semibold flex items-center justify-center gap-3 shadow-lg shadow-purple-500/20 disabled:opacity-50 transition-opacity text-base",
|
|
1265
|
+
children: h !== "idle" && h !== "done" ? /* @__PURE__ */ i(z, { children: [
|
|
1266
|
+
/* @__PURE__ */ e(fe, { className: "w-5 h-5 animate-spin" }),
|
|
1267
|
+
Le(h)
|
|
1268
|
+
] }) : h === "done" ? /* @__PURE__ */ i(z, { children: [
|
|
1269
|
+
/* @__PURE__ */ e(ee, { className: "w-5 h-5 text-green-300" }),
|
|
1270
|
+
l === "zh" ? "创作完成!" : "Complete!"
|
|
1271
|
+
] }) : /* @__PURE__ */ i(z, { children: [
|
|
1272
|
+
/* @__PURE__ */ e(Ie, { className: "w-5 h-5" }),
|
|
1273
|
+
l === "zh" ? "一键创作" : "Create Now"
|
|
1274
|
+
] })
|
|
1275
|
+
}
|
|
1276
|
+
),
|
|
1277
|
+
/* @__PURE__ */ e(F, { children: v && /* @__PURE__ */ i(
|
|
1278
|
+
m.div,
|
|
1279
|
+
{
|
|
1280
|
+
initial: { opacity: 0, y: 15 },
|
|
1281
|
+
animate: { opacity: 1, y: 0 },
|
|
1282
|
+
className: "rounded-xl border border-white/[0.08] bg-gradient-to-br from-purple-500/10 to-pink-500/10 p-4",
|
|
1283
|
+
children: [
|
|
1284
|
+
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
|
|
1285
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-white/40 font-medium", children: l === "zh" ? "生成的歌词" : "Generated Lyrics" }),
|
|
1286
|
+
/* @__PURE__ */ i(
|
|
1287
|
+
"button",
|
|
1288
|
+
{
|
|
1289
|
+
onClick: () => Se(v, "quick"),
|
|
1290
|
+
className: "flex items-center gap-1 px-2 py-1 rounded-lg bg-white/5 text-xs text-white/40 hover:text-white/70 transition-colors",
|
|
1291
|
+
children: [
|
|
1292
|
+
ce === "quick" ? /* @__PURE__ */ e(ee, { className: "w-3 h-3 text-green-400" }) : /* @__PURE__ */ e(ge, { className: "w-3 h-3" }),
|
|
1293
|
+
ce === "quick" ? l === "zh" ? "已复制" : "Copied" : l === "zh" ? "复制" : "Copy"
|
|
1294
|
+
]
|
|
1295
|
+
}
|
|
1296
|
+
)
|
|
1297
|
+
] }),
|
|
1298
|
+
/* @__PURE__ */ e("div", { className: "space-y-1.5", children: v.map((t, o) => /* @__PURE__ */ e(
|
|
1299
|
+
m.p,
|
|
1300
|
+
{
|
|
1301
|
+
initial: { opacity: 0, x: -8 },
|
|
1302
|
+
animate: { opacity: 1, x: 0 },
|
|
1303
|
+
transition: { delay: o * 0.06 },
|
|
1304
|
+
className: "text-sm text-white/70 leading-relaxed",
|
|
1305
|
+
children: t
|
|
1306
|
+
},
|
|
1307
|
+
o
|
|
1308
|
+
)) })
|
|
1309
|
+
]
|
|
1310
|
+
}
|
|
1311
|
+
) })
|
|
1312
|
+
]
|
|
1313
|
+
},
|
|
1314
|
+
"quick"
|
|
1315
|
+
),
|
|
1316
|
+
N === "master" && /* @__PURE__ */ i(
|
|
1317
|
+
m.div,
|
|
1318
|
+
{
|
|
1319
|
+
initial: { opacity: 0, x: 20 },
|
|
1320
|
+
animate: { opacity: 1, x: 0 },
|
|
1321
|
+
exit: { opacity: 0, x: -20 },
|
|
1322
|
+
className: "p-5 space-y-5",
|
|
1323
|
+
children: [
|
|
1324
|
+
/* @__PURE__ */ i("div", { children: [
|
|
1325
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-white/40 font-medium uppercase tracking-wider mb-3", children: l === "zh" ? "情绪基调" : "Emotional Base" }),
|
|
1326
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-5 gap-2", children: Me.map((t) => {
|
|
1327
|
+
const o = t.icon, n = x === t.id, C = t.premium && !f.has(t.id);
|
|
1328
|
+
return /* @__PURE__ */ i(
|
|
1329
|
+
"button",
|
|
1330
|
+
{
|
|
1331
|
+
onClick: () => {
|
|
1332
|
+
if (C) {
|
|
1333
|
+
T && j >= (t.spCost || 200) && q(t.id, t.spCost || 200);
|
|
1334
|
+
return;
|
|
1335
|
+
}
|
|
1336
|
+
de(t.id), p?.("selection");
|
|
1337
|
+
},
|
|
1338
|
+
className: y(
|
|
1339
|
+
"p-2.5 rounded-xl border transition-all text-center relative",
|
|
1340
|
+
C ? "bg-white/[0.01] border-white/[0.04] opacity-60" : n ? `bg-gradient-to-br ${t.bg} border-white/15` : "bg-white/[0.02] border-white/[0.06] hover:bg-white/[0.05]"
|
|
1341
|
+
),
|
|
1342
|
+
children: [
|
|
1343
|
+
C && /* @__PURE__ */ i("span", { className: "absolute -top-1 -right-1 text-[8px] px-1 py-0.5 rounded-full bg-yellow-500/20 text-yellow-300 border border-yellow-500/20 font-medium", children: [
|
|
1344
|
+
t.spCost,
|
|
1345
|
+
"SP"
|
|
1346
|
+
] }),
|
|
1347
|
+
/* @__PURE__ */ e(o, { className: y("w-4 h-4 mx-auto mb-0.5", n ? t.color : C ? "text-white/15" : "text-white/30") }),
|
|
1348
|
+
/* @__PURE__ */ e("p", { className: y("text-[9px]", n ? "text-white/80" : "text-white/30"), children: l === "zh" ? t.labelZh : t.label })
|
|
1349
|
+
]
|
|
1350
|
+
},
|
|
1351
|
+
t.id
|
|
1352
|
+
);
|
|
1353
|
+
}) })
|
|
1354
|
+
] }),
|
|
1355
|
+
/* @__PURE__ */ i("div", { children: [
|
|
1356
|
+
/* @__PURE__ */ i("p", { className: "text-xs text-white/40 font-medium uppercase tracking-wider mb-2", children: [
|
|
1357
|
+
l === "zh" ? "创作关键词" : "Keywords",
|
|
1358
|
+
" ",
|
|
1359
|
+
/* @__PURE__ */ i("span", { className: "text-white/20", children: [
|
|
1360
|
+
"(",
|
|
1361
|
+
w.length,
|
|
1362
|
+
"/8)"
|
|
1363
|
+
] })
|
|
1364
|
+
] }),
|
|
1365
|
+
/* @__PURE__ */ i("div", { className: "flex gap-2 mb-2", children: [
|
|
1366
|
+
/* @__PURE__ */ e(
|
|
1367
|
+
"input",
|
|
1368
|
+
{
|
|
1369
|
+
type: "text",
|
|
1370
|
+
value: R,
|
|
1371
|
+
onChange: (t) => Y(t.target.value),
|
|
1372
|
+
onKeyDown: (t) => t.key === "Enter" && Je(),
|
|
1373
|
+
placeholder: l === "zh" ? "添加关键词..." : "Add keyword...",
|
|
1374
|
+
className: "flex-1 bg-white/5 border border-white/10 rounded-lg py-2 px-3 text-sm text-white placeholder:text-white/20 focus:outline-none focus:border-purple-500/50"
|
|
1375
|
+
}
|
|
1376
|
+
),
|
|
1377
|
+
/* @__PURE__ */ e(
|
|
1378
|
+
"button",
|
|
1379
|
+
{
|
|
1380
|
+
onClick: Je,
|
|
1381
|
+
disabled: !R.trim() || w.length >= 8,
|
|
1382
|
+
className: "p-2 rounded-lg bg-white/5 border border-white/[0.08] text-white/60 hover:text-white transition-colors disabled:opacity-30",
|
|
1383
|
+
children: /* @__PURE__ */ e(xe, { className: "w-4 h-4" })
|
|
1384
|
+
}
|
|
1385
|
+
)
|
|
1386
|
+
] }),
|
|
1387
|
+
w.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1.5", children: w.map((t) => /* @__PURE__ */ i("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 bg-indigo-500/10 border border-indigo-500/20 rounded-full text-xs text-indigo-300", children: [
|
|
1388
|
+
t,
|
|
1389
|
+
/* @__PURE__ */ e("button", { onClick: () => c((o) => o.filter((n) => n !== t)), className: "text-indigo-400/60 hover:text-indigo-300", children: /* @__PURE__ */ e(ae, { className: "w-3 h-3" }) })
|
|
1390
|
+
] }, t)) })
|
|
1391
|
+
] }),
|
|
1392
|
+
/* @__PURE__ */ i("div", { children: [
|
|
1393
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-white/40 font-medium uppercase tracking-wider mb-2", children: l === "zh" ? "歌曲结构" : "Song Structure" }),
|
|
1394
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-2 gap-2", children: Mt.map((t) => /* @__PURE__ */ e(
|
|
1395
|
+
"button",
|
|
1396
|
+
{
|
|
1397
|
+
onClick: () => ue(t.id),
|
|
1398
|
+
className: y(
|
|
1399
|
+
"py-2 px-3 rounded-lg border text-xs transition-all",
|
|
1400
|
+
ve === t.id ? "bg-indigo-500/15 border-indigo-500/30 text-indigo-300" : "bg-white/[0.02] border-white/[0.06] text-white/40 hover:bg-white/[0.05]"
|
|
1401
|
+
),
|
|
1402
|
+
children: l === "zh" ? t.labelZh : t.label
|
|
1403
|
+
},
|
|
1404
|
+
t.id
|
|
1405
|
+
)) })
|
|
1406
|
+
] }),
|
|
1407
|
+
/* @__PURE__ */ i("div", { children: [
|
|
1408
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-white/40 font-medium uppercase tracking-wider mb-2", children: l === "zh" ? "乐器编排" : "Instruments" }),
|
|
1409
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-2", children: zt.map((t) => /* @__PURE__ */ i(
|
|
1410
|
+
"button",
|
|
1411
|
+
{
|
|
1412
|
+
onClick: () => nt(t.id),
|
|
1413
|
+
className: y(
|
|
1414
|
+
"py-2 px-3 rounded-lg border text-xs transition-all flex items-center gap-1.5",
|
|
1415
|
+
r.includes(t.id) ? "bg-indigo-500/15 border-indigo-500/30 text-indigo-300" : "bg-white/[0.02] border-white/[0.06] text-white/40 hover:bg-white/[0.05]"
|
|
1416
|
+
),
|
|
1417
|
+
children: [
|
|
1418
|
+
/* @__PURE__ */ e("span", { children: t.emoji }),
|
|
1419
|
+
/* @__PURE__ */ e("span", { children: l === "zh" ? t.labelZh : t.label })
|
|
1420
|
+
]
|
|
1421
|
+
},
|
|
1422
|
+
t.id
|
|
1423
|
+
)) })
|
|
1424
|
+
] }),
|
|
1425
|
+
/* @__PURE__ */ i("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
1426
|
+
/* @__PURE__ */ i("div", { children: [
|
|
1427
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-white/40 font-medium uppercase tracking-wider mb-2", children: l === "zh" ? "歌词行数" : "Lines" }),
|
|
1428
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
1429
|
+
/* @__PURE__ */ e(
|
|
1430
|
+
"button",
|
|
1431
|
+
{
|
|
1432
|
+
onClick: () => Ne(Math.max(4, re - 2)),
|
|
1433
|
+
className: "p-1.5 rounded-lg bg-white/5 border border-white/[0.08] text-white/60 hover:text-white transition-colors",
|
|
1434
|
+
children: /* @__PURE__ */ e(Te, { className: "w-3.5 h-3.5" })
|
|
1435
|
+
}
|
|
1436
|
+
),
|
|
1437
|
+
/* @__PURE__ */ e("span", { className: "text-lg font-bold text-white font-mono flex-1 text-center", children: re }),
|
|
1438
|
+
/* @__PURE__ */ e(
|
|
1439
|
+
"button",
|
|
1440
|
+
{
|
|
1441
|
+
onClick: () => Ne(Math.min(20, re + 2)),
|
|
1442
|
+
className: "p-1.5 rounded-lg bg-white/5 border border-white/[0.08] text-white/60 hover:text-white transition-colors",
|
|
1443
|
+
children: /* @__PURE__ */ e(xe, { className: "w-3.5 h-3.5" })
|
|
1444
|
+
}
|
|
1445
|
+
)
|
|
1446
|
+
] })
|
|
1447
|
+
] }),
|
|
1448
|
+
/* @__PURE__ */ i("div", { children: [
|
|
1449
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-white/40 font-medium uppercase tracking-wider mb-2", children: l === "zh" ? "速度 BPM" : "Tempo BPM" }),
|
|
1450
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
1451
|
+
/* @__PURE__ */ e(
|
|
1452
|
+
"button",
|
|
1453
|
+
{
|
|
1454
|
+
onClick: () => V(Math.max(60, D - 10)),
|
|
1455
|
+
className: "p-1.5 rounded-lg bg-white/5 border border-white/[0.08] text-white/60 hover:text-white transition-colors",
|
|
1456
|
+
children: /* @__PURE__ */ e(Te, { className: "w-3.5 h-3.5" })
|
|
1457
|
+
}
|
|
1458
|
+
),
|
|
1459
|
+
/* @__PURE__ */ e("span", { className: "text-lg font-bold text-white font-mono flex-1 text-center", children: D }),
|
|
1460
|
+
/* @__PURE__ */ e(
|
|
1461
|
+
"button",
|
|
1462
|
+
{
|
|
1463
|
+
onClick: () => V(Math.min(200, D + 10)),
|
|
1464
|
+
className: "p-1.5 rounded-lg bg-white/5 border border-white/[0.08] text-white/60 hover:text-white transition-colors",
|
|
1465
|
+
children: /* @__PURE__ */ e(xe, { className: "w-3.5 h-3.5" })
|
|
1466
|
+
}
|
|
1467
|
+
)
|
|
1468
|
+
] })
|
|
1469
|
+
] })
|
|
1470
|
+
] }),
|
|
1471
|
+
/* @__PURE__ */ e(
|
|
1472
|
+
m.button,
|
|
1473
|
+
{
|
|
1474
|
+
onClick: st,
|
|
1475
|
+
disabled: k,
|
|
1476
|
+
whileHover: { scale: 1.01 },
|
|
1477
|
+
whileTap: { scale: 0.98 },
|
|
1478
|
+
className: "w-full py-3.5 rounded-xl bg-gradient-to-r from-indigo-600 via-blue-600 to-purple-600 text-white font-semibold flex items-center justify-center gap-2 shadow-lg shadow-indigo-500/20 disabled:opacity-50",
|
|
1479
|
+
children: ke !== "idle" && ke !== "done" ? /* @__PURE__ */ i(z, { children: [
|
|
1480
|
+
/* @__PURE__ */ e(fe, { className: "w-5 h-5 animate-spin" }),
|
|
1481
|
+
Le(ke)
|
|
1482
|
+
] }) : ke === "done" ? /* @__PURE__ */ i(z, { children: [
|
|
1483
|
+
/* @__PURE__ */ e(ee, { className: "w-5 h-5 text-green-300" }),
|
|
1484
|
+
l === "zh" ? "大师之作完成!" : "Masterpiece Complete!"
|
|
1485
|
+
] }) : /* @__PURE__ */ i(z, { children: [
|
|
1486
|
+
/* @__PURE__ */ e(We, { className: "w-5 h-5" }),
|
|
1487
|
+
l === "zh" ? "开始创作" : "Start Creating"
|
|
1488
|
+
] })
|
|
1489
|
+
}
|
|
1490
|
+
),
|
|
1491
|
+
/* @__PURE__ */ e(F, { children: X && /* @__PURE__ */ i(
|
|
1492
|
+
m.div,
|
|
1493
|
+
{
|
|
1494
|
+
initial: { opacity: 0, y: 15 },
|
|
1495
|
+
animate: { opacity: 1, y: 0 },
|
|
1496
|
+
className: "rounded-xl border border-white/[0.08] bg-gradient-to-br from-indigo-500/10 to-blue-500/10 p-4",
|
|
1497
|
+
children: [
|
|
1498
|
+
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
|
|
1499
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-white/40", children: l === "zh" ? "大师之作" : "Master Work" }),
|
|
1500
|
+
/* @__PURE__ */ i(
|
|
1501
|
+
"button",
|
|
1502
|
+
{
|
|
1503
|
+
onClick: () => Se(X, "master"),
|
|
1504
|
+
className: "flex items-center gap-1 px-2 py-1 rounded-lg bg-white/5 text-xs text-white/40 hover:text-white/70 transition-colors",
|
|
1505
|
+
children: [
|
|
1506
|
+
ce === "master" ? /* @__PURE__ */ e(ee, { className: "w-3 h-3 text-green-400" }) : /* @__PURE__ */ e(ge, { className: "w-3 h-3" }),
|
|
1507
|
+
ce === "master" ? l === "zh" ? "已复制" : "Copied" : l === "zh" ? "复制" : "Copy"
|
|
1508
|
+
]
|
|
1509
|
+
}
|
|
1510
|
+
)
|
|
1511
|
+
] }),
|
|
1512
|
+
/* @__PURE__ */ e("div", { className: "space-y-1.5", children: X.map((t, o) => /* @__PURE__ */ e(
|
|
1513
|
+
m.p,
|
|
1514
|
+
{
|
|
1515
|
+
initial: { opacity: 0, x: -8 },
|
|
1516
|
+
animate: { opacity: 1, x: 0 },
|
|
1517
|
+
transition: { delay: o * 0.05 },
|
|
1518
|
+
className: "text-sm text-white/70 leading-relaxed",
|
|
1519
|
+
children: t
|
|
1520
|
+
},
|
|
1521
|
+
o
|
|
1522
|
+
)) })
|
|
1523
|
+
]
|
|
1524
|
+
}
|
|
1525
|
+
) })
|
|
1526
|
+
]
|
|
1527
|
+
},
|
|
1528
|
+
"master"
|
|
1529
|
+
),
|
|
1530
|
+
N === "remix" && /* @__PURE__ */ i(
|
|
1531
|
+
m.div,
|
|
1532
|
+
{
|
|
1533
|
+
initial: { opacity: 0, x: 20 },
|
|
1534
|
+
animate: { opacity: 1, x: 0 },
|
|
1535
|
+
exit: { opacity: 0, x: -20 },
|
|
1536
|
+
className: "p-5 space-y-5",
|
|
1537
|
+
children: [
|
|
1538
|
+
/* @__PURE__ */ i("div", { children: [
|
|
1539
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-white/40 font-medium uppercase tracking-wider mb-3", children: l === "zh" ? "选择原曲" : "Select Source Track" }),
|
|
1540
|
+
/* @__PURE__ */ e("div", { className: "space-y-2 max-h-48 overflow-y-auto", style: { scrollbarWidth: "none" }, children: g.map((t, o) => /* @__PURE__ */ i(
|
|
1541
|
+
"button",
|
|
1542
|
+
{
|
|
1543
|
+
onClick: () => {
|
|
1544
|
+
tt(o), p?.("selection");
|
|
1545
|
+
},
|
|
1546
|
+
className: y(
|
|
1547
|
+
"w-full flex items-center gap-3 p-3 rounded-xl border transition-all text-left",
|
|
1548
|
+
ne === o ? "bg-orange-500/10 border-orange-500/20" : "bg-white/[0.02] border-white/[0.06] hover:bg-white/[0.05]"
|
|
1549
|
+
),
|
|
1550
|
+
children: [
|
|
1551
|
+
/* @__PURE__ */ e("div", { className: "w-10 h-10 rounded-lg overflow-hidden flex-shrink-0", children: /* @__PURE__ */ e("img", { src: t.albumArt, alt: "", className: "w-full h-full object-cover" }) }),
|
|
1552
|
+
/* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
|
|
1553
|
+
/* @__PURE__ */ e("p", { className: y("text-sm font-medium truncate", ne === o ? "text-orange-300" : "text-white/70"), children: t.title }),
|
|
1554
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-white/30", children: t.artist })
|
|
1555
|
+
] }),
|
|
1556
|
+
ne === o && /* @__PURE__ */ e("div", { className: "w-5 h-5 rounded-full bg-orange-500/30 border border-orange-500/50 flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ e(ee, { className: "w-3 h-3 text-orange-300" }) })
|
|
1557
|
+
]
|
|
1558
|
+
},
|
|
1559
|
+
t.id
|
|
1560
|
+
)) })
|
|
1561
|
+
] }),
|
|
1562
|
+
/* @__PURE__ */ i("div", { children: [
|
|
1563
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-white/40 font-medium uppercase tracking-wider mb-3", children: l === "zh" ? "改编风格" : "Target Style" }),
|
|
1564
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-5 gap-2", children: Me.map((t) => {
|
|
1565
|
+
const o = t.icon, n = se === t.id, C = t.premium && !f.has(t.id);
|
|
1566
|
+
return /* @__PURE__ */ i(
|
|
1567
|
+
"button",
|
|
1568
|
+
{
|
|
1569
|
+
onClick: () => {
|
|
1570
|
+
if (C) {
|
|
1571
|
+
T && j >= (t.spCost || 200) && q(t.id, t.spCost || 200);
|
|
1572
|
+
return;
|
|
1573
|
+
}
|
|
1574
|
+
it(t.id), p?.("selection");
|
|
1575
|
+
},
|
|
1576
|
+
className: y(
|
|
1577
|
+
"p-2.5 rounded-xl border transition-all text-center relative",
|
|
1578
|
+
C ? "bg-white/[0.01] border-white/[0.04] opacity-60" : n ? `bg-gradient-to-br ${t.bg} border-white/15` : "bg-white/[0.02] border-white/[0.06] hover:bg-white/[0.05]"
|
|
1579
|
+
),
|
|
1580
|
+
children: [
|
|
1581
|
+
C && /* @__PURE__ */ i("span", { className: "absolute -top-1 -right-1 text-[8px] px-1 py-0.5 rounded-full bg-yellow-500/20 text-yellow-300 border border-yellow-500/20 font-medium", children: [
|
|
1582
|
+
t.spCost,
|
|
1583
|
+
"SP"
|
|
1584
|
+
] }),
|
|
1585
|
+
/* @__PURE__ */ e(o, { className: y("w-4 h-4 mx-auto mb-0.5", n ? t.color : C ? "text-white/15" : "text-white/30") }),
|
|
1586
|
+
/* @__PURE__ */ e("p", { className: y("text-[9px]", n ? "text-white/80" : "text-white/30"), children: l === "zh" ? t.labelZh : t.label })
|
|
1587
|
+
]
|
|
1588
|
+
},
|
|
1589
|
+
t.id
|
|
1590
|
+
);
|
|
1591
|
+
}) })
|
|
1592
|
+
] }),
|
|
1593
|
+
/* @__PURE__ */ e(
|
|
1594
|
+
m.button,
|
|
1595
|
+
{
|
|
1596
|
+
onClick: ot,
|
|
1597
|
+
disabled: ne === null || at,
|
|
1598
|
+
whileHover: { scale: 1.01 },
|
|
1599
|
+
whileTap: { scale: 0.98 },
|
|
1600
|
+
className: "w-full py-3.5 rounded-xl bg-gradient-to-r from-orange-600 via-red-600 to-pink-600 text-white font-semibold flex items-center justify-center gap-2 shadow-lg shadow-orange-500/20 disabled:opacity-40",
|
|
1601
|
+
children: Ce !== "idle" && Ce !== "done" ? /* @__PURE__ */ i(z, { children: [
|
|
1602
|
+
/* @__PURE__ */ e(fe, { className: "w-5 h-5 animate-spin" }),
|
|
1603
|
+
Le(Ce)
|
|
1604
|
+
] }) : Ce === "done" ? /* @__PURE__ */ i(z, { children: [
|
|
1605
|
+
/* @__PURE__ */ e(ee, { className: "w-5 h-5 text-green-300" }),
|
|
1606
|
+
l === "zh" ? "改编完成!" : "Remix Complete!"
|
|
1607
|
+
] }) : /* @__PURE__ */ i(z, { children: [
|
|
1608
|
+
/* @__PURE__ */ e(De, { className: "w-5 h-5" }),
|
|
1609
|
+
l === "zh" ? "开始改编 (含音频重合成)" : "Remix (with audio synthesis)"
|
|
1610
|
+
] })
|
|
1611
|
+
}
|
|
1612
|
+
),
|
|
1613
|
+
/* @__PURE__ */ e(F, { children: Ae && /* @__PURE__ */ i(
|
|
1614
|
+
m.div,
|
|
1615
|
+
{
|
|
1616
|
+
initial: { opacity: 0, y: 15 },
|
|
1617
|
+
animate: { opacity: 1, y: 0 },
|
|
1618
|
+
className: "rounded-xl border border-white/[0.08] bg-gradient-to-br from-orange-500/10 to-red-500/10 p-4",
|
|
1619
|
+
children: [
|
|
1620
|
+
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
|
|
1621
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-white/40", children: l === "zh" ? "改编歌词" : "Remixed Lyrics" }),
|
|
1622
|
+
/* @__PURE__ */ i(
|
|
1623
|
+
"button",
|
|
1624
|
+
{
|
|
1625
|
+
onClick: () => Se(Ae, "remix"),
|
|
1626
|
+
className: "flex items-center gap-1 px-2 py-1 rounded-lg bg-white/5 text-xs text-white/40 hover:text-white/70 transition-colors",
|
|
1627
|
+
children: [
|
|
1628
|
+
ce === "remix" ? /* @__PURE__ */ e(ee, { className: "w-3 h-3 text-green-400" }) : /* @__PURE__ */ e(ge, { className: "w-3 h-3" }),
|
|
1629
|
+
ce === "remix" ? l === "zh" ? "已复制" : "Copied" : l === "zh" ? "复制" : "Copy"
|
|
1630
|
+
]
|
|
1631
|
+
}
|
|
1632
|
+
)
|
|
1633
|
+
] }),
|
|
1634
|
+
/* @__PURE__ */ e("div", { className: "space-y-1.5", children: Ae.map((t, o) => /* @__PURE__ */ e(
|
|
1635
|
+
m.p,
|
|
1636
|
+
{
|
|
1637
|
+
initial: { opacity: 0, x: -8 },
|
|
1638
|
+
animate: { opacity: 1, x: 0 },
|
|
1639
|
+
transition: { delay: o * 0.06 },
|
|
1640
|
+
className: "text-sm text-white/70 leading-relaxed",
|
|
1641
|
+
children: t
|
|
1642
|
+
},
|
|
1643
|
+
o
|
|
1644
|
+
)) })
|
|
1645
|
+
]
|
|
1646
|
+
}
|
|
1647
|
+
) })
|
|
1648
|
+
]
|
|
1649
|
+
},
|
|
1650
|
+
"remix"
|
|
1651
|
+
),
|
|
1652
|
+
N === "works" && /* @__PURE__ */ e(
|
|
1653
|
+
m.div,
|
|
1654
|
+
{
|
|
1655
|
+
initial: { opacity: 0, x: 20 },
|
|
1656
|
+
animate: { opacity: 1, x: 0 },
|
|
1657
|
+
exit: { opacity: 0, x: -20 },
|
|
1658
|
+
className: "p-5",
|
|
1659
|
+
children: he.length === 0 ? /* @__PURE__ */ i("div", { className: "flex flex-col items-center justify-center py-16 gap-4", children: [
|
|
1660
|
+
/* @__PURE__ */ e("div", { className: "w-16 h-16 rounded-full bg-white/5 border border-white/10 flex items-center justify-center", children: /* @__PURE__ */ e($e, { className: "w-7 h-7 text-white/20" }) }),
|
|
1661
|
+
/* @__PURE__ */ e("p", { className: "text-white/30 text-sm text-center", children: l === "zh" ? `还没有创作作品
|
|
1662
|
+
去创作你的第一首歌吧!` : `No works yet
|
|
1663
|
+
Create your first song!` }),
|
|
1664
|
+
/* @__PURE__ */ e(
|
|
1665
|
+
"button",
|
|
1666
|
+
{
|
|
1667
|
+
onClick: () => S("quick"),
|
|
1668
|
+
className: "px-4 py-2 rounded-lg bg-purple-500/10 border border-purple-500/20 text-purple-300 text-sm hover:bg-purple-500/20 transition-colors",
|
|
1669
|
+
children: l === "zh" ? "开始创作" : "Start Creating"
|
|
1670
|
+
}
|
|
1671
|
+
)
|
|
1672
|
+
] }) : /* @__PURE__ */ i("div", { className: "space-y-3", children: [
|
|
1673
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-white/40 font-medium uppercase tracking-wider mb-3", children: l === "zh" ? `${he.length} 首作品` : `${he.length} Works` }),
|
|
1674
|
+
he.map((t, o) => {
|
|
1675
|
+
const n = Me.find((be) => be.id === t.theme), C = n?.icon || $e, me = ze.find((be) => be.id === t.mode);
|
|
1676
|
+
return /* @__PURE__ */ e(
|
|
1677
|
+
m.div,
|
|
1678
|
+
{
|
|
1679
|
+
initial: { opacity: 0, y: 10 },
|
|
1680
|
+
animate: { opacity: 1, y: 0 },
|
|
1681
|
+
transition: { delay: o * 0.05 },
|
|
1682
|
+
className: "rounded-xl border border-white/[0.06] bg-white/[0.02] p-4 group",
|
|
1683
|
+
children: /* @__PURE__ */ i("div", { className: "flex items-start gap-3", children: [
|
|
1684
|
+
/* @__PURE__ */ e("div", { className: y(
|
|
1685
|
+
"w-10 h-10 rounded-xl flex items-center justify-center flex-shrink-0 bg-gradient-to-br",
|
|
1686
|
+
n?.bg || "from-white/5 to-white/5"
|
|
1687
|
+
), children: /* @__PURE__ */ e(C, { className: y("w-5 h-5", n?.color || "text-white/30") }) }),
|
|
1688
|
+
/* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
|
|
1689
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-2 mb-1", children: [
|
|
1690
|
+
/* @__PURE__ */ e("p", { className: "text-sm font-medium text-white/80 truncate", children: t.title }),
|
|
1691
|
+
/* @__PURE__ */ e("span", { className: "text-[9px] text-white/20 bg-white/5 px-1.5 py-0.5 rounded-full flex-shrink-0", children: me ? l === "zh" ? me.labelZh : me.label : t.mode })
|
|
1692
|
+
] }),
|
|
1693
|
+
/* @__PURE__ */ i("p", { className: "text-xs text-white/25 flex items-center gap-1", children: [
|
|
1694
|
+
/* @__PURE__ */ e(Oe, { className: "w-3 h-3" }),
|
|
1695
|
+
ct(t.createdAt)
|
|
1696
|
+
] }),
|
|
1697
|
+
/* @__PURE__ */ i("p", { className: "text-xs text-white/30 mt-2 line-clamp-2 italic", children: [
|
|
1698
|
+
'"',
|
|
1699
|
+
t.lyrics.slice(0, 2).join(" / "),
|
|
1700
|
+
'"'
|
|
1701
|
+
] })
|
|
1702
|
+
] }),
|
|
1703
|
+
/* @__PURE__ */ i("div", { className: "flex flex-col gap-1 md:opacity-0 md:group-hover:opacity-100 transition-opacity flex-shrink-0", children: [
|
|
1704
|
+
/* @__PURE__ */ e(
|
|
1705
|
+
"button",
|
|
1706
|
+
{
|
|
1707
|
+
onClick: () => Se(t.lyrics, t.id),
|
|
1708
|
+
className: "p-1.5 rounded-lg text-white/30 hover:text-white/60 hover:bg-white/5 transition-colors",
|
|
1709
|
+
title: l === "zh" ? "复制歌词" : "Copy lyrics",
|
|
1710
|
+
children: ce === t.id ? /* @__PURE__ */ e(ee, { className: "w-3.5 h-3.5 text-green-400" }) : /* @__PURE__ */ e(ge, { className: "w-3.5 h-3.5" })
|
|
1711
|
+
}
|
|
1712
|
+
),
|
|
1713
|
+
/* @__PURE__ */ e(
|
|
1714
|
+
"button",
|
|
1715
|
+
{
|
|
1716
|
+
onClick: () => lt(t.id),
|
|
1717
|
+
className: "p-1.5 rounded-lg text-white/30 hover:text-red-400/60 hover:bg-red-500/5 transition-colors",
|
|
1718
|
+
title: l === "zh" ? "删除" : "Delete",
|
|
1719
|
+
children: /* @__PURE__ */ e(gt, { className: "w-3.5 h-3.5" })
|
|
1720
|
+
}
|
|
1721
|
+
),
|
|
1722
|
+
B && /* @__PURE__ */ e(
|
|
1723
|
+
"button",
|
|
1724
|
+
{
|
|
1725
|
+
onClick: () => B(t),
|
|
1726
|
+
className: "p-1.5 rounded-lg text-white/30 hover:text-white/60 hover:bg-white/5 transition-colors",
|
|
1727
|
+
title: l === "zh" ? "分享作品" : "Share work",
|
|
1728
|
+
children: /* @__PURE__ */ e(ft, { className: "w-3.5 h-3.5" })
|
|
1729
|
+
}
|
|
1730
|
+
),
|
|
1731
|
+
J && /* @__PURE__ */ e(
|
|
1732
|
+
"button",
|
|
1733
|
+
{
|
|
1734
|
+
onClick: () => J(t.lyrics),
|
|
1735
|
+
className: "p-1.5 rounded-lg text-white/30 hover:text-cyan-400/60 hover:bg-cyan-500/5 transition-colors",
|
|
1736
|
+
title: l === "zh" ? "从此作品创建MV" : "Create MV from this work",
|
|
1737
|
+
children: /* @__PURE__ */ e(He, { className: "w-3.5 h-3.5" })
|
|
1738
|
+
}
|
|
1739
|
+
)
|
|
1740
|
+
] })
|
|
1741
|
+
] })
|
|
1742
|
+
},
|
|
1743
|
+
t.id
|
|
1744
|
+
);
|
|
1745
|
+
})
|
|
1746
|
+
] })
|
|
1747
|
+
},
|
|
1748
|
+
"works"
|
|
1749
|
+
)
|
|
1750
|
+
] }) })
|
|
1751
|
+
]
|
|
1752
|
+
}
|
|
1753
|
+
)
|
|
1754
|
+
] }) });
|
|
1755
|
+
}, Ee = [
|
|
1756
|
+
{ id: "starfield", labelZh: "星空漫游", labelEn: "Starfield", emoji: "🌌", colors: ["#667eea", "#764ba2", "#fff"] },
|
|
1757
|
+
{ id: "neonPulse", labelZh: "霓虹脉冲", labelEn: "Neon Pulse", emoji: "💜", colors: ["#ff006e", "#8338ec", "#3a86ff"] },
|
|
1758
|
+
{ id: "aurora", labelZh: "极光幻境", labelEn: "Aurora", emoji: "🌈", colors: ["#00f5d4", "#7209b7", "#f72585"] },
|
|
1759
|
+
{ id: "inkWash", labelZh: "水墨流韵", labelEn: "Ink Wash", emoji: "🏔️", colors: ["#1a1a2e", "#e0e0e0", "#555"] },
|
|
1760
|
+
{ id: "cyberCity", labelZh: "赛博都市", labelEn: "Cyber City", emoji: "🌃", colors: ["#0ff", "#f0f", "#ff0"] }
|
|
1761
|
+
];
|
|
1762
|
+
function $t(M, $, b) {
|
|
1763
|
+
const g = Ee.find((p) => p.id === b)?.colors || ["#fff", "#aaa", "#666"], K = g[Math.floor(Math.random() * g.length)];
|
|
1764
|
+
switch (b) {
|
|
1765
|
+
case "starfield":
|
|
1766
|
+
return {
|
|
1767
|
+
x: Math.random() * M,
|
|
1768
|
+
y: Math.random() * $,
|
|
1769
|
+
z: Math.random() * 3 + 0.5,
|
|
1770
|
+
vx: 0,
|
|
1771
|
+
vy: Math.random() * 0.3 + 0.1,
|
|
1772
|
+
size: Math.random() * 2.5 + 0.5,
|
|
1773
|
+
alpha: Math.random() * 0.8 + 0.2,
|
|
1774
|
+
color: K,
|
|
1775
|
+
life: 0,
|
|
1776
|
+
maxLife: 300 + Math.random() * 200
|
|
1777
|
+
};
|
|
1778
|
+
case "neonPulse":
|
|
1779
|
+
return {
|
|
1780
|
+
x: M / 2 + (Math.random() - 0.5) * M * 0.8,
|
|
1781
|
+
y: $ / 2 + (Math.random() - 0.5) * $ * 0.8,
|
|
1782
|
+
z: 1,
|
|
1783
|
+
vx: (Math.random() - 0.5) * 2,
|
|
1784
|
+
vy: (Math.random() - 0.5) * 2,
|
|
1785
|
+
size: Math.random() * 4 + 1,
|
|
1786
|
+
alpha: Math.random() * 0.6 + 0.2,
|
|
1787
|
+
color: K,
|
|
1788
|
+
life: 0,
|
|
1789
|
+
maxLife: 150 + Math.random() * 100
|
|
1790
|
+
};
|
|
1791
|
+
case "aurora":
|
|
1792
|
+
return {
|
|
1793
|
+
x: Math.random() * M,
|
|
1794
|
+
y: $ * 0.2 + Math.random() * $ * 0.3,
|
|
1795
|
+
z: 1,
|
|
1796
|
+
vx: Math.random() * 0.5 + 0.2,
|
|
1797
|
+
vy: (Math.random() - 0.5) * 0.3,
|
|
1798
|
+
size: Math.random() * 40 + 20,
|
|
1799
|
+
alpha: Math.random() * 0.15 + 0.05,
|
|
1800
|
+
color: K,
|
|
1801
|
+
life: 0,
|
|
1802
|
+
maxLife: 400 + Math.random() * 200
|
|
1803
|
+
};
|
|
1804
|
+
case "inkWash":
|
|
1805
|
+
return {
|
|
1806
|
+
x: Math.random() * M,
|
|
1807
|
+
y: Math.random() * $,
|
|
1808
|
+
z: 1,
|
|
1809
|
+
vx: (Math.random() - 0.5) * 0.5,
|
|
1810
|
+
vy: -Math.random() * 0.8 - 0.2,
|
|
1811
|
+
size: Math.random() * 30 + 5,
|
|
1812
|
+
alpha: Math.random() * 0.08 + 0.02,
|
|
1813
|
+
color: K,
|
|
1814
|
+
life: 0,
|
|
1815
|
+
maxLife: 300 + Math.random() * 200
|
|
1816
|
+
};
|
|
1817
|
+
default:
|
|
1818
|
+
return {
|
|
1819
|
+
x: Math.random() * M,
|
|
1820
|
+
y: Math.random() * $,
|
|
1821
|
+
z: 1,
|
|
1822
|
+
vx: 0,
|
|
1823
|
+
vy: Math.random() * 2 + 1,
|
|
1824
|
+
size: Math.random() * 2 + 0.5,
|
|
1825
|
+
alpha: Math.random() * 0.7 + 0.3,
|
|
1826
|
+
color: K,
|
|
1827
|
+
life: 0,
|
|
1828
|
+
maxLife: 200 + Math.random() * 100
|
|
1829
|
+
};
|
|
1830
|
+
}
|
|
1831
|
+
}
|
|
1832
|
+
const Et = ({
|
|
1833
|
+
isOpen: M,
|
|
1834
|
+
onClose: $,
|
|
1835
|
+
track: b,
|
|
1836
|
+
isPlaying: g,
|
|
1837
|
+
audioEnergy: K,
|
|
1838
|
+
frequencyData: p,
|
|
1839
|
+
currentTime: B,
|
|
1840
|
+
emotion: J,
|
|
1841
|
+
customLyrics: T,
|
|
1842
|
+
onHaptic: j
|
|
1843
|
+
}) => {
|
|
1844
|
+
const { lang: O } = je(), W = we(null), l = we(0), N = we([]), S = we(0), [f, U] = u("starfield"), [q, L] = u(!0), [_, E] = u(0.7), Z = T && T.length > 0 ? T.map((h, a) => ({
|
|
1845
|
+
time: a * (b.duration > 0 ? b.duration / T.length : 10),
|
|
1846
|
+
text: h,
|
|
1847
|
+
translation: void 0
|
|
1848
|
+
})) : b.lyrics, I = [...Z].reverse().find((h) => h.time <= B);
|
|
1849
|
+
Z.find((h) => h.time > B);
|
|
1850
|
+
const s = P(() => {
|
|
1851
|
+
const h = W.current;
|
|
1852
|
+
if (!h) return;
|
|
1853
|
+
const a = h.getContext("2d");
|
|
1854
|
+
if (!a) return;
|
|
1855
|
+
const d = h.width, x = h.height;
|
|
1856
|
+
S.current += 1;
|
|
1857
|
+
const de = S.current, w = K * _, c = Ee.find((r) => r.id === f)?.colors || ["#fff", "#aaa", "#666"];
|
|
1858
|
+
switch (f) {
|
|
1859
|
+
case "starfield": {
|
|
1860
|
+
a.fillStyle = "#050816", a.fillRect(0, 0, d, x);
|
|
1861
|
+
const r = a.createRadialGradient(d / 2, x / 2, 0, d / 2, x / 2, d * 0.5);
|
|
1862
|
+
r.addColorStop(0, `rgba(102, 126, 234, ${0.03 + w * 0.05})`), r.addColorStop(1, "transparent"), a.fillStyle = r, a.fillRect(0, 0, d, x);
|
|
1863
|
+
break;
|
|
1864
|
+
}
|
|
1865
|
+
case "neonPulse": {
|
|
1866
|
+
a.fillStyle = `rgba(10, 5, 30, ${0.15 + (1 - w) * 0.1})`, a.fillRect(0, 0, d, x);
|
|
1867
|
+
const r = a.createRadialGradient(d / 2, x / 2, 0, d / 2, x / 2, 150 + w * 200);
|
|
1868
|
+
r.addColorStop(0, `rgba(131, 56, 236, ${0.1 + w * 0.15})`), r.addColorStop(0.5, `rgba(255, 0, 110, ${0.05 + w * 0.08})`), r.addColorStop(1, "transparent"), a.fillStyle = r, a.fillRect(0, 0, d, x);
|
|
1869
|
+
break;
|
|
1870
|
+
}
|
|
1871
|
+
case "aurora": {
|
|
1872
|
+
a.fillStyle = "rgba(5, 5, 20, 0.08)", a.fillRect(0, 0, d, x);
|
|
1873
|
+
break;
|
|
1874
|
+
}
|
|
1875
|
+
case "inkWash": {
|
|
1876
|
+
a.fillStyle = `rgba(15, 15, 25, ${0.05 + (1 - w) * 0.03})`, a.fillRect(0, 0, d, x), a.beginPath(), a.moveTo(0, x);
|
|
1877
|
+
for (let r = 0; r <= d; r += 3) {
|
|
1878
|
+
const A = x - 80 - Math.sin(r * 8e-3 + 1) * 60 - Math.sin(r * 0.015) * 30 - Math.cos(r * 3e-3 + 2) * 40;
|
|
1879
|
+
a.lineTo(r, A);
|
|
1880
|
+
}
|
|
1881
|
+
a.lineTo(d, x), a.fillStyle = "rgba(30, 30, 50, 0.06)", a.fill();
|
|
1882
|
+
break;
|
|
1883
|
+
}
|
|
1884
|
+
case "cyberCity": {
|
|
1885
|
+
a.fillStyle = "rgba(5, 0, 15, 0.12)", a.fillRect(0, 0, d, x), a.strokeStyle = `rgba(0, 255, 255, ${0.04 + w * 0.06})`, a.lineWidth = 0.5;
|
|
1886
|
+
const r = x * 0.7;
|
|
1887
|
+
for (let A = 0; A < 20; A++) {
|
|
1888
|
+
const D = r + A * 12;
|
|
1889
|
+
a.beginPath(), a.moveTo(0, D), a.lineTo(d, D), a.stroke();
|
|
1890
|
+
}
|
|
1891
|
+
for (let A = 0; A < 15; A++) {
|
|
1892
|
+
const D = d / 2 + (A - 7) * (40 + A * 5);
|
|
1893
|
+
a.beginPath(), a.moveTo(d / 2, r), a.lineTo(D, x), a.stroke();
|
|
1894
|
+
}
|
|
1895
|
+
break;
|
|
1896
|
+
}
|
|
1897
|
+
}
|
|
1898
|
+
const R = Math.floor(50 + w * 80 * _);
|
|
1899
|
+
for (; N.current.length < R; )
|
|
1900
|
+
N.current.push($t(d, x, f));
|
|
1901
|
+
const Y = [];
|
|
1902
|
+
for (const r of N.current) {
|
|
1903
|
+
if (r.life += 1, r.life > r.maxLife) continue;
|
|
1904
|
+
r.x += r.vx + (f === "starfield" ? Math.sin(de * 0.01 + r.y * 0.01) * 0.2 : 0), r.y += r.vy * (1 + w * 0.5), r.x < -10 && (r.x = d + 10), r.x > d + 10 && (r.x = -10), r.y < -10 && (r.y = x + 10), r.y > x + 10 && (r.y = -10);
|
|
1905
|
+
const A = Math.min(r.life / 20, 1), D = Math.max(1 - (r.life - r.maxLife + 30) / 30, 0), V = r.alpha * A * D * (0.5 + w * 0.5);
|
|
1906
|
+
if (a.beginPath(), f === "aurora")
|
|
1907
|
+
a.ellipse(r.x, r.y, r.size * (1 + w), r.size * 0.3, 0, 0, Math.PI * 2), a.fillStyle = `${r.color}${Math.floor(V * 255).toString(16).padStart(2, "0")}`, a.fill();
|
|
1908
|
+
else if (f === "inkWash") {
|
|
1909
|
+
const k = a.createRadialGradient(r.x, r.y, 0, r.x, r.y, r.size);
|
|
1910
|
+
k.addColorStop(0, `rgba(200, 200, 210, ${V})`), k.addColorStop(1, "transparent"), a.fillStyle = k, a.arc(r.x, r.y, r.size, 0, Math.PI * 2), a.fill();
|
|
1911
|
+
} else if (f === "cyberCity")
|
|
1912
|
+
a.strokeStyle = `${r.color}${Math.floor(V * 200).toString(16).padStart(2, "0")}`, a.lineWidth = r.size * 0.5, a.moveTo(r.x, r.y), a.lineTo(r.x, r.y - 8 - w * 12), a.stroke();
|
|
1913
|
+
else if (a.arc(r.x, r.y, r.size * (f === "neonPulse" ? 1 + w * 0.5 : 1), 0, Math.PI * 2), a.fillStyle = `${r.color}${Math.floor(V * 255).toString(16).padStart(2, "0")}`, a.fill(), f === "neonPulse" && r.size > 2) {
|
|
1914
|
+
const k = a.createRadialGradient(r.x, r.y, 0, r.x, r.y, r.size * 4);
|
|
1915
|
+
k.addColorStop(0, `${r.color}${Math.floor(V * 80).toString(16).padStart(2, "0")}`), k.addColorStop(1, "transparent"), a.fillStyle = k, a.beginPath(), a.arc(r.x, r.y, r.size * 4, 0, Math.PI * 2), a.fill();
|
|
1916
|
+
}
|
|
1917
|
+
Y.push(r);
|
|
1918
|
+
}
|
|
1919
|
+
if (N.current = Y, p.length > 0 && g) {
|
|
1920
|
+
const r = Math.min(64, p.length), A = d / r, D = x * 0.25;
|
|
1921
|
+
a.save(), f === "inkWash" && (a.globalAlpha = 0.15);
|
|
1922
|
+
for (let V = 0; V < r; V++) {
|
|
1923
|
+
const k = p[Math.floor(V * p.length / r)] / 255, H = k * D * _, X = V * A, G = a.createLinearGradient(X, x, X, x - H);
|
|
1924
|
+
f === "neonPulse" ? (G.addColorStop(0, `rgba(255, 0, 110, ${0.3 + k * 0.4})`), G.addColorStop(1, `rgba(131, 56, 236, ${0.1 + k * 0.2})`)) : f === "aurora" ? (G.addColorStop(0, `rgba(0, 245, 212, ${0.2 + k * 0.3})`), G.addColorStop(1, `rgba(114, 9, 183, ${0.1 + k * 0.15})`)) : f === "cyberCity" ? (G.addColorStop(0, `rgba(0, 255, 255, ${0.3 + k * 0.5})`), G.addColorStop(1, `rgba(255, 0, 255, ${0.1 + k * 0.2})`)) : f === "inkWash" ? (G.addColorStop(0, `rgba(180, 180, 190, ${0.3 + k * 0.4})`), G.addColorStop(1, "transparent")) : (G.addColorStop(0, `rgba(102, 126, 234, ${0.2 + k * 0.4})`), G.addColorStop(1, `rgba(118, 75, 162, ${0.05 + k * 0.1})`)), a.fillStyle = G, a.fillRect(X, x - H, A - 1, H);
|
|
1925
|
+
}
|
|
1926
|
+
a.restore();
|
|
1927
|
+
}
|
|
1928
|
+
if (f !== "inkWash") {
|
|
1929
|
+
const r = 60 + w * 40;
|
|
1930
|
+
a.beginPath(), a.arc(d / 2, x / 2, r, 0, Math.PI * 2), a.strokeStyle = `${c[0]}${Math.floor((0.1 + w * 0.2) * 255).toString(16).padStart(2, "0")}`, a.lineWidth = 1.5 + w * 2, a.stroke(), a.beginPath(), a.arc(d / 2, x / 2, r * 1.3 + Math.sin(de * 0.03) * 10, 0, Math.PI * 2), a.strokeStyle = `${c[1]}${Math.floor((0.05 + w * 0.1) * 255).toString(16).padStart(2, "0")}`, a.lineWidth = 0.8, a.stroke();
|
|
1931
|
+
}
|
|
1932
|
+
if (q && I) {
|
|
1933
|
+
a.save(), a.textAlign = "center", a.font = `700 ${f === "inkWash" ? "20" : "22"}px system-ui, -apple-system, sans-serif`;
|
|
1934
|
+
const r = x * 0.78;
|
|
1935
|
+
f !== "inkWash" && (a.shadowColor = c[0], a.shadowBlur = 15 + w * 20), a.fillStyle = `rgba(255, 255, 255, ${0.8 + w * 0.2})`;
|
|
1936
|
+
const A = d * 0.85, D = I.text;
|
|
1937
|
+
if (a.measureText(D).width > A) {
|
|
1938
|
+
const V = D.split(" ");
|
|
1939
|
+
let k = "", H = r;
|
|
1940
|
+
for (const X of V) {
|
|
1941
|
+
const G = k ? `${k} ${X}` : X;
|
|
1942
|
+
a.measureText(G).width > A ? (a.fillText(k, d / 2, H), k = X, H += 30) : k = G;
|
|
1943
|
+
}
|
|
1944
|
+
a.fillText(k, d / 2, H);
|
|
1945
|
+
} else
|
|
1946
|
+
a.fillText(D, d / 2, r);
|
|
1947
|
+
a.shadowBlur = 0, I.translation && (a.font = "400 13px system-ui, -apple-system, sans-serif", a.fillStyle = "rgba(255, 255, 255, 0.4)", a.fillText(I.translation, d / 2, r + 28)), a.restore();
|
|
1948
|
+
}
|
|
1949
|
+
a.save(), a.textAlign = "left", a.fillStyle = "rgba(255, 255, 255, 0.3)", a.font = "500 11px system-ui, -apple-system, sans-serif", a.fillText(b.title, 20, 28), a.fillStyle = "rgba(255, 255, 255, 0.15)", a.font = "400 10px system-ui, -apple-system, sans-serif", a.fillText(b.artist, 20, 44), a.textAlign = "right";
|
|
1950
|
+
const re = Math.floor(B / 60), Ne = Math.floor(B % 60);
|
|
1951
|
+
a.fillStyle = "rgba(255, 255, 255, 0.2)", a.font = "400 10px monospace", a.fillText(`${re}:${Ne.toString().padStart(2, "0")}`, d - 20, 28), a.restore();
|
|
1952
|
+
const ve = b.duration > 0 ? B / b.duration : 0;
|
|
1953
|
+
a.fillStyle = "rgba(255, 255, 255, 0.06)", a.fillRect(0, x - 3, d, 3);
|
|
1954
|
+
const ue = a.createLinearGradient(0, 0, d * ve, 0);
|
|
1955
|
+
ue.addColorStop(0, c[0]), ue.addColorStop(1, c[1]), a.fillStyle = ue, a.fillRect(0, x - 3, d * ve, 3), l.current = requestAnimationFrame(s);
|
|
1956
|
+
}, [f, K, p, g, B, q, _, b, I, J, Z]);
|
|
1957
|
+
ye(() => {
|
|
1958
|
+
if (M) {
|
|
1959
|
+
N.current = [], S.current = 0;
|
|
1960
|
+
const h = W.current;
|
|
1961
|
+
if (h) {
|
|
1962
|
+
const a = h.getBoundingClientRect();
|
|
1963
|
+
h.width = a.width * (window.devicePixelRatio > 1 ? 2 : 1), h.height = a.height * (window.devicePixelRatio > 1 ? 2 : 1);
|
|
1964
|
+
}
|
|
1965
|
+
l.current = requestAnimationFrame(s);
|
|
1966
|
+
}
|
|
1967
|
+
return () => {
|
|
1968
|
+
l.current && cancelAnimationFrame(l.current);
|
|
1969
|
+
};
|
|
1970
|
+
}, [M, s]);
|
|
1971
|
+
const v = P(() => {
|
|
1972
|
+
if (!W.current) return;
|
|
1973
|
+
const h = document.createElement("a");
|
|
1974
|
+
h.download = `d-music-mv-${b.title.replace(/\s+/g, "-").toLowerCase()}.png`, h.href = W.current.toDataURL("image/png"), h.click(), j?.("success");
|
|
1975
|
+
}, [b.title, j]), te = P(() => {
|
|
1976
|
+
const h = W.current;
|
|
1977
|
+
h && (document.fullscreenElement ? document.exitFullscreen() : h.requestFullscreen?.().catch(() => {
|
|
1978
|
+
}), j?.("medium"));
|
|
1979
|
+
}, [j]);
|
|
1980
|
+
return /* @__PURE__ */ e(F, { children: M && /* @__PURE__ */ i(z, { children: [
|
|
1981
|
+
/* @__PURE__ */ e(
|
|
1982
|
+
m.div,
|
|
1983
|
+
{
|
|
1984
|
+
initial: { opacity: 0 },
|
|
1985
|
+
animate: { opacity: 1 },
|
|
1986
|
+
exit: { opacity: 0 },
|
|
1987
|
+
className: "fixed inset-0 z-[62] bg-black/80 backdrop-blur-xl",
|
|
1988
|
+
onClick: $
|
|
1989
|
+
}
|
|
1990
|
+
),
|
|
1991
|
+
/* @__PURE__ */ i(
|
|
1992
|
+
m.div,
|
|
1993
|
+
{
|
|
1994
|
+
initial: { opacity: 0, scale: 0.92 },
|
|
1995
|
+
animate: { opacity: 1, scale: 1 },
|
|
1996
|
+
exit: { opacity: 0, scale: 0.92 },
|
|
1997
|
+
transition: { type: "spring", damping: 25, stiffness: 280 },
|
|
1998
|
+
className: "fixed z-[63] inset-4 md:inset-auto md:left-1/2 md:top-1/2 md:-translate-x-1/2 md:-translate-y-1/2 md:w-[90vw] md:max-w-3xl md:max-h-[88vh] bg-[#080C28]/98 backdrop-blur-2xl border border-white/10 rounded-2xl flex flex-col shadow-2xl overflow-hidden",
|
|
1999
|
+
children: [
|
|
2000
|
+
/* @__PURE__ */ i("div", { className: "flex items-center justify-between px-5 py-3 border-b border-white/[0.06] flex-shrink-0", children: [
|
|
2001
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-3", children: [
|
|
2002
|
+
/* @__PURE__ */ e("div", { className: "w-8 h-8 rounded-lg bg-gradient-to-tr from-cyan-500/20 to-purple-500/20 border border-white/10 flex items-center justify-center", children: /* @__PURE__ */ e(De, { className: "w-4 h-4 text-cyan-400" }) }),
|
|
2003
|
+
/* @__PURE__ */ i("div", { children: [
|
|
2004
|
+
/* @__PURE__ */ i("h3", { className: "text-white font-semibold text-sm leading-tight flex items-center gap-1.5", children: [
|
|
2005
|
+
O === "zh" ? "MV 创作" : "MV Creator",
|
|
2006
|
+
T && T.length > 0 && /* @__PURE__ */ e("span", { className: "text-[9px] font-normal px-1.5 py-0.5 rounded-full bg-cyan-500/15 border border-cyan-500/25 text-cyan-300", children: O === "zh" ? "作品歌词" : "Work Lyrics" })
|
|
2007
|
+
] }),
|
|
2008
|
+
/* @__PURE__ */ i("p", { className: "text-white/30 text-[10px]", children: [
|
|
2009
|
+
b.title,
|
|
2010
|
+
" — ",
|
|
2011
|
+
b.artist
|
|
2012
|
+
] })
|
|
2013
|
+
] })
|
|
2014
|
+
] }),
|
|
2015
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
2016
|
+
/* @__PURE__ */ i("div", { className: y(
|
|
2017
|
+
"flex items-center gap-1.5 px-2 py-1 rounded-full text-[10px]",
|
|
2018
|
+
g ? "bg-green-500/10 text-green-400" : "bg-white/5 text-white/30"
|
|
2019
|
+
), children: [
|
|
2020
|
+
g ? /* @__PURE__ */ e(yt, { className: "w-3 h-3" }) : /* @__PURE__ */ e(Nt, { className: "w-3 h-3" }),
|
|
2021
|
+
g ? O === "zh" ? "播放中" : "Playing" : O === "zh" ? "已暂停" : "Paused"
|
|
2022
|
+
] }),
|
|
2023
|
+
/* @__PURE__ */ e(
|
|
2024
|
+
"button",
|
|
2025
|
+
{
|
|
2026
|
+
onClick: $,
|
|
2027
|
+
className: "p-2 rounded-lg text-white/40 hover:text-white/70 hover:bg-white/5 transition-colors",
|
|
2028
|
+
children: /* @__PURE__ */ e(ae, { className: "w-4 h-4" })
|
|
2029
|
+
}
|
|
2030
|
+
)
|
|
2031
|
+
] })
|
|
2032
|
+
] }),
|
|
2033
|
+
/* @__PURE__ */ i("div", { className: "flex-1 relative min-h-0 bg-black", children: [
|
|
2034
|
+
/* @__PURE__ */ e(
|
|
2035
|
+
"canvas",
|
|
2036
|
+
{
|
|
2037
|
+
ref: W,
|
|
2038
|
+
className: "w-full h-full",
|
|
2039
|
+
style: { display: "block" }
|
|
2040
|
+
}
|
|
2041
|
+
),
|
|
2042
|
+
/* @__PURE__ */ i("div", { className: "absolute bottom-3 right-3 flex gap-1.5", children: [
|
|
2043
|
+
/* @__PURE__ */ e(
|
|
2044
|
+
"button",
|
|
2045
|
+
{
|
|
2046
|
+
onClick: v,
|
|
2047
|
+
className: "p-2 rounded-lg bg-black/50 backdrop-blur-sm border border-white/10 text-white/50 hover:text-white hover:bg-black/70 transition-colors",
|
|
2048
|
+
title: O === "zh" ? "截图" : "Screenshot",
|
|
2049
|
+
children: /* @__PURE__ */ e(vt, { className: "w-4 h-4" })
|
|
2050
|
+
}
|
|
2051
|
+
),
|
|
2052
|
+
/* @__PURE__ */ e(
|
|
2053
|
+
"button",
|
|
2054
|
+
{
|
|
2055
|
+
onClick: te,
|
|
2056
|
+
className: "p-2 rounded-lg bg-black/50 backdrop-blur-sm border border-white/10 text-white/50 hover:text-white hover:bg-black/70 transition-colors",
|
|
2057
|
+
title: O === "zh" ? "全屏" : "Fullscreen",
|
|
2058
|
+
children: /* @__PURE__ */ e(kt, { className: "w-4 h-4" })
|
|
2059
|
+
}
|
|
2060
|
+
)
|
|
2061
|
+
] })
|
|
2062
|
+
] }),
|
|
2063
|
+
/* @__PURE__ */ e("div", { className: "px-5 py-3 border-t border-white/[0.06] flex-shrink-0", children: /* @__PURE__ */ i("div", { className: "flex items-center gap-4 flex-wrap", children: [
|
|
2064
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-1.5", children: Ee.map((h) => /* @__PURE__ */ i(
|
|
2065
|
+
"button",
|
|
2066
|
+
{
|
|
2067
|
+
onClick: () => {
|
|
2068
|
+
U(h.id), N.current = [], j?.("selection");
|
|
2069
|
+
},
|
|
2070
|
+
className: y(
|
|
2071
|
+
"px-2.5 py-1.5 rounded-lg border text-[10px] transition-all flex items-center gap-1",
|
|
2072
|
+
f === h.id ? "bg-white/10 border-white/20 text-white" : "bg-white/[0.02] border-white/[0.06] text-white/30 hover:bg-white/[0.05] hover:text-white/50"
|
|
2073
|
+
),
|
|
2074
|
+
children: [
|
|
2075
|
+
/* @__PURE__ */ e("span", { children: h.emoji }),
|
|
2076
|
+
/* @__PURE__ */ e("span", { className: "hidden sm:inline", children: O === "zh" ? h.labelZh : h.labelEn })
|
|
2077
|
+
]
|
|
2078
|
+
},
|
|
2079
|
+
h.id
|
|
2080
|
+
)) }),
|
|
2081
|
+
/* @__PURE__ */ e("div", { className: "flex-1" }),
|
|
2082
|
+
/* @__PURE__ */ e(
|
|
2083
|
+
"button",
|
|
2084
|
+
{
|
|
2085
|
+
onClick: () => L((h) => !h),
|
|
2086
|
+
className: y(
|
|
2087
|
+
"px-2.5 py-1.5 rounded-lg border text-[10px] transition-all",
|
|
2088
|
+
q ? "bg-purple-500/15 border-purple-500/30 text-purple-300" : "bg-white/[0.02] border-white/[0.06] text-white/30"
|
|
2089
|
+
),
|
|
2090
|
+
children: O === "zh" ? "歌词" : "Lyrics"
|
|
2091
|
+
}
|
|
2092
|
+
),
|
|
2093
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-1.5", children: [
|
|
2094
|
+
/* @__PURE__ */ e(
|
|
2095
|
+
"button",
|
|
2096
|
+
{
|
|
2097
|
+
onClick: () => E((h) => Math.max(0.2, h - 0.2)),
|
|
2098
|
+
className: "p-1 rounded text-white/30 hover:text-white/60 transition-colors",
|
|
2099
|
+
children: /* @__PURE__ */ e(Te, { className: "w-3 h-3" })
|
|
2100
|
+
}
|
|
2101
|
+
),
|
|
2102
|
+
/* @__PURE__ */ e("div", { className: "w-16 h-1.5 rounded-full bg-white/10 overflow-hidden", children: /* @__PURE__ */ e(
|
|
2103
|
+
"div",
|
|
2104
|
+
{
|
|
2105
|
+
className: "h-full rounded-full bg-gradient-to-r from-cyan-500 to-purple-500 transition-all",
|
|
2106
|
+
style: { width: `${_ * 100}%` }
|
|
2107
|
+
}
|
|
2108
|
+
) }),
|
|
2109
|
+
/* @__PURE__ */ e(
|
|
2110
|
+
"button",
|
|
2111
|
+
{
|
|
2112
|
+
onClick: () => E((h) => Math.min(1, h + 0.2)),
|
|
2113
|
+
className: "p-1 rounded text-white/30 hover:text-white/60 transition-colors",
|
|
2114
|
+
children: /* @__PURE__ */ e(xe, { className: "w-3 h-3" })
|
|
2115
|
+
}
|
|
2116
|
+
)
|
|
2117
|
+
] })
|
|
2118
|
+
] }) })
|
|
2119
|
+
]
|
|
2120
|
+
}
|
|
2121
|
+
)
|
|
2122
|
+
] }) });
|
|
2123
|
+
};
|
|
2124
|
+
export {
|
|
2125
|
+
Pt as AIAssistant,
|
|
2126
|
+
Ot as AILyricsGenerator,
|
|
2127
|
+
Wt as CreationStudio,
|
|
2128
|
+
Et as MVCreator
|
|
2129
|
+
};
|
|
2130
|
+
//# sourceMappingURL=index.js.map
|