Top Hiking Trails By Difficulty Level Finder

Top Hiking Trails Finder

Select a difficulty level to discover top-rated hiking trails across the USA.

${trail.description}

`; trailsContainer.appendChild(trailCard); }); resultsSection.classList.remove('hidden'); resultsSection.classList.remove('fade-in'); void resultsSection.offsetWidth; resultsSection.classList.add('fade-in'); } // --- PDF DOWNLOAD LOGIC --- function downloadTrailsAsPDF() { if (!currentDifficulty) { alert("Please select a difficulty level first."); return; } const trails = trailData[currentDifficulty]; const { jsPDF } = window.jspdf; const doc = new jsPDF(); // --- PDF Content & Formatting --- doc.setFontSize(20); doc.setFont("helvetica", "bold"); doc.text(`Top ${currentDifficulty.charAt(0).toUpperCase() + currentDifficulty.slice(1)} Hiking Trails`, 105, 20, null, null, "center"); const tableBody = trails.map(trail => [ trail.name, trail.location, trail.distance, trail.elevation ]); doc.autoTable({ startY: 30, head: [['Trail Name', 'Location', 'Distance', 'Elevation Gain']], body: tableBody, theme: 'grid', headStyles: { fillColor: [37, 99, 235] }, // blue-600 didDrawPage: function (data) { // You can add headers/footers here if needed } }); doc.save(`${currentDifficulty}-Hiking-Trails.pdf`); } // --- START THE APP --- initialize(); });
Scroll to Top