Digital Packing List Generator

Digital Packing List Generator

Trip Details


Add Custom Item

Your Packing Checklist

Select your trip details and click "Generate List" to begin.

Final Packing List

Your finalized packing list will appear here once you select items from the generator.

No items have been checked off yet. Go to the generator and select the items you are packing.

'; return; } const categories = ["Clothing", "Toiletries", "Electronics", "Documents", "Miscellaneous"]; categories.forEach(category => { const itemsInCategory = packedItems.filter(item => item.category === category); if (itemsInCategory.length > 0) { const categoryDiv = document.createElement('div'); categoryDiv.className = 'list-category'; let itemsHTML = `

${category}

`; itemsInCategory.forEach(item => { itemsHTML += `
`; }); categoryDiv.innerHTML = itemsHTML; finalContainer.appendChild(categoryDiv); } }); } // --- TAB & NAVIGATION LOGIC --- window.openTab = function(evt, tabName) { if (tabName === 'final') { renderFinalList(); } const tabContents = document.getElementsByClassName("tab-content"); Array.from(tabContents).forEach(tab => tab.style.display = "none"); const tabButtons = document.getElementsByClassName("tab-btn"); Array.from(tabButtons).forEach(btn => btn.classList.remove("active")); document.getElementById(tabName).style.display = "block"; if (evt) { evt.currentTarget.classList.add("active"); } else { const btnToActivate = Array.from(tabButtons).find(btn => btn.getAttribute('onclick').includes(`'${tabName}'`)); if (btnToActivate) btnToActivate.classList.add("active"); } updateNavButtons(); } window.navigateTabs = function(direction) { const tabs = Array.from(document.querySelectorAll('.tab-btn')); const activeTabIndex = tabs.findIndex(tab => tab.classList.contains('active')); let newIndex = (direction === 'next') ? (activeTabIndex + 1) % tabs.length : (activeTabIndex - 1 + tabs.length) % tabs.length; tabs[newIndex].click(); } function updateNavButtons() { const tabs = Array.from(document.querySelectorAll('.tab-btn')); const activeTabIndex = tabs.findIndex(tab => tab.classList.contains('active')); document.getElementById('prev-btn').style.visibility = activeTabIndex === 0 ? 'hidden' : 'visible'; document.getElementById('next-btn').style.visibility = activeTabIndex === tabs.length - 1 ? 'hidden' : 'visible'; } // --- PDF DOWNLOAD --- if(downloadPdfBtn) { downloadPdfBtn.addEventListener('click', function() { const { jsPDF } = window.jspdf; const contentToDownload = document.getElementById('final-list-to-download'); if (!contentToDownload || currentPackingList.filter(i => i.packed).length === 0) { alert("Your packing list is empty. Please select items to include in the PDF."); return; } html2canvas(contentToDownload, { scale: 2 }).then(canvas => { const imgData = canvas.toDataURL('image/png'); const pdf = new jsPDF({ orientation: 'p', unit: 'mm', format: 'a4' }); const pdfWidth = pdf.internal.pageSize.getWidth(); const imgProps = pdf.getImageProperties(imgData); const imgHeight = (imgProps.height * pdfWidth) / imgProps.width; pdf.addImage(imgData, 'PNG', 0, 0, pdfWidth, imgHeight); pdf.save('Packing-List.pdf'); }); }); } // --- INITIALIZATION --- updateNavButtons(); });
Scroll to Top