Spaces:
Running
Running
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Suno API Video Generator</title> | |
| <style> | |
| body {{ | |
| font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif; | |
| max-width: 800px; | |
| margin: 0 auto; | |
| padding: 20px; | |
| background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); | |
| min-height: 100vh; | |
| }} | |
| .container {{ | |
| background: white; | |
| border-radius: 20px; | |
| padding: 40px; | |
| box-shadow: 0 20px 60px rgba(0,0,0,0.3); | |
| }} | |
| h1 {{ | |
| color: #333; | |
| text-align: center; | |
| margin-bottom: 30px; | |
| background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); | |
| -webkit-background-clip: text; | |
| -webkit-text-fill-color: transparent; | |
| }} | |
| .form-group {{ | |
| margin-bottom: 20px; | |
| }} | |
| label {{ | |
| display: block; | |
| margin-bottom: 8px; | |
| font-weight: 600; | |
| color: #555; | |
| }} | |
| input, textarea {{ | |
| width: 100%; | |
| padding: 12px; | |
| border: 2px solid #e0e0e0; | |
| border-radius: 10px; | |
| font-size: 16px; | |
| transition: border-color 0.3s; | |
| box-sizing: border-box; | |
| }} | |
| input:focus, textarea:focus {{ | |
| outline: none; | |
| border-color: #667eea; | |
| }} | |
| button {{ | |
| background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); | |
| color: white; | |
| border: none; | |
| padding: 15px 30px; | |
| border-radius: 10px; | |
| font-size: 16px; | |
| font-weight: 600; | |
| cursor: pointer; | |
| width: 100%; | |
| transition: transform 0.2s, box-shadow 0.2s; | |
| }} | |
| button:hover {{ | |
| transform: translateY(-2px); | |
| box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4); | |
| }} | |
| button:disabled {{ | |
| opacity: 0.6; | |
| cursor: not-allowed; | |
| }} | |
| .result {{ | |
| margin-top: 30px; | |
| padding: 20px; | |
| background: #f8f9fa; | |
| border-radius: 10px; | |
| display: none; | |
| }} | |
| .result.show {{ | |
| display: block; | |
| }} | |
| .loading {{ | |
| text-align: center; | |
| margin: 20px 0; | |
| display: none; | |
| }} | |
| .loading.show {{ | |
| display: block; | |
| }} | |
| .spinner {{ | |
| border: 4px solid #f3f3f3; | |
| border-top: 4px solid #667eea; | |
| border-radius: 50%; | |
| width: 40px; | |
| height: 40px; | |
| animation: spin 1s linear infinite; | |
| margin: 0 auto; | |
| }} | |
| @keyframes spin {{ | |
| 0% {{ transform: rotate(0deg); }} | |
| 100% {{ transform: rotate(360deg); }} | |
| }} | |
| .status {{ | |
| padding: 10px; | |
| border-radius: 5px; | |
| margin: 10px 0; | |
| display: none; | |
| }} | |
| .status.success {{ | |
| background: #d4edda; | |
| color: #155724; | |
| border: 1px solid #c3e6cb; | |
| display: block; | |
| }} | |
| .status.error {{ | |
| background: #f8d7da; | |
| color: #721c24; | |
| border: 1px solid #f5c6cb; | |
| display: block; | |
| }} | |
| </style> | |
| </head> | |
| <body> | |
| <div class="container"> | |
| <h1>🎵 Suno AI Audio Generator</h1> | |
| <div class="form-group"> | |
| <label for="taskId">Task ID:</label> | |
| <input type="text" id="taskId" placeholder="Enter task ID (e.g., 5c79****be8e)" value="5c79****be8e"> | |
| </div> | |
| <div class="form-group"> | |
| <label for="audioId">Audio ID:</label> | |
| <input type="text" id="audioId" placeholder="Enter audio ID" value="e231****-****-****-****-****8cadc7dc"> | |
| </div> | |
| <button onclick="generateAudio()" id="generateBtn">Generate Audio</button> | |
| <div class="loading" id="loading"> | |
| <div class="spinner"></div> | |
| <p>Generating audio... Please wait</p> | |
| </div> | |
| <div class="status" id="status"></div> | |
| <div class="result" id="result"> | |
| <h3>Response:</h3> | |
| <pre id="response"></pre> | |
| </div> | |
| </div> | |
| <script> | |
| // Secrets loaded from Python backend | |
| const API_KEY = "{API_KEY}"; | |
| const CALLBACK_URL = "{CALLBACK_URL}"; | |
| // Make them available globally | |
| window.config = {{ | |
| apiKey: API_KEY, | |
| callbackUrl: CALLBACK_URL | |
| }}; | |
| </script> | |
| <script src="script.js"></script> | |
| </body> | |
| </html> |