Spaces:
Running
Running
The client requests, based on a topic chosen by the client and keywords based on the gemini api-key and unsplash api-key, to choose at least three images for each article. After generating the articles, they are uploaded in a compressed file. There are three subscription plans: free (3 articles/month), $5/month (15 articles/month), and $45 for life. - Initial Deployment
a6c5957
verified
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>ContentGen Pro - AI-Powered Article Generator</title> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> | |
| <style> | |
| .gradient-bg { | |
| background: linear-gradient(135deg, #6e8efb 0%, #a777e3 100%); | |
| } | |
| .article-card { | |
| transition: all 0.3s ease; | |
| box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); | |
| } | |
| .article-card:hover { | |
| transform: translateY(-5px); | |
| box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15); | |
| } | |
| .image-selector { | |
| transition: all 0.2s ease; | |
| } | |
| .image-selector:hover { | |
| transform: scale(1.03); | |
| } | |
| .selected-image { | |
| border: 3px solid #4f46e5; | |
| box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3); | |
| } | |
| .loading-spinner { | |
| animation: spin 1s linear infinite; | |
| } | |
| @keyframes spin { | |
| 0% { transform: rotate(0deg); } | |
| 100% { transform: rotate(360deg); } | |
| } | |
| .plan-card { | |
| transition: all 0.3s ease; | |
| } | |
| .plan-card:hover { | |
| transform: scale(1.03); | |
| } | |
| .premium-plan { | |
| position: relative; | |
| overflow: hidden; | |
| } | |
| .premium-plan::before { | |
| content: "POPULAR"; | |
| position: absolute; | |
| top: 10px; | |
| right: -30px; | |
| background: #f59e0b; | |
| color: white; | |
| padding: 2px 30px; | |
| transform: rotate(45deg); | |
| font-size: 12px; | |
| font-weight: bold; | |
| } | |
| </style> | |
| </head> | |
| <body class="bg-gray-50 font-sans"> | |
| <!-- Navigation --> | |
| <nav class="gradient-bg text-white shadow-lg"> | |
| <div class="container mx-auto px-4 py-4"> | |
| <div class="flex justify-between items-center"> | |
| <div class="flex items-center space-x-2"> | |
| <i class="fas fa-pen-nib text-2xl"></i> | |
| <span class="text-xl font-bold">ContentGen Pro</span> | |
| </div> | |
| <div class="hidden md:flex space-x-6"> | |
| <a href="#features" class="hover:text-gray-200">Features</a> | |
| <a href="#how-it-works" class="hover:text-gray-200">How It Works</a> | |
| <a href="#pricing" class="hover:text-gray-200">Pricing</a> | |
| <a href="#contact" class="hover:text-gray-200">Contact</a> | |
| </div> | |
| <div class="flex items-center space-x-4"> | |
| <button class="px-4 py-2 rounded-lg bg-white text-indigo-600 font-medium hover:bg-gray-100 transition">Login</button> | |
| <button class="md:hidden text-xl"> | |
| <i class="fas fa-bars"></i> | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| </nav> | |
| <!-- Hero Section --> | |
| <section class="gradient-bg text-white py-16 md:py-24"> | |
| <div class="container mx-auto px-4 text-center"> | |
| <h1 class="text-4xl md:text-6xl font-bold mb-6">AI-Powered Content Creation Made Simple</h1> | |
| <p class="text-xl md:text-2xl mb-8 max-w-3xl mx-auto">Generate high-quality articles with relevant images in minutes. Perfect for bloggers, marketers, and content creators.</p> | |
| <div class="flex flex-col md:flex-row justify-center gap-4"> | |
| <button class="px-8 py-4 bg-white text-indigo-600 rounded-lg font-bold text-lg hover:bg-gray-100 transition">Start Generating</button> | |
| <button class="px-8 py-4 border-2 border-white text-white rounded-lg font-bold text-lg hover:bg-white hover:bg-opacity-10 transition">View Pricing</button> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- Article Generator Section --> | |
| <section class="py-16 bg-white" id="generator"> | |
| <div class="container mx-auto px-4"> | |
| <h2 class="text-3xl font-bold text-center mb-12">Create Your Article</h2> | |
| <div class="max-w-4xl mx-auto bg-gray-50 rounded-xl p-6 shadow-md"> | |
| <div class="mb-6"> | |
| <label class="block text-gray-700 font-medium mb-2" for="topic">Article Topic</label> | |
| <input type="text" id="topic" placeholder="Enter your article topic (e.g., 'Sustainable Gardening')" | |
| class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-indigo-500"> | |
| </div> | |
| <div class="mb-6"> | |
| <label class="block text-gray-700 font-medium mb-2" for="keywords">Keywords (comma separated)</label> | |
| <input type="text" id="keywords" placeholder="Enter keywords (e.g., 'organic, compost, water conservation')" | |
| class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-indigo-500"> | |
| </div> | |
| <div class="mb-6"> | |
| <label class="block text-gray-700 font-medium mb-2">Select Images (Choose 3)</label> | |
| <div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4 mb-4" id="imageGallery"> | |
| <!-- Images will be loaded here --> | |
| <div class="bg-gray-200 h-32 rounded-lg flex items-center justify-center text-gray-500"> | |
| <i class="fas fa-image text-3xl"></i> | |
| </div> | |
| <div class="bg-gray-200 h-32 rounded-lg flex items-center justify-center text-gray-500"> | |
| <i class="fas fa-image text-3xl"></i> | |
| </div> | |
| <div class="bg-gray-200 h-32 rounded-lg flex items-center justify-center text-gray-500"> | |
| <i class="fas fa-image text-3xl"></i> | |
| </div> | |
| <div class="bg-gray-200 h-32 rounded-lg flex items-center justify-center text-gray-500"> | |
| <i class="fas fa-image text-3xl"></i> | |
| </div> | |
| </div> | |
| <button id="searchImagesBtn" class="px-4 py-2 bg-indigo-100 text-indigo-700 rounded-lg hover:bg-indigo-200 transition"> | |
| <i class="fas fa-search mr-2"></i> Search Images | |
| </button> | |
| </div> | |
| <div class="flex justify-between items-center"> | |
| <div class="text-sm text-gray-500"> | |
| <span id="articleCount">0</span>/<span id="maxArticles">3</span> articles remaining this month | |
| </div> | |
| <button id="generateBtn" class="px-6 py-3 gradient-bg text-white rounded-lg font-medium hover:opacity-90 transition flex items-center"> | |
| <i class="fas fa-magic mr-2"></i> Generate Article | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- Generated Articles Section --> | |
| <section class="py-16 bg-gray-50" id="articles"> | |
| <div class="container mx-auto px-4"> | |
| <h2 class="text-3xl font-bold text-center mb-12">Your Generated Articles</h2> | |
| <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8" id="articlesContainer"> | |
| <!-- Sample article card - will be populated dynamically --> | |
| <div class="article-card bg-white rounded-xl overflow-hidden shadow-md"> | |
| <div class="h-48 bg-gray-200 flex items-center justify-center"> | |
| <i class="fas fa-image text-4xl text-gray-400"></i> | |
| </div> | |
| <div class="p-6"> | |
| <h3 class="text-xl font-bold mb-2">Your Article Title</h3> | |
| <p class="text-gray-600 mb-4">Generate your first article to see it appear here...</p> | |
| <div class="flex justify-between items-center"> | |
| <span class="text-sm text-gray-500">Just now</span> | |
| <button class="text-indigo-600 hover:text-indigo-800"> | |
| <i class="fas fa-download"></i> | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="text-center mt-8"> | |
| <button id="downloadAllBtn" class="px-6 py-3 bg-indigo-600 text-white rounded-lg font-medium hover:bg-indigo-700 transition flex items-center mx-auto"> | |
| <i class="fas fa-file-archive mr-2"></i> Download All as ZIP | |
| </button> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- Pricing Section --> | |
| <section class="py-16 bg-white" id="pricing"> | |
| <div class="container mx-auto px-4"> | |
| <h2 class="text-3xl font-bold text-center mb-4">Simple, Transparent Pricing</h2> | |
| <p class="text-xl text-gray-600 text-center mb-12 max-w-2xl mx-auto">Choose the plan that fits your content creation needs</p> | |
| <div class="grid grid-cols-1 md:grid-cols-3 gap-8 max-w-5xl mx-auto"> | |
| <!-- Free Plan --> | |
| <div class="plan-card bg-gray-50 rounded-xl p-6 shadow-md border border-gray-200"> | |
| <h3 class="text-xl font-bold mb-2">Free</h3> | |
| <p class="text-gray-600 mb-4">Perfect for trying out the platform</p> | |
| <div class="mb-6"> | |
| <span class="text-4xl font-bold">$0</span> | |
| <span class="text-gray-500">/month</span> | |
| </div> | |
| <ul class="space-y-3 mb-8"> | |
| <li class="flex items-center"> | |
| <i class="fas fa-check text-green-500 mr-2"></i> | |
| <span>3 articles per month</span> | |
| </li> | |
| <li class="flex items-center"> | |
| <i class="fas fa-check text-green-500 mr-2"></i> | |
| <span>Basic image selection</span> | |
| </li> | |
| <li class="flex items-center text-gray-400"> | |
| <i class="fas fa-times text-red-400 mr-2"></i> | |
| <span>No priority generation</span> | |
| </li> | |
| <li class="flex items-center text-gray-400"> | |
| <i class="fas fa-times text-red-400 mr-2"></i> | |
| <span>No bulk downloads</span> | |
| </li> | |
| </ul> | |
| <button class="w-full py-3 border border-indigo-600 text-indigo-600 rounded-lg font-medium hover:bg-indigo-50 transition"> | |
| Current Plan | |
| </button> | |
| </div> | |
| <!-- Premium Plan --> | |
| <div class="plan-card premium-plan bg-white rounded-xl p-6 shadow-lg border-2 border-indigo-500 transform scale-105"> | |
| <h3 class="text-xl font-bold mb-2">Premium</h3> | |
| <p class="text-gray-600 mb-4">Best for regular content creators</p> | |
| <div class="mb-6"> | |
| <span class="text-4xl font-bold">$5</span> | |
| <span class="text-gray-500">/month</span> | |
| </div> | |
| <ul class="space-y-3 mb-8"> | |
| <li class="flex items-center"> | |
| <i class="fas fa-check text-green-500 mr-2"></i> | |
| <span>15 articles per month</span> | |
| </li> | |
| <li class="flex items-center"> | |
| <i class="fas fa-check text-green-500 mr-2"></i> | |
| <span>Premium image selection</span> | |
| </li> | |
| <li class="flex items-center"> | |
| <i class="fas fa-check text-green-500 mr-2"></i> | |
| <span>Priority generation</span> | |
| </li> | |
| <li class="flex items-center"> | |
| <i class="fas fa-check text-green-500 mr-2"></i> | |
| <span>Bulk downloads</span> | |
| </li> | |
| </ul> | |
| <button class="w-full py-3 gradient-bg text-white rounded-lg font-medium hover:opacity-90 transition"> | |
| Upgrade Now | |
| </button> | |
| </div> | |
| <!-- Lifetime Plan --> | |
| <div class="plan-card bg-gray-50 rounded-xl p-6 shadow-md border border-gray-200"> | |
| <h3 class="text-xl font-bold mb-2">Lifetime</h3> | |
| <p class="text-gray-600 mb-4">For serious content creators</p> | |
| <div class="mb-6"> | |
| <span class="text-4xl font-bold">$45</span> | |
| <span class="text-gray-500">one time</span> | |
| </div> | |
| <ul class="space-y-3 mb-8"> | |
| <li class="flex items-center"> | |
| <i class="fas fa-check text-green-500 mr-2"></i> | |
| <span>Unlimited articles</span> | |
| </li> | |
| <li class="flex items-center"> | |
| <i class="fas fa-check text-green-500 mr-2"></i> | |
| <span>Premium image selection</span> | |
| </li> | |
| <li class="flex items-center"> | |
| <i class="fas fa-check text-green-500 mr-2"></i> | |
| <span>Highest priority generation</span> | |
| </li> | |
| <li class="flex items-center"> | |
| <i class="fas fa-check text-green-500 mr-2"></i> | |
| <span>All premium features</span> | |
| </li> | |
| </ul> | |
| <button class="w-full py-3 bg-indigo-600 text-white rounded-lg font-medium hover:bg-indigo-700 transition"> | |
| Get Lifetime Access | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- Footer --> | |
| <footer class="bg-gray-900 text-white py-12"> | |
| <div class="container mx-auto px-4"> | |
| <div class="grid grid-cols-1 md:grid-cols-4 gap-8"> | |
| <div> | |
| <h3 class="text-xl font-bold mb-4 flex items-center"> | |
| <i class="fas fa-pen-nib mr-2"></i> ContentGen Pro | |
| </h3> | |
| <p class="text-gray-400">AI-powered content creation platform for bloggers, marketers, and creators.</p> | |
| </div> | |
| <div> | |
| <h4 class="font-bold mb-4">Features</h4> | |
| <ul class="space-y-2"> | |
| <li><a href="#" class="text-gray-400 hover:text-white">Article Generation</a></li> | |
| <li><a href="#" class="text-gray-400 hover:text-white">Image Selection</a></li> | |
| <li><a href="#" class="text-gray-400 hover:text-white">Bulk Downloads</a></li> | |
| <li><a href="#" class="text-gray-400 hover:text-white">API Access</a></li> | |
| </ul> | |
| </div> | |
| <div> | |
| <h4 class="font-bold mb-4">Company</h4> | |
| <ul class="space-y-2"> | |
| <li><a href="#" class="text-gray-400 hover:text-white">About Us</a></li> | |
| <li><a href="#" class="text-gray-400 hover:text-white">Careers</a></li> | |
| <li><a href="#" class="text-gray-400 hover:text-white">Blog</a></li> | |
| <li><a href="#" class="text-gray-400 hover:text-white">Contact</a></li> | |
| </ul> | |
| </div> | |
| <div id="contact"> | |
| <h4 class="font-bold mb-4">Stay Updated</h4> | |
| <p class="text-gray-400 mb-4">Subscribe to our newsletter for updates and tips.</p> | |
| <div class="flex"> | |
| <input type="email" placeholder="Your email" class="px-4 py-2 rounded-l-lg text-gray-900 w-full"> | |
| <button class="px-4 py-2 bg-indigo-600 rounded-r-lg hover:bg-indigo-700"> | |
| <i class="fas fa-paper-plane"></i> | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="border-t border-gray-800 mt-8 pt-8 flex flex-col md:flex-row justify-between items-center"> | |
| <p class="text-gray-400">© 2023 ContentGen Pro. All rights reserved.</p> | |
| <div class="flex space-x-6 mt-4 md:mt-0"> | |
| <a href="#" class="text-gray-400 hover:text-white"><i class="fab fa-twitter"></i></a> | |
| <a href="#" class="text-gray-400 hover:text-white"><i class="fab fa-facebook"></i></a> | |
| <a href="#" class="text-gray-400 hover:text-white"><i class="fab fa-instagram"></i></a> | |
| <a href="#" class="text-gray-400 hover:text-white"><i class="fab fa-linkedin"></i></a> | |
| </div> | |
| </div> | |
| </div> | |
| </footer> | |
| <!-- Modal --> | |
| <div id="loadingModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden"> | |
| <div class="bg-white rounded-xl p-8 max-w-md w-full text-center"> | |
| <div class="loading-spinner inline-block w-12 h-12 border-4 border-indigo-500 border-t-transparent rounded-full mb-4"></div> | |
| <h3 class="text-xl font-bold mb-2">Generating Your Article</h3> | |
| <p class="text-gray-600 mb-4">Our AI is working hard to create high-quality content for you. This may take a moment...</p> | |
| <div class="w-full bg-gray-200 rounded-full h-2.5"> | |
| <div id="progressBar" class="bg-indigo-600 h-2.5 rounded-full" style="width: 0%"></div> | |
| </div> | |
| </div> | |
| </div> | |
| <script> | |
| // DOM Elements | |
| const searchImagesBtn = document.getElementById('searchImagesBtn'); | |
| const generateBtn = document.getElementById('generateBtn'); | |
| const downloadAllBtn = document.getElementById('downloadAllBtn'); | |
| const imageGallery = document.getElementById('imageGallery'); | |
| const articlesContainer = document.getElementById('articlesContainer'); | |
| const loadingModal = document.getElementById('loadingModal'); | |
| const progressBar = document.getElementById('progressBar'); | |
| const articleCount = document.getElementById('articleCount'); | |
| const maxArticles = document.getElementById('maxArticles'); | |
| // Sample data for demonstration | |
| const sampleImages = [ | |
| 'https://images.unsplash.com/photo-1490750967868-88aa4486c946?w=500', | |
| 'https://images.unsplash.com/photo-1526397751294-331021109fbd?w=500', | |
| 'https://images.unsplash.com/photo-1466692476868-aef1dfb1e735?w=500', | |
| 'https://images.unsplash.com/photo-1470114716159-e389f8712fda?w=500', | |
| 'https://images.unsplash.com/photo-1500382017468-9049fed747ef?w=500', | |
| 'https://images.unsplash.com/photo-1504208434309-cb69f4fe52b0?w=500', | |
| 'https://images.unsplash.com/photo-1472214103451-9374bd1c798e?w=500', | |
| 'https://images.unsplash.com/photo-1447752875215-b2761acb3c5d?w=500' | |
| ]; | |
| const sampleArticles = [ | |
| { | |
| title: "The Future of Sustainable Gardening", | |
| content: "Sustainable gardening is becoming increasingly important as we face environmental challenges. This article explores innovative techniques for eco-friendly gardening that can help reduce your carbon footprint while creating a beautiful outdoor space.", | |
| images: [ | |
| 'https://images.unsplash.com/photo-1490750967868-88aa4486c946?w=500', | |
| 'https://images.unsplash.com/photo-1526397751294-331021109fbd?w=500', | |
| 'https://images.unsplash.com/photo-1466692476868-aef1dfb1e735?w=500' | |
| ], | |
| date: "2 minutes ago" | |
| }, | |
| { | |
| title: "Organic Composting 101", | |
| content: "Learn how to turn your kitchen scraps into nutrient-rich compost for your garden. This beginner's guide covers everything from setting up your compost bin to troubleshooting common issues.", | |
| images: [ | |
| 'https://images.unsplash.com/photo-1470114716159-e389f8712fda?w=500', | |
| 'https://images.unsplash.com/photo-1500382017468-9049fed747ef?w=500', | |
| 'https://images.unsplash.com/photo-1504208434309-cb69f4fe52b0?w=500' | |
| ], | |
| date: "5 minutes ago" | |
| } | |
| ]; | |
| // Initialize with free plan (3 articles) | |
| let remainingArticles = 3; | |
| articleCount.textContent = remainingArticles; | |
| maxArticles.textContent = remainingArticles; | |
| // Search Images Button Click | |
| searchImagesBtn.addEventListener('click', () => { | |
| // In a real app, this would call the Unsplash API with the keywords | |
| // For demo, we'll use sample images | |
| // Clear existing images | |
| imageGallery.innerHTML = ''; | |
| // Add sample images | |
| sampleImages.forEach((imgUrl, index) => { | |
| const imgDiv = document.createElement('div'); | |
| imgDiv.className = 'image-selector bg-gray-200 h-32 rounded-lg overflow-hidden cursor-pointer'; | |
| imgDiv.innerHTML = ` | |
| <img src="${imgUrl}" alt="Sample image ${index + 1}" class="w-full h-full object-cover"> | |
| `; | |
| imgDiv.addEventListener('click', () => { | |
| // Toggle selection | |
| imgDiv.classList.toggle('selected-image'); | |
| // Limit to 3 selected images | |
| const selected = document.querySelectorAll('.selected-image'); | |
| if (selected.length > 3) { | |
| imgDiv.classList.remove('selected-image'); | |
| alert('You can only select 3 images per article.'); | |
| } | |
| }); | |
| imageGallery.appendChild(imgDiv); | |
| }); | |
| }); | |
| // Generate Article Button Click | |
| generateBtn.addEventListener('click', () => { | |
| const topic = document.getElementById('topic').value; | |
| const keywords = document.getElementById('keywords').value; | |
| const selectedImages = document.querySelectorAll('.selected-image'); | |
| // Validate inputs | |
| if (!topic) { | |
| alert('Please enter an article topic'); | |
| return; | |
| } | |
| if (selectedImages.length < 3) { | |
| alert('Please select exactly 3 images for your article'); | |
| return; | |
| } | |
| if (remainingArticles <= 0) { | |
| alert('You have reached your monthly article limit. Please upgrade your plan to generate more articles.'); | |
| return; | |
| } | |
| // Show loading modal | |
| loadingModal.classList.remove('hidden'); | |
| // Simulate progress (in a real app, this would be API calls to Gemini) | |
| let progress = 0; | |
| const interval = setInterval(() => { | |
| progress += 10; | |
| progressBar.style.width = `${progress}%`; | |
| if (progress >= 100) { | |
| clearInterval(interval); | |
| setTimeout(() => { | |
| loadingModal.classList.add('hidden'); | |
| generateArticle(topic, keywords); | |
| }, 500); | |
| } | |
| }, 300); | |
| }); | |
| // Function to generate and display a new article | |
| function generateArticle(topic, keywords) { | |
| // Decrement remaining articles | |
| remainingArticles--; | |
| articleCount.textContent = remainingArticles; | |
| // In a real app, this would use the Gemini API to generate content | |
| // For demo, we'll use a sample article and rotate through sample images | |
| const selectedImages = Array.from(document.querySelectorAll('.selected-image')).map(img => { | |
| return img.querySelector('img').src; | |
| }); | |
| const newArticle = { | |
| title: `${topic} - ${keywords.split(',')[0].trim()}`, | |
| content: `This is a generated article about ${topic} with keywords: ${keywords}. The AI has created comprehensive content that covers all aspects of this topic in detail.`, | |
| images: selectedImages, | |
| date: "Just now" | |
| }; | |
| // Add to beginning of articles container | |
| const articleCard = document.createElement('div'); | |
| articleCard.className = 'article-card bg-white rounded-xl overflow-hidden shadow-md'; | |
| articleCard.innerHTML = ` | |
| <div class="h-48 bg-gray-200 overflow-hidden"> | |
| <img src="${newArticle.images[0]}" alt="${newArticle.title}" class="w-full h-full object-cover"> | |
| </div> | |
| <div class="p-6"> | |
| <h3 class="text-xl font-bold mb-2">${newArticle.title}</h3> | |
| <p class="text-gray-600 mb-4">${newArticle.content.substring(0, 100)}...</p> | |
| <div class="flex justify-between items-center"> | |
| <span class="text-sm text-gray-500">${newArticle.date}</span> | |
| <button class="text-indigo-600 hover:text-indigo-800 download-btn" data-title="${encodeURIComponent(newArticle.title)}"> | |
| <i class="fas fa-download"></i> | |
| </button> | |
| </div> | |
| </div> | |
| `; | |
| articlesContainer.insertBefore(articleCard, articlesContainer.firstChild); | |
| // Reset form | |
| document.getElementById('topic').value = ''; | |
| document.getElementById('keywords').value = ''; | |
| imageGallery.innerHTML = ''; | |
| // Add empty placeholders | |
| for (let i = 0; i < 4; i++) { | |
| const placeholder = document.createElement('div'); | |
| placeholder.className = 'bg-gray-200 h-32 rounded-lg flex items-center justify-center text-gray-500'; | |
| placeholder.innerHTML = '<i class="fas fa-image text-3xl"></i>'; | |
| imageGallery.appendChild(placeholder); | |
| } | |
| } | |
| // Download All Button Click | |
| downloadAllBtn.addEventListener('click', () => { | |
| alert('In a real implementation, this would generate a ZIP file containing all your articles with their selected images.'); | |
| }); | |
| // Sample articles for demo | |
| sampleArticles.forEach(article => { | |
| const articleCard = document.createElement('div'); | |
| articleCard.className = 'article-card bg-white rounded-xl overflow-hidden shadow-md'; | |
| articleCard.innerHTML = ` | |
| <div class="h-48 bg-gray-200 overflow-hidden"> | |
| <img src="${article.images[0]}" alt="${article.title}" class="w-full h-full object-cover"> | |
| </div> | |
| <div class="p-6"> | |
| <h3 class="text-xl font-bold mb-2">${article.title}</h3> | |
| <p class="text-gray-600 mb-4">${article.content.substring(0, 100)}...</p> | |
| <div class="flex justify-between items-center"> | |
| <span class="text-sm text-gray-500">${article.date}</span> | |
| <button class="text-indigo-600 hover:text-indigo-800 download-btn" data-title="${encodeURIComponent(article.title)}"> | |
| <i class="fas fa-download"></i> | |
| </button> | |
| </div> | |
| </div> | |
| `; | |
| articlesContainer.appendChild(articleCard); | |
| }); | |
| // Handle download buttons | |
| document.addEventListener('click', (e) => { | |
| if (e.target.classList.contains('download-btn') || e.target.closest('.download-btn')) { | |
| const btn = e.target.classList.contains('download-btn') ? e.target : e.target.closest('.download-btn'); | |
| const title = btn.getAttribute('data-title'); | |
| alert(`Downloading article: ${decodeURIComponent(title)}. In a real implementation, this would download the article as a PDF or HTML file with all selected images.`); | |
| } | |
| }); | |
| </script> | |
| <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=DIDAOUIaek/seo" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> | |
| </html> |