zenjoul80 commited on
Commit
1dc0da6
·
verified ·
1 Parent(s): 803188d

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +55 -247
templates/index.html CHANGED
@@ -1,272 +1,80 @@
1
  <!DOCTYPE html>
2
- <html lang="en">
3
  <head>
4
- <meta charset="UTF-8">
5
- <title>Suno Custom Studio</title>
6
  <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.0.1/socket.io.js"></script>
7
- <style>
8
- /* 1. Global Reset & Variables */
9
- :root {
10
- --primary: #6366f1;
11
- --primary-hover: #4f46e5;
12
- --bg-main: #0b0e14;
13
- --bg-card: #151921;
14
- --bg-input: #1c222d;
15
- --text-main: #e1e1e1;
16
- --text-muted: #718096;
17
- --accent: #10b981;
18
- --error: #ef4444;
19
- --radius: 12px;
20
- --transition: all 0.3s ease;
21
- }
22
-
23
- * {
24
- box-sizing: border-box;
25
- margin: 0;
26
- padding: 0;
27
- }
28
-
29
- body {
30
- font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
31
- background-color: var(--bg-main);
32
- color: var(--text-main);
33
- line-height: 1.6;
34
- padding: 20px;
35
- display: flex;
36
- justify-content: center;
37
- align-items: flex-start;
38
- min-height: 100vh;
39
- }
40
-
41
- /* 2. Responsive Container */
42
- .box {
43
- width: 100%;
44
- background: var(--bg-card);
45
- padding: 20px;
46
- border-radius: var(--radius);
47
- box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
48
- transition: var(--transition);
49
- }
50
-
51
- /* 3. Typography & Headers */
52
- h2 {
53
- font-size: 1.5rem;
54
- font-weight: 700;
55
- margin-bottom: 5px;
56
- }
57
-
58
- label {
59
- display: block;
60
- font-size: 0.8rem;
61
- color: var(--text-muted);
62
- margin-bottom: 5px;
63
- margin-top: 15px;
64
- }
65
-
66
- /* 4. Form Elements */
67
- input[type="text"],
68
- input[type="password"],
69
- select,
70
- textarea {
71
- width: 100%;
72
- padding: 12px 15px;
73
- background: var(--bg-input);
74
- color: white;
75
- border: 1px solid #2d3748;
76
- border-radius: 8px;
77
- font-size: 16px; /* Prevents auto-zoom on iOS */
78
- margin-bottom: 10px;
79
- transition: border-color 0.2s;
80
- }
81
-
82
- input:focus, select:focus, textarea:focus {
83
- outline: none;
84
- border-color: var(--primary);
85
- }
86
-
87
- textarea {
88
- min-height: 100px;
89
- resize: vertical;
90
- }
91
-
92
- /* 5. Layout Helpers */
93
- .row {
94
- display: flex;
95
- flex-direction: column; /* Mobile Default */
96
- gap: 10px;
97
- margin-bottom: 15px;
98
- }
99
-
100
- .flex-row {
101
- display: flex;
102
- align-items: center;
103
- justify-content: space-between;
104
- gap: 10px;
105
- }
106
-
107
- /* 6. Buttons */
108
- button {
109
- width: 100%;
110
- padding: 14px;
111
- background: var(--primary);
112
- color: white;
113
- border: none;
114
- border-radius: 8px;
115
- font-weight: 600;
116
- font-size: 1rem;
117
- cursor: pointer;
118
- transition: var(--transition);
119
- }
120
-
121
- button:hover {
122
- background: var(--primary-hover);
123
- transform: translateY(-1px);
124
- }
125
-
126
- .token-btn {
127
- width: auto;
128
- padding: 10px 20px;
129
- background: #2d3748;
130
- }
131
-
132
- /* 7. Logs & Status */
133
- #log {
134
- margin-top: 20px;
135
- background: #000;
136
- padding: 15px;
137
- border-radius: 6px;
138
- font-family: 'Fira Code', monospace;
139
- font-size: 0.85rem;
140
- color: #a0aec0;
141
- max-height: 150px;
142
- overflow-y: auto;
143
- border: 1px solid #222;
144
- }
145
-
146
- .dl-btn {
147
- display: block;
148
- text-align: center;
149
- text-decoration: none;
150
- background: var(--accent);
151
- margin-top: 15px;
152
- padding: 14px;
153
- border-radius: 8px;
154
- color: white;
155
- font-weight: bold;
156
- }
157
-
158
- /* =========================================
159
- 8. MEDIA QUERIES (RESPONSIVENESS)
160
- ========================================= */
161
-
162
- /* Tablets (Portrait & Landscape) */
163
- @media (min-width: 600px) {
164
- body {
165
- padding: 40px 20px;
166
- }
167
-
168
- .box {
169
- max-width: 600px;
170
- padding: 30px;
171
- }
172
-
173
- .row {
174
- flex-direction: row; /* Horizontal on larger screens */
175
- }
176
-
177
- .row input {
178
- flex: 2;
179
- }
180
-
181
- .row button {
182
- flex: 1;
183
- }
184
- }
185
-
186
- /* Laptops & Desktops */
187
- @media (min-width: 1024px) {
188
- .box {
189
- max-width: 750px;
190
- }
191
-
192
- /* Create a two-column grid for style and title on desktop */
193
- .grid-desktop {
194
- display: grid;
195
- grid-template-columns: 1fr 1fr;
196
- gap: 15px;
197
- }
198
- }
199
-
200
- /* Extra Large Screens */
201
- @media (min-width: 1440px) {
202
- .box {
203
- max-width: 900px;
204
- }
205
- }
206
-
207
- /* Dark Mode high-contrast accessibility */
208
- @media (prefers-contrast: high) {
209
- :root {
210
- --bg-input: #000;
211
- --text-muted: #fff;
212
- }
213
- }
214
-
215
- </style>
216
  </head>
