last_edit / frontend /redirect-handler.js
Moharek
Deploy Moharek GEO Platform
a74b879
function submitAuditFormAndRedirect() {
const n = document.getElementById('inp-name').value.trim();
const e = document.getElementById('inp-email').value.trim();
const p = document.getElementById('inp-phone').value.trim();
const s = document.getElementById('inp-sector').value.trim();
const u = document.getElementById('inp-url').value.trim();
const btn = document.getElementById('audit-btn');
if (!n || !e || !p || !u) {
btn.textContent = '⚠️ يرجى ملء الحقول المطلوبة';
btn.style.background = '#c0392b';
btn.style.color = '#fff';
setTimeout(() => {
btn.textContent = 'تحليل المحركات الـ 5 ←';
btn.style.background = '';
btn.style.color = 'var(--p)';
}, 2500);
return;
}
const userData = {
name: n,
email: e,
phone: p,
sector: s,
url: u,
timestamp: new Date().toISOString()
};
localStorage.setItem('auditFormData', JSON.stringify(userData));
localStorage.setItem('autoLaunchAnalysis', 'true');
btn.disabled = true;
btn.textContent = '⏳ جاري الانتقال...';
btn.style.opacity = '0.7';
setTimeout(() => {
window.location.href = '/portal.html';
}, 800);
}