Your doorstep service appointment has been registered in our dispatch system.
Booking Ref ID:
NEXUS-2026-8942
Selected Service:
SSD Upgrade
// 5. Booking Form Submission & Direct WhatsApp Redirect Logic
const bookingForm = document.getElementById('bookingForm');
const bookingModal = document.getElementById('bookingModal');
const closeModalBtn = document.getElementById('closeModalBtn');
const modalOkBtn = document.getElementById('modalOkBtn');
if(bookingForm) {
bookingForm.addEventListener('submit', (e) => {
e.preventDefault();
const service = document.getElementById('bookServiceSelect').value;
const mode = document.getElementById('bookMode').value;
const date = document.getElementById('bookDate').value;
const time = document.getElementById('bookTime').value;
const name = document.getElementById('bookName').value;
const phone = document.getElementById('bookPhone').value;
const pin = document.getElementById('bookPincode').value;
const address = document.getElementById('bookAddress').value;
const notes = document.getElementById('bookNotes').value;
// Generate Unique Booking Reference Code
const randomId = "NEXUS-" + new Date().getFullYear() + "-" + Math.floor(1000 + Math.random() * 9000);
// Construct full formatted WhatsApp message text
let fullWaText = `*NEW SERVICE BOOKING REQUEST* 🛠️\n\n` +
`*Booking Ref ID:* ${randomId}\n` +
`*Service:* ${service}\n` +
`*Mode:* ${mode}\n` +
`*Date & Time:* ${date} | ${time}\n\n` +
`*Customer Name:* ${name}\n` +
`*Phone Number:* ${phone}\n` +
`*Pincode:* ${pin}\n` +
`*Address:* ${address}\n`;
if (notes && notes.trim() !== '') {
fullWaText += `*Issue/Notes:* ${notes}\n`;
}
fullWaText += `\nPlease confirm technician assignment and ETA.`;
// Build direct wa.me URL
const waUrl = `https://wa.me/918080548433?text=${encodeURIComponent(fullWaText)}`;
// Redirect client browser directly to WhatsApp chat
window.location.href = waUrl;
// Reset form
bookingForm.reset();
});
}
document.querySelectorAll('.mobile-link').forEach(link => {
link.addEventListener('click', () => {
mobileMenu.classList.add('hidden');
if(mobileMenuIcon) mobileMenuIcon.className = 'fa-solid fa-bars text-xl';
});
});
// 2. Preselect service into booking form
function preselectService(serviceName) {
const bookSelect = document.getElementById('bookServiceSelect');
if(bookSelect) {
bookSelect.value = serviceName;
}
}
// 3. Service Grid Category Filtering
const filterBtns = document.querySelectorAll('.service-tab-btn');
const serviceCards = document.querySelectorAll('.service-card');
filterBtns.forEach(btn => {
btn.addEventListener('click', () => {
filterBtns.forEach(b => {
b.classList.remove('bg-cyan-500', 'text-slate-950', 'font-bold');
b.classList.add('bg-slate-800', 'text-slate-300', 'font-semibold');
});
btn.classList.remove('bg-slate-800', 'text-slate-300', 'font-semibold');
btn.classList.add('bg-cyan-500', 'text-slate-950', 'font-bold');
const category = btn.getAttribute('data-tab');
serviceCards.forEach(card => {
if(category === 'all' || card.getAttribute('data-category') === category) {
card.classList.remove('hidden');
} else {
card.classList.add('hidden');
}
});
});
});
// 4. Pincode Coverage Checker Logic
const checkPincodeBtn = document.getElementById('checkPincodeBtn');
const pincodeInput = document.getElementById('pincodeInput');
const pincodeResult = document.getElementById('pincodeResult');
// Known Express Pincodes in Vasai-Virar, Thane & Mumbai Region
const expressPincodes = [
"401201", "401202", "401203", "401207", "401208", // Vasai
"401303", "401305", "401301", // Virar
"401209", "401204", // Nallasopara & Naigaon
"401105", "401107", "401101", // Bhayandar & Mira Road
"400601", "400602", "400603", "400604", "400605", "400606", // Thane
"400053", "400058", "400069", "400092", "400093", "400064" // Mumbai Suburbs
];
function verifyPincode() {
const pin = pincodeInput.value.trim();
if(!/^\d{6}$/.test(pin)) {
pincodeResult.className = "mt-6 p-4 rounded-xl text-sm font-medium bg-red-500/10 border border-red-500/30 text-red-300 max-w-lg mx-auto";
pincodeResult.innerHTML = `
Please enter a valid 6-digit Indian Pincode.`;
pincodeResult.classList.remove('hidden');
return;
}
pincodeResult.classList.remove('hidden');
if(expressPincodes.includes(pin)) {
pincodeResult.className = "mt-6 p-4 rounded-xl text-sm font-medium bg-emerald-500/10 border border-emerald-500/30 text-emerald-300 max-w-lg mx-auto";
pincodeResult.innerHTML = `
⚡ Express Doorstep Arrival Available for Pincode ${pin}!Certified hardware technician can reach your doorstep within 30 to 60 minutes.`;
} else {
pincodeResult.className = "mt-6 p-4 rounded-xl text-sm font-medium bg-cyan-500/10 border border-cyan-500/30 text-cyan-300 max-w-lg mx-auto";
pincodeResult.innerHTML = `
Standard Doorstep Service Available for Pincode ${pin}!Same-day service slot available. Book below for technician assignment.`;
}
}
if(checkPincodeBtn) {
checkPincodeBtn.addEventListener('click', verifyPincode);
}
if(pincodeInput) {
pincodeInput.addEventListener('keyup', (e) => {
if(e.key === 'Enter') verifyPincode();
});
}
// Set default date in booking form to today
const bookDateInput = document.getElementById('bookDate');
if(bookDateInput) {
const todayStr = new Date().toISOString().split('T')[0];
bookDateInput.value = todayStr;
bookDateInput.min = todayStr;
}
// 5. Booking Form Submission & Confirmation Modal
const bookingForm = document.getElementById('bookingForm');
const bookingModal = document.getElementById('bookingModal');
const closeModalBtn = document.getElementById('closeModalBtn');
const modalOkBtn = document.getElementById('modalOkBtn');
if(bookingForm) {
bookingForm.addEventListener('submit', (e) => {
e.preventDefault();
const service = document.getElementById('bookServiceSelect').value;
const mode = document.getElementById('bookMode').value;
const date = document.getElementById('bookDate').value;
const time = document.getElementById('bookTime').value;
const name = document.getElementById('bookName').value;
const phone = document.getElementById('bookPhone').value;
const pin = document.getElementById('bookPincode').value;
const address = document.getElementById('bookAddress').value;
const notes = document.getElementById('bookNotes').value;
// Generate Random Booking ID
const randomId = "NEXUS-" + new Date().getFullYear() + "-" + Math.floor(1000 + Math.random() * 9000);
document.getElementById('modalBookingId').textContent = randomId;
document.getElementById('modalServiceName').textContent = service;
document.getElementById('modalDateTime').textContent = `${date} (${time})`;
document.getElementById('modalCustomerName').textContent = `${name} (${phone})`;
// Construct rich WhatsApp message text with all form details
let fullWaText = `*NEW SERVICE BOOKING REQUEST* 🛠️\n\n` +
`*Booking Ref ID:* ${randomId}\n` +
`*Service:* ${service}\n` +
`*Mode:* ${mode}\n` +
`*Date & Time:* ${date} | ${time}\n\n` +
`*Customer Name:* ${name}\n` +
`*Phone Number:* ${phone}\n` +
`*Pincode:* ${pin}\n` +
`*Address:* ${address}\n`;
if (notes && notes.trim() !== '') {
fullWaText += `*Issue/Notes:* ${notes}\n`;
}
fullWaText += `\nPlease confirm technician assignment and ETA.`;
const waUrl = `https://wa.me/918080548433?text=${encodeURIComponent(fullWaText)}`;
document.getElementById('modalWhatsappLink').href = waUrl;
// Immediately redirect/open WhatsApp with pre-filled booking details
window.open(waUrl, '_blank');
// Show confirmation Modal on site
bookingModal.classList.remove('hidden');
setTimeout(() => {
bookingModal.classList.remove('opacity-0');
}, 10);
// Reset form
bookingForm.reset();
const todayStr = new Date().toISOString().split('T')[0];
if(bookDateInput) bookDateInput.value = todayStr;
});
}
function hideModal() {
bookingModal.classList.add('opacity-0');
setTimeout(() => {
bookingModal.classList.add('hidden');
}, 300);
}
if(closeModalBtn) closeModalBtn.addEventListener('click', hideModal);
if(modalOkBtn) modalOkBtn.addEventListener('click', hideModal);
// 6. FAQ Accordion Toggle
const faqToggles = document.querySelectorAll('.faq-toggle');
faqToggles.forEach(toggle => {
toggle.addEventListener('click', () => {
const content = toggle.nextElementSibling;
const icon = toggle.querySelector('i');
const isExpanded = !content.classList.contains('hidden');
// Close all other FAQs
document.querySelectorAll('.faq-content').forEach(c => c.classList.add('hidden'));
document.querySelectorAll('.faq-toggle i').forEach(i => i.style.transform = 'rotate(0deg)');
if(!isExpanded) {
content.classList.remove('hidden');
icon.style.transform = 'rotate(180deg)';
}
});
});