217
  <body>
218
  <div class="box">
219
- <div class="row">
220
- <h2 style="margin:0;">Suno Studio</h2>
221
- <div style="font-size: 0.8rem;">Credits: <b id="cr" style="color:#f59e0b;">?</b></div>
222
  </div>
223
-
224
- <div class="row" style="margin-top:15px;">
225
- <input type="password" id="tk" placeholder="Enter API Token (sk-...)">
226
- <button class="token-btn" onclick="saveTk()">Connect</button>
227
  </div>
228
 
229
- <label style="font-size:0.75rem; color:#718096;">Model Engine</label>
230
- <select id="mdl">
231
- <option value="V5">V5 (Latest High-Fidelity)</option>
232
- <option value="V4_5ALL">V4_5ALL (Complex Structure)</option>
233
- <option value="V4_5PLUS">V4_5PLUS</option>
234
- <option value="V4">V4 (Classic)</option>
235
- </select>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
236
 
237
- <input type="text" id="url" placeholder="Source Audio Link (Direct URL to .mp3)">
238
- <input type="text" id="style" placeholder="Music Style (e.g. Melodic Techno, 124 BPM, Dark)">
239
- <input type="text" id="title" placeholder="Song Title">
240
-
241
- <textarea id="lyrics" placeholder="Enter Lyrics (use [Verse], [Chorus] tags for better results)"></textarea>
242
-
243
- <div class="row" style="margin-top:10px;">
244
- <label style="font-size:0.8rem;"><input type="checkbox" id="instr"> Instrumental Only</label>
245
  </div>
246
 
247
- <button onclick="go()">Generate Cover</button>
248
 
249
- <div id="log">Logs initialized...</div>
250
- <a id="dl" href="#" target="_blank" style="display:none;"><button style="background:#10b981;">Download Result</button></a>
251
  </div>
252
 
253
  <script>
254
  const socket = io();
255
  const log = document.getElementById('log');
256
-
257
  function saveTk() { socket.emit('save_token', {token: document.getElementById('tk').value}); }
258
-
259
  function go() {
260
- const isInstrumental = document.getElementById('instr').checked;
261
- socket.emit('start_gen', {
262
- model: document.getElementById('mdl').value,
263
  uploadUrl: document.getElementById('url').value,
 
264
  style: document.getElementById('style').value,
265
- title: document.getElementById('title').value || "New Cover",
266
- prompt: document.getElementById('lyrics').value, // This is the 'Lyrics' in Custom Mode
 
267
  customMode: true,
268
- instrumental: isInstrumental
269
- });
 
270
  document.getElementById('dl').style.display = 'none';
271
  }
