Safari Trip Planner

Safari Trip Planner

Design your perfect wildlife adventure in a few easy steps.

Plan Your Adventure

Primary Interests

Your personalized safari plan will appear here. Complete the previous step to generate it.

Day ${day.day}: ${day.plan}

`).join(''); // Packing List HTML let packingHtml = ''; const catTitles = { essentials: 'Essentials', clothing: 'Clothing', footwear: 'Footwear', health: 'Health & Toiletries', gear: 'Gear & Electronics' }; for(const cat in data.packingList) { if (data.packingList[cat].length > 0) { packingHtml += `

${catTitles[cat]}

    `; data.packingList[cat].forEach(item => { const qtyText = item.quantity ? ` (x${item.quantity})` : ''; packingHtml += `
  • `; }); packingHtml += `
`; } } container.innerHTML = `

Your Safari Plan for ${data.destination.charAt(0).toUpperCase() + data.destination.slice(1).replace('_', ' ')}

${data.tripLength} Days / ${data.travelStyle.charAt(0).toUpperCase() + data.travelStyle.slice(1)} Style

Estimated Budget

$${Math.round(data.totalCost).toLocaleString()}

Total for ${data.tripLength} days

Sample Itinerary

${itineraryHtml}

Personalized Packing List

${packingHtml}
`; downloadBtn.classList.remove('hidden'); const ctx = document.getElementById('budgetChart')?.getContext('2d'); if (ctx) { if (budgetChart) budgetChart.destroy(); budgetChart = new Chart(ctx, { type: 'doughnut', data: { labels: Object.keys(data.budget), datasets: [{ data: Object.values(data.budget), backgroundColor: ['#b45309', '#16a34a', '#f59e0b', '#6b7280'], borderColor: '#ffffff', borderWidth: 3 }] }, options: { responsive: true, maintainAspectRatio: false, plugins: { legend: { position: 'bottom' } } } }); } } function downloadPDF() { const { jsPDF } = window.jspdf; const pdf = new jsPDF({ orientation: 'p', unit: 'mm', format: 'a4' }); const contentToPrint = document.getElementById('dashboard-content'); if (!contentToPrint) return; html2canvas(contentToPrint, { scale: 2, useCORS: true, onclone: (doc) => { const chartCanvas = doc.getElementById('budgetChart'); if (chartCanvas && budgetChart) { const img = new Image(); img.src = budgetChart.toBase64Image(); img.style.maxWidth = '100%'; img.style.height = 'auto'; chartCanvas.parentNode.replaceChild(img, chartCanvas); } doc.querySelectorAll('input[type="checkbox"]').forEach(cb => cb.style.display = 'none'); }}).then(canvas => { const imgData = canvas.toDataURL('image/png'); const pdfWidth = pdf.internal.pageSize.getWidth(); const pdfHeight = (canvas.height * pdfWidth) / canvas.width; let heightLeft = pdfHeight; let position = 0; const pageHeight = pdf.internal.pageSize.getHeight(); pdf.addImage(imgData, 'PNG', 0, position, pdfWidth, pdfHeight); heightLeft -= pageHeight; while (heightLeft >= 0) { position = heightLeft - pdfHeight; pdf.addPage(); pdf.addImage(imgData, 'PNG', 0, position, pdfWidth, pdfHeight); heightLeft -= pageHeight; } pdf.save('My-Safari-Plan.pdf'); }); }
Scroll to Top