Self-Defense & Personal Safety Risk Analyzer

Assess a situation to better understand potential risks and receive relevant safety tips.

Important Disclaimer

This tool is for awareness and educational purposes only. It is NOT a guarantee of safety and cannot predict the outcome of any situation. If you are in immediate danger, call 911 or your local emergency number.

Step 1: Describe the Environment

${analysisResults.riskDesc}

Personalized Safety Recommendations

    ${tipsHTML}
`; resultsContainer.innerHTML = resultsHTML; resultsContainer.classList.remove('hidden'); document.getElementById('download-pdf-btn').addEventListener('click', downloadPdf); resultsContainer.scrollIntoView({ behavior: 'smooth' }); } function downloadPdf() { if (!analysisResults) return; const { jsPDF } = window.jspdf; const doc = new jsPDF(); // Header doc.setFontSize(22); doc.setFont('helvetica', 'bold'); doc.text('Personal Safety Analysis', 105, 20, { align: 'center' }); // Risk Level doc.setFontSize(14); doc.text(`Potential Risk Level: ${analysisResults.riskLevel}`, 14, 35); doc.setFontSize(11); doc.text(analysisResults.riskDesc, 14, 42); // Tips doc.setFontSize(14); doc.setFont('helvetica', 'bold'); doc.text('Personalized Safety Recommendations', 14, 55); doc.setFontSize(11); doc.setFont('helvetica', 'normal'); let yPos = 62; analysisResults.tips.forEach(tip => { if (yPos > 270) { doc.addPage(); yPos = 20; } const textLines = doc.splitTextToSize('• ' + tip, 180); doc.text(textLines, 14, yPos); yPos += (textLines.length * 5) + 3; }); doc.save('Personal-Safety-Guide.pdf'); } // --- EVENT LISTENERS --- nextBtn1.addEventListener('click', () => switchStep('2')); prevBtn2.addEventListener('click', () => switchStep('1')); nextBtn2.addEventListener('click', () => switchStep('3')); prevBtn3.addEventListener('click', () => switchStep('2')); finishBtn.addEventListener('click', analyzeRisk); });
Scroll to Top