KeenConverters

GIF to JSON Converter

Convert your GIF files to JSON format with frame data and metadata

Drop your GIF files here

or click to browse files

Upload up to 20 GIF files at once
`); previewWindow.document.close(); }showError(resultId) { const result = this.convertedResults.find(r => r.id === resultId); if (!result || result.success) return; this.showToast(`Error: ${result.error}`, 'error', 5000); }downloadFile(content, filename, mimeType) { const blob = new Blob([content], { type: mimeType }); const url = URL.createObjectURL(blob); const link = document.createElement('a'); link.href = url; link.download = filename; document.body.appendChild(link); link.click(); document.body.removeChild(link); URL.revokeObjectURL(url); }showToast(message, type = 'info', duration = 3000) { const toast = document.createElement('div'); toast.className = `toast ${type}`; const iconMap = { success: 'fas fa-check-circle', error: 'fas fa-exclamation-circle', warning: 'fas fa-exclamation-triangle', info: 'fas fa-info-circle' }; toast.innerHTML = ` ${message} `; this.toastContainer.appendChild(toast); setTimeout(() => { if (toast.parentNode) { toast.parentNode.removeChild(toast); } }, duration); }generateId() { return Date.now().toString(36) + Math.random().toString(36).substr(2); }formatFileSize(bytes) { if (bytes === 0) return '0 Bytes'; const k = 1024; const sizes = ['Bytes', 'KB', 'MB', 'GB']; const i = Math.floor(Math.log(bytes) / Math.log(k)); return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i]; }escapeHtml(text) { const div = document.createElement('div'); div.textContent = text; return div.innerHTML; } }// Simple JSZip implementation for creating ZIP files class JSZip { constructor() { this.files = []; } file(name, content) { this.files.push({ name, content }); } async generateAsync({ type }) { // Simple ZIP creation - for production use, include proper JSZip library const zipContent = this.files.map(f => `File: ${f.name}\n${f.content}\n\n`).join(''); return new Blob([zipContent], { type: 'text/plain' }); } }// Initialize the application let converter; document.addEventListener('DOMContentLoaded', () => { converter = new GifToJsonConverter(); });