💼
Profesión
${match.occupation}
✨
Personalidad
${match.personality}
❤️
Intereses
${match.interests}
💕
Busca
${match.lookingFor}
`;
document.getElementById('matchProfile').innerHTML = profileHTML;
document.getElementById('matchNameBtn').textContent = match.name.toUpperCase();
// Show results
document.getElementById('resultsSection').classList.add('active');
// Track completion
if (typeof fbq !== 'undefined') {
fbq('trackCustom', 'QuizCompleted', {
match_profile: match.name,
compatibility: match.compatibility
});
}
// Animate viewers count
animateViewersCount();
// Scroll to top
window.scrollTo({ top: 0, behavior: 'smooth' });
}
function calculateMatch() {
const q1 = answers.q1;
const q2 = answers.q2;
const q3 = answers.q3;
// Match logic
if (q1 === 'family' && q3 === 'warm') {
return matchProfiles.spanish_traditional;
} else if (q1 === 'passion' || q3 === 'artistic') {
return matchProfiles.italian_passionate;
} else if (q1 === 'intellectual' || q3 === 'intellectual_p') {
return matchProfiles.french_intellectual;
} else if (q3 === 'independent') {
return matchProfiles.german_independent;
} else if (q1 === 'adventure' && q2 === 'coastal') {
return matchProfiles.portuguese_warm;
} else {
return matchProfiles.polish_family;
}
}
function handleDirectClick() {
const match = calculateMatch();
const btn = document.getElementById('ctaBtn');
// Track conversion
if (typeof fbq !== 'undefined') {
fbq('track', 'Lead', {
content_name: 'Quiz Direct Click - ' + match.name,
currency: 'EUR',
value: 15.00
});
}
// WhatsApp redirect (CHANGE THIS NUMBER)
const whatsappNumber = '5511999999999'; // ⚠️ REPLACE WITH YOUR NUMBER
const message = encodeURIComponent(
`Hola! Completé el quiz y mi match perfecta es ${match.name} de ${match.location}. Quiero más información 💕`
);
window.open(`https://wa.me/${whatsappNumber}?text=${message}`, '_blank');
// Update button
btn.innerHTML = '✅ ¡MENSAJE ENVIADO!';
btn.style.background = 'var(--success)';
btn.disabled = true;
}
function animateViewersCount() {
const element = document.getElementById('viewersCount');
let count = 23;
setInterval(() => {
const change = Math.floor(Math.random() * 6) - 2;
count = Math.max(15, Math.min(35, count + change));
element.textContent = count;
}, 4000);
}