${isExport ? `` : `${isExport ? `` : `${isExport ? `` : ``}`}`}
👁️ Ver Historia Actual
¡Web Exportada Exitosamente!
` : ``} `; } // Actualizar iframe de vista previa en vivo function updateLivePreview() { const frame = document.getElementById('preview-frame'); const doc = frame.contentWindow.document; doc.open(); doc.write(buildStandaloneHTML(false)); doc.close(); } // Modal de Ayuda Drive const modal = document.getElementById('modal-drive'); document.getElementById('btn-help-drive').addEventListener('click', () => modal.classList.add('open')); document.getElementById('btn-close-modal').addEventListener('click', () => modal.classList.remove('open')); document.getElementById('btn-modal-ok').addEventListener('click', () => modal.classList.remove('open')); // Toast de notificación function showToast(msg) { const toast = document.getElementById('toast'); document.getElementById('toast-msg').textContent = msg; toast.classList.add('show'); setTimeout(() => toast.classList.remove('show'), 3500); } // Exportar HTML Standalone document.getElementById('btn-export-html').addEventListener('click', () => { const finalHTML = buildStandaloneHTML(true); const blob = new Blob([finalHTML], { type: 'text/html;charset=utf-8' }); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = `historia_alexandra_guiliana.html`; document.body.appendChild(a); a.click(); document.body.removeChild(a); URL.revokeObjectURL(url); showToast('¡Archivo descargado! Listo para compartir.'); }); // Iniciar renderChaptersList(); selectChapter(1);