anycoder-d887c378 / index.html
flen-crypto's picture
Upload folder using huggingface_hub
d773b33 verified
showModal('<p class="small">Draft loaded successfully βœ…</p>');
} catch (error) {
showModal('<p class="small">Error loading draft: ' + error.message + '</p>');
}
}
function resetForm() {
if (confirm('Are you sure you want to reset the form? All data will be lost.')) {
document.querySelectorAll('.form-control').forEach(el => {
if (el.type === 'checkbox') {
el.checked = false;
} else {
el.value = '';
}
});
sunoBlockOut.textContent = 'Suno block will appear here...';
warningsDisplay.textContent = '';
document.getElementById('songPrompt').value = '';
document.getElementById('artPrompt').value = '';
document.getElementById('videoPrompt').value = '';
imgGrid.innerHTML = '';
videoPreview.innerHTML = '';
videoOut.textContent = 'Video status...';
removeSongFile();
clearClips();
showModal('<p class="small">Form reset successfully βœ…</p>');
}
}
function randomizeForm() {
const adjectives = ['Happy', 'Romantic', 'Exciting', 'Melancholic', 'Energetic'];
const genres = ['Pop', 'Rock', 'Jazz', 'Hip Hop', 'Classical'];
const relationships = ['Mother', 'Father', 'Friend', 'Partner', 'Sibling'];
const occasions = ['Birthday', 'Anniversary', 'Graduation', 'Wedding', 'Retirement'];
document.getElementById('songTitle').value = `Song for ${getRandom(occasions)}`;
document.getElementById('occasion').value = getRandom(occasions);
document.getElementById('buyerName').value = 'John Doe';
document.getElementById('recipientName').value = 'Jane Smith';
document.getElementById('relationship').value = getRandom(relationships);
document.getElementById('tone').value = getRandom(adjectives);
document.getElementById('mainGenre').value = getRandom(genres);
document.getElementById('secondaryGenres').value = getRandom(genres);
document.getElementById('tempo').value = getRandom(['Fast', 'Medium', 'Slow']);
document.getElementById('vocalStyle').value = getRandom(['Male', 'Female', 'Duet']);
document.getElementById('instrumentationNotes').value = 'Piano, guitar, soft drums';
document.getElementById('keyFacts').value = 'Loves music\nEnjoys traveling\nKind-hearted';
document.getElementById('stories').value = 'First met in college\nTravel to Paris together';
document.getElementById('mainMessage').value = 'Thank you for being you';
document.getElementById('namesPlaces').value = 'Jane\nParis\nCollege';
document.getElementById('visualStyle').value = 'Cartoon';
document.getElementById('visualMood').value = 'Bright';
document.getElementById('visualPlacesThemes').value = 'Beach\nMountains\nCity';
document.getElementById('visualText').value = 'Happy Birthday!';
showModal('<p class="small">Form randomized successfully βœ…</p>');
}
function getRandom(array) {
return array[Math.floor(Math.random() * array.length)];
}
function runDiagnostics() {
const diagnostics = [];
const formData = getFormData();
// Check API key
diagnostics.push(`API Key: ${apiKey ? 'βœ… Present' : '❌ Missing'}`);
// Check required fields
diagnostics.push(`Buyer Name: ${formData.buyerName ? 'βœ… Present' : '❌ Missing'}`);
diagnostics.push(`Recipient Name: ${formData.recipientName ? 'βœ… Present' : '❌ Missing'}`);
// Check song file
diagnostics.push(`Song File: ${songFile ? 'βœ… Uploaded' : '❌ Not uploaded'}`);
// Check video clips
diagnostics.push(`Video Clips: ${videoClips.length > 0 ? 'βœ… Uploaded' : '❌ Not uploaded'}`);
// Check prompts
diagnostics.push(`Song Prompt: ${formData.mainMessage ? 'βœ… Present' : '❌ Missing'}`);
diagnostics.push(`Art Prompt: ${formData.visualStyle ? 'βœ… Present' : '❌ Missing'}`);
diagnostics.push(`Video Prompt: ${formData.visualMood ? 'βœ… Present' : '❌ Missing'}`);
diagOut.innerHTML = diagnostics.join('<br>');
diagOut.style.display = 'block';
}
// Initialize the app
init();
</script>
</body>
</html>