document.addEventListener('DOMContentLoaded', function() { // Copy button functionality const copyButton = document.getElementById('copyButton'); const webhookUrl = 'https://webhook-image-generator.com/api/webhook/endpoint'; if (copyButton) { copyButton.addEventListener('click', function() { navigator.clipboard.writeText(webhookUrl).then(() => { const originalText = copyButton.innerHTML; copyButton.innerHTML = ' Copied!'; feather.replace(); setTimeout(() => { copyButton.innerHTML = originalText; feather.replace(); }, 2000); }); }); } // Sample images data (in a real app, this would come from an API) const sampleImages = [ { id: 1, title: "User Registration Data", timestamp: "2023-05-15T14:30:00Z", imageUrl: "http://static.photos/technology/320x240/1" }, { id: 2, title: "Payment Confirmation", timestamp: "2023-05-15T13:45:00Z", imageUrl: "http://static.photos/finance/320x240/2" }, { id: 3, title: "System Alert", timestamp: "2023-05-15T12:15:00Z", imageUrl: "http://static.photos/abstract/320x240/3" }, { id: 4, title: "New Order Received", timestamp: "2023-05-15T11:20:00Z", imageUrl: "http://static.photos/office/320x240/4" }, { id: 5, title: "API Usage Report", timestamp: "2023-05-15T10:05:00Z", imageUrl: "http://static.photos/data/320x240/5" }, { id: 6, title: "Security Notification", timestamp: "2023-05-15T09:30:00Z", imageUrl: "http://static.photos/cybersecurity/320x240/6" } ]; // Render images in gallery const imageGallery = document.getElementById('imageGallery'); const noImagesMessage = document.getElementById('noImagesMessage'); if (imageGallery && sampleImages.length > 0) { noImagesMessage.classList.add('hidden'); sampleImages.forEach((img, index) => { // Add slight delay for staggered animation setTimeout(() => { const imageCard = document.createElement('div'); imageCard.className = 'bg-gray-50 rounded-lg overflow-hidden shadow-md hover:shadow-lg transition-shadow animate-fade-in'; imageCard.innerHTML = `
${img.title}
ID: ${img.id}

${img.title}

${formatDate(img.timestamp)}

Download Share
`; imageGallery.appendChild(imageCard); feather.replace(); }, index * 150); }); } else if (noImagesMessage) { noImagesMessage.classList.remove('hidden'); } // Format date helper function formatDate(dateString) { const options = { year: 'numeric', month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit' }; return new Date(dateString).toLocaleDateString(undefined, options); } });