Why Choose Us?Vista Previa
Why Choose Us?
add a reason here to why your customer should buy your products
`;document.getElementById('codeOutput').value = code;
}// Función para copiar al portapapeles
function copyToClipboard() {
const textarea = document.getElementById('codeOutput');
textarea.select();
document.execCommand('copy');
const copyButton = document.querySelector('.copy-btn');
copyButton.textContent = '¡Código Copiado!';
setTimeout(() => {
copyButton.innerHTML = '
📋Copiar Código';
}, 2000);
}// Inicialización cuando el documento está listo
document.addEventListener('DOMContentLoaded', () => {
// Agregar características por defecto
const defaultFeatures = [
{ text: 'Benefit 1', yourBrand: true, others: false },
{ text: 'Benefit 2', yourBrand: true, others: false },
{ text: 'Benefit 3', yourBrand: true, others: false },
{ text: 'Benefit 4', yourBrand: true, others: true },
{ text: 'Benefit 5', yourBrand: true, others: true }
];
defaultFeatures.forEach((feature, index) => {
const container = document.getElementById('features-container');
const featureElement = document.createElement('div');
featureElement.className = 'feature-input';
featureElement.innerHTML = `
`;
container.appendChild(featureElement);
// Agregar listeners
featureElement.querySelectorAll('input').forEach(input => {
input.addEventListener('input', updatePreview);
input.addEventListener('change', updatePreview);
});
});
// Agregar listeners para actualización en tiempo real
document.querySelectorAll('input').forEach(input => {
input.addEventListener('input', updatePreview);
input.addEventListener('change', updatePreview);
});
// Actualizar la vista previa inicialmente
setTimeout(updatePreview, 100);
});