Spaces:
Running
Running
<html lang="pt-br"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Email Builder Pro - Criador de Emails HTML</title> | |
<script src="https://cdn.tailwindcss.com"></script> | |
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet"> | |
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet"> | |
<style> | |
/* Custom styles that Tailwind can't handle easily */ | |
.code-textarea { | |
font-family: 'Fira Code', 'Courier New', monospace; | |
tab-size: 2; | |
} | |
.resize-handle { | |
width: 5px; | |
background-color: rgba(156, 163, 175, 0.2); | |
cursor: col-resize; | |
transition: background-color 0.2s; | |
} | |
.resize-handle:hover { | |
background-color: rgba(156, 163, 175, 0.5); | |
} | |
.template-item:hover .template-preview { | |
transform: scale(1.02); | |
} | |
.template-preview { | |
transition: transform 0.2s ease; | |
} | |
/* Custom scrollbar */ | |
::-webkit-scrollbar { | |
width: 8px; | |
height: 8px; | |
} | |
::-webkit-scrollbar-track { | |
background: #f1f5f9; | |
} | |
::-webkit-scrollbar-thumb { | |
background: #cbd5e1; | |
border-radius: 4px; | |
} | |
::-webkit-scrollbar-thumb:hover { | |
background: #94a3b8; | |
} | |
</style> | |
<script> | |
tailwind.config = { | |
theme: { | |
extend: { | |
colors: { | |
primary: { | |
50: '#eff6ff', | |
100: '#dbeafe', | |
200: '#bfdbfe', | |
300: '#93c5fd', | |
400: '#60a5fa', | |
500: '#3b82f6', | |
600: '#2563eb', | |
700: '#1d4ed8', | |
800: '#1e40af', | |
900: '#1e3a8a', | |
}, | |
secondary: { | |
50: '#f8fafc', | |
100: '#f1f5f9', | |
200: '#e2e8f0', | |
300: '#cbd5e1', | |
400: '#94a3b8', | |
500: '#64748b', | |
600: '#475569', | |
700: '#334155', | |
800: '#1e293b', | |
900: '#0f172a', | |
} | |
}, | |
fontFamily: { | |
sans: ['Inter', 'sans-serif'], | |
mono: ['Fira Code', 'monospace'] | |
} | |
} | |
} | |
} | |
</script> | |
</head> | |
<body class="font-sans bg-gray-50 text-gray-800 overflow-hidden"> | |
<div class="flex h-screen"> | |
<!-- Sidebar --> | |
<div id="sidebar" class="w-80 bg-white border-r border-gray-200 flex flex-col transition-all duration-300 ease-in-out transform -translate-x-full md:translate-x-0"> | |
<!-- Sidebar Header --> | |
<div class="p-6 bg-gradient-to-r from-primary-600 to-primary-700 text-white"> | |
<div class="flex items-center space-x-3"> | |
<div class="p-2 bg-white/20 rounded-lg"> | |
<i class="fas fa-envelope text-xl"></i> | |
</div> | |
<div> | |
<h1 class="text-xl font-bold">Email Builder Pro</h1> | |
<p class="text-sm opacity-90">Crie emails profissionais</p> | |
</div> | |
</div> | |
</div> | |
<!-- Sidebar Content --> | |
<div class="flex-1 overflow-y-auto p-4 space-y-6"> | |
<!-- Templates Section --> | |
<div> | |
<h2 class="text-sm font-semibold text-gray-500 uppercase tracking-wider mb-3 flex items-center"> | |
<i class="fas fa-file-alt mr-2"></i> Modelos | |
</h2> | |
<div class="grid grid-cols-1 gap-3"> | |
<!-- Blank Template --> | |
<div class="template-item bg-white border border-gray-200 rounded-lg overflow-hidden cursor-pointer transition-all duration-200 hover:border-primary-400 hover:shadow-md active" | |
onclick="loadTemplate('blank')"> | |
<div class="template-preview bg-gray-50 h-24 flex items-center justify-center"> | |
<div class="text-center p-4"> | |
<i class="fas fa-file text-3xl text-gray-400 mb-2"></i> | |
<p class="text-xs font-medium text-gray-500">Em Branco</p> | |
</div> | |
</div> | |
<div class="p-3"> | |
<h3 class="font-medium text-gray-800">Comece do zero</h3> | |
<p class="text-xs text-gray-500 mt-1">Template vazio para criação personalizada</p> | |
</div> | |
</div> | |
<!-- Newsletter Template --> | |
<div class="template-item bg-white border border-gray-200 rounded-lg overflow-hidden cursor-pointer transition-all duration-200 hover:border-primary-400 hover:shadow-md" | |
onclick="loadTemplate('asof')"> | |
<div class="template-preview bg-gradient-to-br from-blue-50 to-indigo-50 h-24 flex items-center justify-center"> | |
<div class="text-center p-4"> | |
<div class="inline-block px-4 py-2 bg-primary-600 text-white rounded-md text-sm font-medium">NEWSLETTER</div> | |
</div> | |
</div> | |
<div class="p-3"> | |
<h3 class="font-medium text-gray-800">Newsletter</h3> | |
<p class="text-xs text-gray-500 mt-1">Modelo institucional para newsletters</p> | |
</div> | |
</div> | |
<!-- Simple Email Template --> | |
<div class="template-item bg-white border border-gray-200 rounded-lg overflow-hidden cursor-pointer transition-all duration-200 hover:border-primary-400 hover:shadow-md" | |
onclick="loadTemplate('simple')"> | |
<div class="template-preview bg-white h-24 flex items-center justify-center"> | |
<div class="text-center p-4 border-b-2 border-gray-100 w-full"> | |
<h3 class="text-lg font-medium text-gray-800">Email Simples</h3> | |
</div> | |
</div> | |
<div class="p-3"> | |
<h3 class="font-medium text-gray-800">Minimalista</h3> | |
<p class="text-xs text-gray-500 mt-1">Design limpo e direto ao ponto</p> | |
</div> | |
</div> | |
<!-- Corporate Template --> | |
<div class="template-item bg-white border border-gray-200 rounded-lg overflow-hidden cursor-pointer transition-all duration-200 hover:border-primary-400 hover:shadow-md" | |
onclick="loadTemplate('corporate')"> | |
<div class="template-preview bg-gradient-to-r from-primary-600 to-primary-700 h-24 flex items-center justify-center"> | |
<div class="text-center p-4 text-white"> | |
<h3 class="text-lg font-medium">Corporativo</h3> | |
<p class="text-sm opacity-90">Sua Empresa</p> | |
</div> | |
</div> | |
<div class="p-3"> | |
<h3 class="font-medium text-gray-800">Profissional</h3> | |
<p class="text-xs text-gray-500 mt-1">Para comunicações empresariais</p> | |
</div> | |
</div> | |
</div> | |
</div> | |
<!-- Quick Settings --> | |
<div> | |
<h2 class="text-sm font-semibold text-gray-500 uppercase tracking-wider mb-3 flex items-center"> | |
<i class="fas fa-cog mr-2"></i> Configurações | |
</h2> | |
<div class="space-y-4"> | |
<!-- Email Title --> | |
<div> | |
<label for="emailTitle" class="block text-sm font-medium text-gray-700 mb-1">Título do Email</label> | |
<div class="relative"> | |
<input type="text" id="emailTitle" value="Meu Email Profissional" | |
class="w-full pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-primary-500"> | |
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"> | |
<i class="fas fa-heading text-gray-400"></i> | |
</div> | |
</div> | |
</div> | |
<!-- Primary Color --> | |
<div> | |
<label for="primaryColor" class="block text-sm font-medium text-gray-700 mb-1">Cor Principal</label> | |
<div class="flex items-center space-x-3"> | |
<div class="relative"> | |
<input type="color" id="primaryColor" value="#2563eb" | |
class="w-10 h-10 rounded-lg border border-gray-300 cursor-pointer"> | |
</div> | |
<div class="flex-1"> | |
<input type="text" id="primaryColorText" value="#2563eb" | |
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-primary-500 font-mono text-sm"> | |
</div> | |
</div> | |
</div> | |
<!-- Max Width --> | |
<div> | |
<label for="maxWidth" class="block text-sm font-medium text-gray-700 mb-1">Largura Máxima</label> | |
<div class="relative"> | |
<select id="maxWidth" class="w-full pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-primary-500 appearance-none"> | |
<option value="600px">600px (Padrão)</option> | |
<option value="650px">650px</option> | |
<option value="700px">700px</option> | |
<option value="100%">100% (Responsivo)</option> | |
</select> | |
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"> | |
<i class="fas fa-arrows-alt-h text-gray-400"></i> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
<!-- Actions --> | |
<div class="pt-2"> | |
<h2 class="text-sm font-semibold text-gray-500 uppercase tracking-wider mb-3 flex items-center"> | |
<i class="fas fa-bolt mr-2"></i> Ações | |
</h2> | |
<div class="space-y-3"> | |
<button onclick="copyToClipboard()" class="w-full flex items-center justify-center px-4 py-3 bg-gradient-to-r from-green-500 to-green-600 text-white rounded-lg font-medium hover:from-green-600 hover:to-green-700 transition-all duration-200 shadow hover:shadow-md"> | |
<i class="fas fa-copy mr-2"></i> Copiar para Gmail | |
</button> | |
<button onclick="downloadHTML()" class="w-full flex items-center justify-center px-4 py-3 bg-gradient-to-r from-primary-500 to-primary-600 text-white rounded-lg font-medium hover:from-primary-600 hover:to-primary-700 transition-all duration-200 shadow hover:shadow-md"> | |
<i class="fas fa-download mr-2"></i> Baixar HTML | |
</button> | |
<button onclick="previewInNewTab()" class="w-full flex items-center justify-center px-4 py-3 bg-gray-100 text-gray-700 rounded-lg font-medium hover:bg-gray-200 transition-all duration-200"> | |
<i class="fas fa-external-link-alt mr-2"></i> Abrir em Nova Janela | |
</button> | |
</div> | |
</div> | |
</div> | |
</div> | |
<!-- Main Content --> | |
<div class="flex-1 flex flex-col overflow-hidden"> | |
<!-- Toolbar --> | |
<div class="bg-white border-b border-gray-200 p-4 flex items-center"> | |
<button onclick="toggleSidebar()" class="md:hidden mr-4 p-2 rounded-lg hover:bg-gray-100 text-gray-600"> | |
<i class="fas fa-bars text-lg"></i> | |
</button> | |
<div class="flex items-center"> | |
<i class="fas fa-code text-primary-600 mr-2"></i> | |
<h2 class="font-medium text-gray-800">Editor de Email HTML</h2> | |
</div> | |
<div class="ml-auto flex items-center space-x-3"> | |
<button onclick="updatePreview()" class="flex items-center px-4 py-2 bg-gray-100 text-gray-700 rounded-lg font-medium hover:bg-gray-200 transition-all duration-200"> | |
<i class="fas fa-sync-alt mr-2"></i> Atualizar | |
</button> | |
<div class="relative"> | |
<button onclick="showHelp()" class="p-2 rounded-lg hover:bg-gray-100 text-gray-600"> | |
<i class="fas fa-question-circle text-lg"></i> | |
</button> | |
<div id="helpTooltip" class="hidden absolute right-0 mt-2 w-64 bg-white border border-gray-200 rounded-lg shadow-lg p-3 z-50"> | |
<h3 class="font-medium text-gray-800 mb-2">Dicas Rápidas</h3> | |
<ul class="text-sm text-gray-600 space-y-1"> | |
<li>• Use TAB para indentar código</li> | |
<li>• Atualize o preview com F5</li> | |
<li>• Ctrl+S para salvar HTML</li> | |
<li>• Templates são apenas pontos de partida</li> | |
</ul> | |
</div> | |
</div> | |
</div> | |
</div> | |
<!-- Editor and Preview Panels --> | |
<div class="flex-1 flex overflow-hidden"> | |
<!-- Code Editor --> | |
<div class="flex-1 flex flex-col overflow-hidden border-r border-gray-200"> | |
<div class="bg-gray-50 border-b border-gray-200 p-3 flex items-center justify-between"> | |
<div class="flex items-center"> | |
<i class="fas fa-code text-gray-500 mr-2"></i> | |
<span class="text-sm font-medium text-gray-700">HTML/CSS</span> | |
</div> | |
<div class="flex items-center space-x-2"> | |
<button onclick="formatCode()" class="text-xs px-2 py-1 bg-gray-100 text-gray-600 rounded hover:bg-gray-200"> | |
<i class="fas fa-indent mr-1"></i> Format | |
</button> | |
<button onclick="minifyCode()" class="text-xs px-2 py-1 bg-gray-100 text-gray-600 rounded hover:bg-gray-200"> | |
<i class="fas fa-compress-alt mr-1"></i> Minify | |
</button> | |
</div> | |
</div> | |
<textarea id="codeEditor" class="code-textarea flex-1 p-4 bg-gray-800 text-gray-100 resize-none outline-none" spellcheck="false"></textarea> | |
</div> | |
<!-- Resize Handle --> | |
<div class="resize-handle" id="resizeHandle"></div> | |
<!-- Preview Panel --> | |
<div class="flex-1 flex flex-col overflow-hidden"> | |
<div class="bg-gray-50 border-b border-gray-200 p-3 flex items-center justify-between"> | |
<div class="flex items-center"> | |
<i class="fas fa-eye text-gray-500 mr-2"></i> | |
<span class="text-sm font-medium text-gray-700">Preview</span> | |
</div> | |
<div class="flex items-center space-x-2"> | |
<button onclick="toggleDeviceView('desktop')" class="text-xs px-2 py-1 bg-gray-100 text-gray-600 rounded hover:bg-gray-200"> | |
<i class="fas fa-desktop mr-1"></i> Desktop | |
</button> | |
<button onclick="toggleDeviceView('mobile')" class="text-xs px-2 py-1 bg-gray-100 text-gray-600 rounded hover:bg-gray-200"> | |
<i class="fas fa-mobile-alt mr-1"></i> Mobile | |
</button> | |
</div> | |
</div> | |
<div id="previewContainer" class="flex-1 bg-gray-100 p-4 overflow-auto"> | |
<div id="previewWrapper" class="mx-auto bg-white shadow-lg" style="max-width: 600px;"> | |
<iframe id="previewFrame" class="w-full h-full border-0"></iframe> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
<!-- Status Toast --> | |
<div id="statusToast" class="fixed top-4 right-4 z-50 hidden"> | |
<div class="bg-white border border-gray-200 rounded-lg shadow-lg overflow-hidden w-64"> | |
<div class="flex items-start p-4"> | |
<div id="toastIcon" class="flex-shrink-0 mr-3"> | |
<i class="fas fa-check-circle text-green-500 text-xl"></i> | |
</div> | |
<div class="flex-1"> | |
<h3 id="toastTitle" class="font-medium text-gray-800">Sucesso</h3> | |
<p id="toastMessage" class="text-sm text-gray-600 mt-1">Operação realizada com sucesso</p> | |
</div> | |
<button onclick="hideToast()" class="text-gray-400 hover:text-gray-500"> | |
<i class="fas fa-times"></i> | |
</button> | |
</div> | |
<div id="toastProgress" class="h-1 bg-green-500 w-full"></div> | |
</div> | |
</div> | |
<!-- Help Modal --> | |
<div id="helpModal" class="fixed inset-0 z-50 hidden flex items-center justify-center bg-black bg-opacity-50"> | |
<div class="bg-white rounded-lg shadow-xl w-full max-w-2xl max-h-[90vh] overflow-hidden"> | |
<div class="border-b border-gray-200 p-4 flex items-center justify-between"> | |
<h3 class="text-lg font-medium text-gray-800">Ajuda do Email Builder</h3> | |
<button onclick="hideHelpModal()" class="text-gray-400 hover:text-gray-500"> | |
<i class="fas fa-times"></i> | |
</button> | |
</div> | |
<div class="p-6 overflow-y-auto"> | |
<div class="space-y-6"> | |
<div> | |
<h4 class="font-medium text-gray-800 mb-3 flex items-center"> | |
<i class="fas fa-file-alt text-primary-600 mr-2"></i> Modelos | |
</h4> | |
<p class="text-gray-600 text-sm">Comece rapidamente com nossos modelos pré-definidos. Cada template pode ser completamente personalizado no editor.</p> | |
</div> | |
<div> | |
<h4 class="font-medium text-gray-800 mb-3 flex items-center"> | |
<i class="fas fa-code text-primary-600 mr-2"></i> Editor HTML/CSS | |
</h4> | |
<p class="text-gray-600 text-sm">Edite livremente o código HTML e CSS do seu email. O preview é atualizado automaticamente conforme você digita.</p> | |
<div class="mt-2 bg-gray-50 p-3 rounded-lg"> | |
<p class="text-xs font-mono text-gray-700"><!-- Dica: Use TAB para indentar seu código --></p> | |
</div> | |
</div> | |
<div> | |
<h4 class="font-medium text-gray-800 mb-3 flex items-center"> | |
<i class="fas fa-download text-primary-600 mr-2"></i> Exportação | |
</h4> | |
<p class="text-gray-600 text-sm">Você pode copiar o código diretamente para o Gmail ou baixar o HTML completo para usar em outros sistemas.</p> | |
</div> | |
</div> | |
</div> | |
<div class="border-t border-gray-200 p-4 flex justify-end"> | |
<button onclick="hideHelpModal()" class="px-4 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700"> | |
Entendi | |
</button> | |
</div> | |
</div> | |
</div> | |
<script> | |