Best Countries for Remote Work Score Finder

Best Countries for Remote Work Score Finder

Find your perfect remote work destination by ranking what matters most to you.

1. Rank Your Priorities

Drag and drop the items to rank them from most important (top) to least important (bottom).

2. Set Your Preferences

$2,500
50 Mbps

Your Personalized Results

Your ranked list of countries will appear here after you click "Find".

Visa

${country.scores.visa.toFixed(1)} / 10

`; }); html += '
'; outputContainer.innerHTML = html; pdfDownloadBtn.classList.remove('hidden'); }; /** * Generates and downloads a well-formatted PDF of the results. */ const downloadPdf = () => { if (loadingOverlay) loadingOverlay.style.display = 'flex'; try { const { jsPDF } = window.jspdf; const doc = new jsPDF({ orientation: 'portrait', unit: 'pt', format: 'a4' }); const pageHeight = doc.internal.pageSize.getHeight(); const margin = 40; let y = margin; const addText = (text, options) => { const fontSize = options.fontSize || 10; const lineHeight = fontSize * 1.2; doc.setFont(options.font || 'helvetica', options.fontStyle || 'normal'); doc.setFontSize(fontSize); if (options.color) doc.setTextColor(options.color[0], options.color[1], options.color[2]); const lines = doc.splitTextToSize(text, doc.internal.pageSize.getWidth() - margin * 2); if (y + (lines.length * lineHeight) > pageHeight - margin) { doc.addPage(); y = margin; } doc.text(lines, margin, y); y += (lines.length * lineHeight) + (options.marginBottom || 0); }; addText('Your Personalized Remote Work Rankings', { fontSize: 22, fontStyle: 'bold', marginBottom: 15 }); const rankedPriorities = [...priorityList.children].map(el => el.textContent.trim()); addText(`Priorities: 1. ${rankedPriorities[0]} 2. ${rankedPriorities[1]} 3. ${rankedPriorities[2]} 4. ${rankedPriorities[3]}`, { fontSize: 10, fontStyle: 'italic', color: [100, 116, 139], marginBottom: 25 }); const resultNodes = outputContainer.querySelectorAll('.p-4.border'); resultNodes.forEach(node => { const countryName = node.querySelector('h3').innerText; const finalScore = node.querySelector('.text-3xl').innerText; const scores = [...node.querySelectorAll('.p-2.bg-gray-100 p:last-child')].map(p => p.innerText); addText(`${countryName} - Overall Score: ${finalScore}`, { fontSize: 16, fontStyle: 'bold', color: [79, 70, 229], marginBottom: 8 }); addText(`Cost: ${scores[0]} | Internet: ${scores[1]} | Quality of Life: ${scores[2]} | Visa: ${scores[3]}`, { fontSize: 10, marginBottom: 20 }); }); doc.save('Remote-Work-Country-Scores.pdf'); } catch (error) { console.error("PDF Generation Error:", error); } finally { if (loadingOverlay) loadingOverlay.style.display = 'none'; } }; // IV.A.2: Attach primary event listeners budgetSlider.addEventListener('input', updateSliderDisplays); internetSlider.addEventListener('input', updateSliderDisplays); findBtn.addEventListener('click', findBestCountries); pdfDownloadBtn.addEventListener('click', downloadPdf); // Initial setup populatePriorities(); updateSliderDisplays(); });
Scroll to Top