| 70 | } |
| 71 | |
| 72 | async function initPyodide() { |
| 73 | try { |
| 74 | elements.loadingIndicator.style.display = 'block'; |
| 75 | const loadingText = elements.loadingIndicator.querySelector('.loading-text'); |
| 76 | loadingText.textContent = 'Loading image processing library...'; |
| 77 | |
| 78 | pyodide = await loadPyodide(); |
| 79 | await pyodide.loadPackage('Pillow'); |
| 80 | |
| 81 | state.pyodideReady = true; |
| 82 | elements.loadingIndicator.style.display = 'none'; |
| 83 | |
| 84 | console.log('✅ Pyodide initialized with Pillow'); |
| 85 | } catch (error) { |
| 86 | console.error('Failed to load Pyodide:', error); |
| 87 | elements.loadingIndicator.style.display = 'none'; |
| 88 | alert('Failed to load image processing library. Please refresh the page.'); |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | // Initialize the taskbar and preview panel via the shared module |
| 93 | let memeTrayUI = null |