272
 
@@ -274,7 +82,7 @@ button:hover {
274
  socket.on('status', d => {
275
  log.innerHTML += `<div>[${new Date().toLocaleTimeString()}] ${d.msg}</div>`;
276
  log.scrollTop = log.scrollHeight;
277
- if(d.done) {
278
  document.getElementById('dl').href = d.url;
279
  document.getElementById('dl').style.display = 'block';
280
  }
 
1
  <!DOCTYPE html>
2
+ <html>
3
  <head>
4
+ <title>Suno Custom Cover Studio</title>
5
+ <link rel="stylesheet" href="/static/style.css">
6
  <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.0.1/socket.io.js"></script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  </head>
8
  <body>
9
  <div class="box">
10
+ <div style="display:flex; justify-content:space-between; align-items:center;">
11
+ <h2>Suno AI Cover</h2>
12
+ <div style="color:#f59e0b">Credits: <span id="cr">?</span></div>
13
  </div>
14
+
15
+ <div class="grid-input" style="margin-top:20px;">
16
+ <input type="password" id="tk" placeholder="Paste Suno API Token (sk-...)">
17
+ <button onclick="saveTk()" style="background:#334155;">Connect Token</button>
18
  </div>
19
 
20
+ <hr style="border:0.5px solid #334155; margin:20px 0;">
21
+
22
+ <div class="grid-input">
23
+ <div>
24
+ <label>Model</label>
25
+ <select id="mdl">
26
+ <option value="V5">V5 (Recommended)</option>
27
+ <option value="V4_5ALL">V4_5ALL (Max 1 min audio)</option>
28
+ <option value="V4_5PLUS">V4_5PLUS</option>
29
+ <option value="V4">V4</option>
30
+ </select>
31
+ </div>
32
+ <div>
33
+ <label>Audio URL</label>
34
+ <input type="text" id="url" placeholder="Direct .mp3 link">
35
+ </div>
36
+ <div>
37
+ <label>Style/Genre</label>
38
+ <input type="text" id="style" placeholder="e.g. Jazz, Pop, 120BPM">
39
+ </div>
40
+ <div>
41
+ <label>Title</label>
42
+ <input type="text" id="title" placeholder="Song Title">
43
+ </div>
44
+ <div class="full-width">
45
+ <label>Lyrics (Prompt)</label>
46
+ <textarea id="lyr" placeholder="Enter lyrics here (Custom Mode)..."></textarea>
47
+ </div>
48
+ </div>
49
 
50
+ <div style="margin-bottom:15px;">
51
+ <input type="checkbox" id="instr" style="width:auto;"> Instrumental Mode
 
 
 
 
 
 
52
  </div>
53
 
54
+ <button onclick="go()" style="width:100%;">Generate New Cover</button>
55
 
56
+ <div id="log">Ready for task...</div>
57
+ <a id="dl" href="#" target="_blank" class="dl-btn">Download Finished Track</a>
58
  </div>
59
 
60
  <script>
61
  const socket = io();
62
  const log = document.getElementById('log');
63
+
64
  function saveTk() { socket.emit('save_token', {token: document.getElementById('tk').value}); }
65
+
66
  function go() {
67
+ const payload = {
 
 
68
  uploadUrl: document.getElementById('url').value,
69
+ model: document.getElementById('mdl').value,
70
  style: document.getElementById('style').value,
71
+ title: document.getElementById('title').value || "Cover Track",
72
+ prompt: document.getElementById('lyr').value,
73
+ instrumental: document.getElementById('instr').checked,
74
  customMode: true,
75
+ callBackUrl: "https://example.com/callback" // Placeholder
76
+ };
77
+ socket.emit('start_gen', payload);
78
  document.getElementById('dl').style.display = 'none';
79
  }
80
 
 
82
  socket.on('status', d => {
83
  log.innerHTML += `<div>[${new Date().toLocaleTimeString()}] ${d.msg}</div>`;
84
  log.scrollTop = log.scrollHeight;
85
+ if(d.done) {
86
  document.getElementById('dl').href = d.url;
87
  document.getElementById('dl').style.display = 'block';
88
  }