Update index.html
Browse files- index.html +10 -18
index.html
CHANGED
|
@@ -15,8 +15,9 @@
|
|
| 15 |
--input-border: #E1E7EF;
|
| 16 |
--text-primary: #1A202C;
|
| 17 |
--text-secondary: #626F86;
|
| 18 |
-
|
| 19 |
-
--accent-
|
|
|
|
| 20 |
--success-color: #38A169;
|
| 21 |
--radius-card: 20px;
|
| 22 |
--radius-btn: 14px;
|
|
@@ -57,7 +58,7 @@
|
|
| 57 |
|
| 58 |
h1 {
|
| 59 |
font-size: 1.8rem; font-weight: 800; margin: 0;
|
| 60 |
-
background: linear-gradient(90deg, #2d3748,
|
| 61 |
-webkit-background-clip: text; -webkit-text-fill-color: transparent;
|
| 62 |
}
|
| 63 |
.subtitle { font-size: 0.9rem; color: var(--text-secondary); margin-top: 5px; }
|
|
@@ -89,10 +90,10 @@
|
|
| 89 |
textarea { min-height: 120px; resize: vertical; }
|
| 90 |
textarea:focus, input:focus, select:focus { border-color: var(--accent-primary); background: #fff; }
|
| 91 |
|
| 92 |
-
/* استایل دکمهها */
|
| 93 |
.btn-main {
|
| 94 |
width: 100%; padding: 16px;
|
| 95 |
-
background: linear-gradient(135deg, var(--accent-primary), #
|
| 96 |
color: #fff; border: none; border-radius: var(--radius-btn);
|
| 97 |
font-size: 1.1rem; font-weight: 700; cursor: pointer;
|
| 98 |
display: flex; justify-content: center; align-items: center; gap: 10px;
|
|
@@ -163,7 +164,7 @@
|
|
| 163 |
|
| 164 |
/* دکمه دانلود */
|
| 165 |
#mainDownloadLink {
|
| 166 |
-
background-color: rgba(
|
| 167 |
color: var(--accent-primary);
|
| 168 |
text-decoration: none;
|
| 169 |
font-size: 0.9rem;
|
|
@@ -173,7 +174,7 @@
|
|
| 173 |
transition: 0.2s;
|
| 174 |
display: none;
|
| 175 |
}
|
| 176 |
-
#mainDownloadLink:hover { background-color: rgba(
|
| 177 |
|
| 178 |
.audio-item { margin-bottom: 10px; }
|
| 179 |
audio { width: 100%; height: 45px; border-radius: 20px; margin-top: 5px; }
|
|
@@ -223,7 +224,6 @@
|
|
| 223 |
<div class="container">
|
| 224 |
<header>
|
| 225 |
<div class="logo-box">
|
| 226 |
-
<!-- آیکون جدید موسیقی -->
|
| 227 |
<svg width="40" height="40" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 18V5l12-2v13"></path><circle cx="6" cy="18" r="3"></circle><circle cx="18" cy="16" r="3"></circle></svg>
|
| 228 |
</div>
|
| 229 |
<h1>استودیو موزیک آلفا</h1>
|
|
@@ -312,12 +312,10 @@
|
|
| 312 |
<script>
|
| 313 |
const ACE_SPACE_URL = "https://ace-step-ace-step-v1-5.hf.space/";
|
| 314 |
|
| 315 |
-
// --- توابع کمکی ---
|
| 316 |
const getVal = (id) => document.getElementById(id).value;
|
| 317 |
const getNum = (id) => Number(document.getElementById(id).value);
|
| 318 |
const getChk = (id) => document.getElementById(id).checked;
|
| 319 |
|
| 320 |
-
// المانها
|
| 321 |
const ideaInput = document.getElementById('ideaInput');
|
| 322 |
const processBtn = document.getElementById('processBtn');
|
| 323 |
const step1 = document.getElementById('step1');
|
|
@@ -328,7 +326,6 @@
|
|
| 328 |
const finalLyricsBox = document.getElementById('finalLyricsBox');
|
| 329 |
const mainDownloadLink = document.getElementById('mainDownloadLink');
|
| 330 |
|
| 331 |
-
// فعالسازی آکاردئون
|
| 332 |
const acc = document.getElementsByClassName("accordion");
|
| 333 |
for (let i = 0; i < acc.length; i++) {
|
| 334 |
acc[i].addEventListener("click", function() {
|
|
@@ -342,17 +339,14 @@
|
|
| 342 |
});
|
| 343 |
}
|
| 344 |
|
| 345 |
-
// --- فرآیند اصلی: ساخت یکمرحلهای ---
|
| 346 |
processBtn.addEventListener('click', async () => {
|
| 347 |
if (!ideaInput.value.trim()) return alert("لطفا موضوع آهنگ را بنویسید");
|
| 348 |
|
| 349 |
-
// مخفی کردن فرم و نمایش لودر
|
| 350 |
processBtn.disabled = true;
|
| 351 |
step1.style.display = 'none';
|
| 352 |
loader.style.display = 'block';
|
| 353 |
|
| 354 |
try {
|
| 355 |
-
// 1. دریافت متن و پرامپت از Gemini
|
| 356 |
loaderText.innerText = "آلفا در حال نوشتن شعر و ملودی...";
|
| 357 |
|
| 358 |
const response = await fetch('/api/refine', {
|
|
@@ -367,10 +361,8 @@
|
|
| 367 |
const lyrics = data.lyrics;
|
| 368 |
const musicPrompt = data.music_prompt;
|
| 369 |
|
| 370 |
-
// 2. ارسال مستقیم برای ساخت آهنگ (بدون توقف)
|
| 371 |
loaderText.innerText = "در حال ضبط آهنگ در استودیو آلفا (لطفاً صبر کنید)...";
|
| 372 |
|
| 373 |
-
// آمادهسازی محیط پخش
|
| 374 |
formatLyricsForDisplay(lyrics);
|
| 375 |
playerWrapper.innerHTML = '';
|
| 376 |
|
|
@@ -423,7 +415,7 @@
|
|
| 423 |
} catch (e) {
|
| 424 |
alert("خطا: " + e.message);
|
| 425 |
loader.style.display = 'none';
|
| 426 |
-
step1.style.display = 'block';
|
| 427 |
processBtn.disabled = false;
|
| 428 |
}
|
| 429 |
});
|
|
@@ -489,7 +481,7 @@
|
|
| 489 |
function anim() {
|
| 490 |
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
| 491 |
ctx.beginPath();
|
| 492 |
-
ctx.strokeStyle = "rgba(
|
| 493 |
ctx.lineWidth = 2;
|
| 494 |
for(let i=0; i<canvas.width; i+=20) {
|
| 495 |
ctx.moveTo(i, 0);
|
|
|
|
| 15 |
--input-border: #E1E7EF;
|
| 16 |
--text-primary: #1A202C;
|
| 17 |
--text-secondary: #626F86;
|
| 18 |
+
/* بازگشت به تم آبی اصلی */
|
| 19 |
+
--accent-primary: #4A6CFA;
|
| 20 |
+
--accent-glow: rgba(74, 108, 250, 0.2);
|
| 21 |
--success-color: #38A169;
|
| 22 |
--radius-card: 20px;
|
| 23 |
--radius-btn: 14px;
|
|
|
|
| 58 |
|
| 59 |
h1 {
|
| 60 |
font-size: 1.8rem; font-weight: 800; margin: 0;
|
| 61 |
+
background: linear-gradient(90deg, #2d3748, #4A6CFA);
|
| 62 |
-webkit-background-clip: text; -webkit-text-fill-color: transparent;
|
| 63 |
}
|
| 64 |
.subtitle { font-size: 0.9rem; color: var(--text-secondary); margin-top: 5px; }
|
|
|
|
| 90 |
textarea { min-height: 120px; resize: vertical; }
|
| 91 |
textarea:focus, input:focus, select:focus { border-color: var(--accent-primary); background: #fff; }
|
| 92 |
|
| 93 |
+
/* استایل دکمهها - بازگشت به گرادینت آبی */
|
| 94 |
.btn-main {
|
| 95 |
width: 100%; padding: 16px;
|
| 96 |
+
background: linear-gradient(135deg, var(--accent-primary), #3b5bdb);
|
| 97 |
color: #fff; border: none; border-radius: var(--radius-btn);
|
| 98 |
font-size: 1.1rem; font-weight: 700; cursor: pointer;
|
| 99 |
display: flex; justify-content: center; align-items: center; gap: 10px;
|
|
|
|
| 164 |
|
| 165 |
/* دکمه دانلود */
|
| 166 |
#mainDownloadLink {
|
| 167 |
+
background-color: rgba(74, 108, 250, 0.1);
|
| 168 |
color: var(--accent-primary);
|
| 169 |
text-decoration: none;
|
| 170 |
font-size: 0.9rem;
|
|
|
|
| 174 |
transition: 0.2s;
|
| 175 |
display: none;
|
| 176 |
}
|
| 177 |
+
#mainDownloadLink:hover { background-color: rgba(74, 108, 250, 0.2); }
|
| 178 |
|
| 179 |
.audio-item { margin-bottom: 10px; }
|
| 180 |
audio { width: 100%; height: 45px; border-radius: 20px; margin-top: 5px; }
|
|
|
|
| 224 |
<div class="container">
|
| 225 |
<header>
|
| 226 |
<div class="logo-box">
|
|
|
|
| 227 |
<svg width="40" height="40" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 18V5l12-2v13"></path><circle cx="6" cy="18" r="3"></circle><circle cx="18" cy="16" r="3"></circle></svg>
|
| 228 |
</div>
|
| 229 |
<h1>استودیو موزیک آلفا</h1>
|
|
|
|
| 312 |
<script>
|
| 313 |
const ACE_SPACE_URL = "https://ace-step-ace-step-v1-5.hf.space/";
|
| 314 |
|
|
|
|
| 315 |
const getVal = (id) => document.getElementById(id).value;
|
| 316 |
const getNum = (id) => Number(document.getElementById(id).value);
|
| 317 |
const getChk = (id) => document.getElementById(id).checked;
|
| 318 |
|
|
|
|
| 319 |
const ideaInput = document.getElementById('ideaInput');
|
| 320 |
const processBtn = document.getElementById('processBtn');
|
| 321 |
const step1 = document.getElementById('step1');
|
|
|
|
| 326 |
const finalLyricsBox = document.getElementById('finalLyricsBox');
|
| 327 |
const mainDownloadLink = document.getElementById('mainDownloadLink');
|
| 328 |
|
|
|
|
| 329 |
const acc = document.getElementsByClassName("accordion");
|
| 330 |
for (let i = 0; i < acc.length; i++) {
|
| 331 |
acc[i].addEventListener("click", function() {
|
|
|
|
| 339 |
});
|
| 340 |
}
|
| 341 |
|
|
|
|
| 342 |
processBtn.addEventListener('click', async () => {
|
| 343 |
if (!ideaInput.value.trim()) return alert("لطفا موضوع آهنگ را بنویسید");
|
| 344 |
|
|
|
|
| 345 |
processBtn.disabled = true;
|
| 346 |
step1.style.display = 'none';
|
| 347 |
loader.style.display = 'block';
|
| 348 |
|
| 349 |
try {
|
|
|
|
| 350 |
loaderText.innerText = "آلفا در حال نوشتن شعر و ملودی...";
|
| 351 |
|
| 352 |
const response = await fetch('/api/refine', {
|
|
|
|
| 361 |
const lyrics = data.lyrics;
|
| 362 |
const musicPrompt = data.music_prompt;
|
| 363 |
|
|
|
|
| 364 |
loaderText.innerText = "در حال ضبط آهنگ در استودیو آلفا (لطفاً صبر کنید)...";
|
| 365 |
|
|
|
|
| 366 |
formatLyricsForDisplay(lyrics);
|
| 367 |
playerWrapper.innerHTML = '';
|
| 368 |
|
|
|
|
| 415 |
} catch (e) {
|
| 416 |
alert("خطا: " + e.message);
|
| 417 |
loader.style.display = 'none';
|
| 418 |
+
step1.style.display = 'block';
|
| 419 |
processBtn.disabled = false;
|
| 420 |
}
|
| 421 |
});
|
|
|
|
| 481 |
function anim() {
|
| 482 |
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
| 483 |
ctx.beginPath();
|
| 484 |
+
ctx.strokeStyle = "rgba(74, 108, 250, 0.1)"; // بازگشت به آبی
|
| 485 |
ctx.lineWidth = 2;
|
| 486 |
for(let i=0; i<canvas.width; i+=20) {
|
| 487 |
ctx.moveTo(i, 0);
|