Changed around line 1
+ document.addEventListener('DOMContentLoaded', () => {
+ const mobileMenu = document.querySelector('.mobile-menu');
+ const navLinks = document.querySelector('.nav-links');
+ const form = document.getElementById('seoForm');
+ const result = document.getElementById('result');
+ const contentOutput = document.getElementById('content-output');
+ const imageOutput = document.getElementById('image-output');
+
+ // Mobile menu toggle
+ mobileMenu.addEventListener('click', () => {
+ navLinks.classList.toggle('active');
+ mobileMenu.classList.toggle('active');
+ });
+
+ // Form submission
+ form.addEventListener('submit', async (e) => {
+ e.preventDefault();
+
+ const keywords = document.getElementById('keywords').value;
+ const instructions = document.getElementById('instructions').value;
+ const generateImages = document.getElementById('generateImages').checked;
+
+ // Show loading state
+ form.querySelector('button').disabled = true;
+ form.querySelector('button').textContent = 'Generating...';
+
+ try {
+ // Here you would typically make API calls to Claude
+ // For demo purposes, we'll simulate the response
+ await simulateContentGeneration(keywords, instructions, generateImages);
+ } catch (error) {
+ console.error('Error generating content:', error);
+ alert('An error occurred while generating content. Please try again.');
+ } finally {
+ form.querySelector('button').disabled = false;
+ form.querySelector('button').textContent = 'Generate Content';
+ }
+ });
+
+ // Simulate content generation (replace with actual API calls)
+ async function simulateContentGeneration(keywords, instructions, generateImages) {
+ // Simulate API delay
+ await new Promise(resolve => setTimeout(resolve, 2000));
+
+ // Show results
+ result.classList.remove('hidden');
+ contentOutput.innerHTML = `
+
Generated content for keywords: ${keywords}
+
This is where the AI-generated content would appear...
+ `;
+
+ if (generateImages) {
+ imageOutput.innerHTML = `
+ `;
+ } else {
+ imageOutput.innerHTML = '';
+ }
+
+ // Smooth scroll to results
+ result.scrollIntoView({ behavior: 'smooth' });
+ }
+ });