Postmodern PRO

All changes saved
Created by Yuzool • Pair with Drip Send.
Saved
`; } function downloadFile(filename, content, mime) { const blob = new Blob([content], { type: mime }); const link = document.createElement('a'); link.href = URL.createObjectURL(blob); link.download = filename; link.click(); URL.revokeObjectURL(link.href); } function performHtmlExport() { const html = buildExportHtml(); downloadFile('email-export.html', html, 'text/html'); persistMain(); showToast('Email exported'); } function exportEmail() { const issues = runPreflightChecks(); const errors = issues.filter((i) => i.severity === 'error'); const warnings = issues.filter((i) => i.severity === 'warning'); if (errors.length) { openPreflight('export', issues, false); showToast('Fix preflight errors before exporting'); return; } if (warnings.length) { openPreflight('export', issues, true); return; } performHtmlExport(); } function hexToRgb(hex) { let value = String(hex || '').trim().replace('#', ''); if (value.length === 3) value = value.split('').map((char) => char + char).join(''); if (!/^[0-9a-fA-F]{6}$/.test(value)) return null; return { r: parseInt(value.slice(0, 2), 16), g: parseInt(value.slice(2, 4), 16), b: parseInt(value.slice(4, 6), 16) }; } function channelLuminance(value) { const s = value / 255; return s <= 0.03928 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4; } function relativeLuminance(rgb) { return (0.2126 * channelLuminance(rgb.r)) + (0.7152 * channelLuminance(rgb.g)) + (0.0722 * channelLuminance(rgb.b)); } function contrastRatio(hexA, hexB) { const a = hexToRgb(hexA); const b = hexToRgb(hexB); if (!a || !b) return 0; const l1 = relativeLuminance(a); const l2 = relativeLuminance(b); const lighter = Math.max(l1, l2); const darker = Math.min(l1, l2); return (lighter + 0.05) / (darker + 0.05); } function showToast(message) { const toast = document.getElementById('toast'); document.getElementById('toast-msg').innerText = message; toast.style.transform = 'translateY(0)'; setTimeout(() => { toast.style.transform = 'translateY(100px)'; }, 3000); } window.onload = init;