// Demo data for proof of concept const demoData = [ { prompt: "A futuristic cityscape at night with neon lights reflecting on wet streets, cyberpunk aesthetic, cinematic lighting, 8k resolution", image: "http://static.photos/cityscape/640x360/1", tags: ["cyberpunk", "futuristic", "night", "urban"] }, { prompt: "Minimalist interior design with clean lines, natural light, Scandinavian style, wooden furniture, plants, soft textures", image: "http://static.photos/interior/640x360/2", tags: ["minimalist", "scandinavian", "interior", "natural"] }, { prompt: "Abstract geometric patterns with vibrant colors, digital art, fractal designs, high detail, symmetrical composition", image: "http://static.photos/abstract/640x360/3", tags: ["abstract", "geometric", "digital", "vibrant"] }, { prompt: "Steampunk airship flying over Victorian-era city, brass and copper details, mechanical wings, cloudy sky, detailed machinery", image: "http://static.photos/technology/640x360/4", tags: ["steampunk", "victorian", "airship", "mechanical"] }, { prompt: "Underwater coral reef with bioluminescent creatures, deep sea colors, mysterious atmosphere, high detail, 4k resolution", image: "http://static.photos/nature/640x360/5", tags: ["underwater", "bioluminescent", "nature", "mysterious"] }, { prompt: "Space station orbiting a gas giant planet, futuristic architecture, stars in background, cinematic composition, NASA aesthetic", image: "http://static.photos/space/640x360/6", tags: ["space", "futuristic", "cinematic", "science"] }, { prompt: "Vintage film noir scene with detective in trench coat, rainy street, neon signs, dramatic shadows, black and white with selective color", image: "http://static.photos/cityscape/640x360/7", tags: ["noir", "vintage", "detective", "dramatic"] }, { prompt: "Fantasy forest with glowing mushrooms, magical creatures, ethereal lighting, detailed environment, concept art style", image: "http://static.photos/nature/640x360/8", tags: ["fantasy", "magical", "forest", "ethereal"] }, { prompt: "Industrial robot arm assembling circuit boards, factory setting, metallic textures, sparks, high-tech machinery, detailed mechanics", image: "http://static.photos/technology/640x360/9", tags: ["industrial", "robotic", "technology", "mechanical"] } ]; let allTags = []; let currentFilter = ''; let filteredData = [...demoData]; // Initialize the page document.addEventListener('DOMContentLoaded', () => { // Extract all unique tags demoData.forEach(item => { item.tags.forEach(tag => { if (!allTags.includes(tag)) { allTags.push(tag); } }); }); renderTagFilters(); renderPromptCards(); // Set up dark mode toggle const toggleButton = document.getElementById('toggleDarkMode'); toggleButton.addEventListener('click', () => { document.documentElement.classList.toggle('dark'); localStorage.setItem('darkMode', document.documentElement.classList.contains('dark')); feather.replace(); }); // Check for saved dark mode preference if (localStorage.getItem('darkMode') === 'true') { document.documentElement.classList.add('dark'); } // Add grid overlay const gridOverlay = document.createElement('div'); gridOverlay.className = 'grid-overlay'; document.body.appendChild(gridOverlay); }); // Render tag filter chips function renderTagFilters() { const container = document.getElementById('tagFilters'); container.innerHTML = ''; allTags.forEach(tag => { const tagButton = document.createElement('button'); tagButton.className = 'tag px-3 py-1 bg-gray-200 dark:bg-gray-700 rounded-full text-sm hover:bg-gray-300 dark:hover:bg-gray-600 transition-colors'; tagButton.textContent = tag; tagButton.dataset.tag = tag; tagButton.addEventListener('click', () => { document.querySelectorAll('.tag').forEach(btn => btn.classList.remove('bg-blue-500', 'dark:bg-blue-600', 'text-white')); tagButton.classList.add('bg-blue-500', 'dark:bg-blue-600', 'text-white'); currentFilter = tag; filterPrompts(); }); container.appendChild(tagButton); }); } // Render prompt cards function renderPromptCards() { const container = document.getElementById('promptGrid'); container.innerHTML = ''; filteredData.forEach(item => { const card = document.createElement('div'); card.className = 'prompt-card bg-white dark:bg-gray-800 rounded-xl overflow-hidden shadow-md hover:shadow-xl transition-shadow duration-300'; card.innerHTML = `