Changed around line 1
+ document.addEventListener('DOMContentLoaded', () => {
+ const appCards = document.querySelectorAll('.app-card');
+ const promptBuilder = document.querySelector('.prompt-builder');
+ const selectedApp = document.querySelector('.selected-app');
+ const promptInput = document.getElementById('promptInput');
+ const generateBtn = document.getElementById('generateBtn');
+ const copyBtn = document.getElementById('copyBtn');
+ const clearBtn = document.getElementById('clearBtn');
+ const output = document.getElementById('output');
+ const menuToggle = document.querySelector('.menu-toggle');
+ const navLinks = document.querySelector('.nav-links');
+
+ // Mobile menu toggle
+ menuToggle?.addEventListener('click', () => {
+ navLinks.classList.toggle('active');
+ });
+
+ // App selection
+ appCards.forEach(card => {
+ card.addEventListener('click', () => {
+ const app = card.dataset.app;
+ promptBuilder.classList.remove('hidden');
+ selectedApp.textContent = `Selected App: ${app.charAt(0).toUpperCase() + app.slice(1)}`;
+ promptInput.placeholder = getPlaceholder(app);
+ scrollTo(promptBuilder);
+ });
+ });
+
+ // Generate prompt
+ generateBtn.addEventListener('click', () => {
+ const prompt = promptInput.value.trim();
+ if (!prompt) return;
+
+ output.classList.remove('hidden');
+ output.textContent = enhancePrompt(prompt);
+ });
+
+ // Copy prompt
+ copyBtn.addEventListener('click', () => {
+ const textToCopy = output.classList.contains('hidden') ?
+ promptInput.value : output.textContent;
+
+ navigator.clipboard.writeText(textToCopy)
+ .then(() => {
+ copyBtn.textContent = 'Copied!';
+ setTimeout(() => copyBtn.textContent = 'Copy', 2000);
+ });
+ });
+
+ // Clear prompt
+ clearBtn.addEventListener('click', () => {
+ promptInput.value = '';
+ output.classList.add('hidden');
+ });
+
+ // Helper functions
+ function getPlaceholder(app) {
+ const placeholders = {
+ chatgpt: "Enter your question or task...",
+ dalle: "Describe the image you want to generate...",
+ midjourney: "Describe your artistic vision...",
+ stable: "Enter your image generation prompt..."
+ };
+ return placeholders[app] || "Enter your prompt...";
+ }
+
+ function enhancePrompt(prompt) {
+ // This is where you could add app-specific prompt enhancement logic
+ return prompt;
+ }
+
+ function scrollTo(element) {
+ element.scrollIntoView({ behavior: 'smooth', block: 'start' });
+ }
+ });