CoolFace
Apppublic

Aesyd/suno-prompt-wizard

sourceHugging Faceupdated 10mo agoView on Hugging Face
0likes
script.js37 linesDownload Raw Back to root
1document.addEventListener('DOMContentLoaded', function() {2    // Example prompt generation logic3    const generateBtn = document.querySelector('button.bg-primary');4    const promptOutput = document.getElementById('promptOutput');5    const charCount = document.getElementById('charCount');6    7    generateBtn.addEventListener('click', function() {8        // In a real app, this would gather all form data and generate a prompt9        const examplePrompt = `Create a melodic track with a tempo of 120 BPM. 10Use electric guitar as lead instrument with synth bass. 11Female vocals with smooth delivery. 12Overall mood should be energetic but with emotional depth. 13Production style: modern and polished.`;14 15        promptOutput.value = examplePrompt;16        updateCharCount();17    });18 19    function updateCharCount() {20        const count = promptOutput.value.length;21        charCount.textContent = `${count}/1000`;22        23        if (count > 900) {24            charCount.classList.add('text-yellow-400');25            charCount.classList.remove('text-green-400', 'text-red-400');26        } else if (count > 1000) {27            charCount.classList.add('text-red-400');28            charCount.classList.remove('text-green-400', 'text-yellow-400');29        } else {30            charCount.classList.add('text-green-400');31            charCount.classList.remove('text-red-400', 'text-yellow-400');32        }33    }34 35    // Initialize feather icons36    feather.replace();37});