Online Personal Legal Rights Awareness Assistant

Personal Legal Rights Awareness Assistant

Select a common scenario to understand your general rights. (For informational purposes in the USA only)

Choose a Legal Scenario

Important Disclaimer

This tool provides general educational information and is not a substitute for professional legal advice. Laws can vary significantly by state and your specific situation.

${selectedScenario.summary}

`; rightsHtml += '

Key Rights:

'; rightsHtml += '
    '; selectedScenario.rights.forEach(right => { rightsHtml += `
  • ${right}
  • `; }); rightsHtml += '
'; rightsContent.innerHTML = rightsHtml; // Render Tab 3 let summaryHtml = '

Frequently Asked Questions:

'; selectedScenario.faqs.forEach(faq => { summaryHtml += `

${faq.q}

${faq.a}

`; }); summaryContent.innerHTML = summaryHtml; downloadBtnContainer.classList.remove('hidden'); }; // --- UI & NAVIGATION --- const updateNavButtons = () => { prevBtn.disabled = currentTab === '1'; nextBtn.disabled = currentTab === '3' || scenarioSelect.value === 'none'; prevBtn.classList.toggle('opacity-50', prevBtn.disabled); nextBtn.classList.toggle('opacity-50', nextBtn.disabled); }; window.switchTab = (tabId) => { currentTab = tabId; if (scenarioSelect.value === 'none' && (tabId === '2' || tabId === '3')) { alert('Please select a scenario first.'); currentTab = '1'; } tabs.forEach(id => { document.getElementById(`tab-content-${id}`).classList.toggle('hidden', id !== currentTab); document.getElementById(`tab-btn-${id}`).classList.toggle('tab-active', id === currentTab); document.getElementById(`tab-btn-${id}`).classList.toggle('tab-inactive', id !== currentTab); }); updateNavButtons(); }; const navigateTabs = (direction) => { const currentIndex = tabs.indexOf(currentTab); let nextIndex = currentIndex + direction; if (nextIndex >= 0 && nextIndex < tabs.length) { switchTab(tabs[nextIndex]); } }; // --- PDF GENERATION --- downloadPdfBtn.addEventListener('click', () => { if (!selectedScenario) return; const { jsPDF } = window.jspdf; const doc = new jsPDF(); doc.setFontSize(18); doc.text("Personal Legal Rights Summary", 14, 22); doc.setFontSize(14); doc.setFont(undefined, 'bold'); doc.text(selectedScenario.title, 14, 32); doc.setFontSize(10); doc.setFont(undefined, 'normal'); doc.setTextColor(100); const summaryLines = doc.splitTextToSize(selectedScenario.summary, 180); doc.text(summaryLines, 14, 40); let yPos = 40 + (summaryLines.length * 5) + 5; // Key Rights Table doc.autoTable({ head: [['Key Rights']], body: selectedScenario.rights.map(r => [r]), startY: yPos, theme: 'grid', headStyles: { fillColor: [45, 102, 193] }, styles: { cellPadding: 3 }, }); yPos = doc.previousAutoTable.finalY + 10; // FAQs Table doc.autoTable({ head: [['Frequently Asked Questions', 'General Information']], body: selectedScenario.faqs.map(f => [f.q, f.a]), startY: yPos, theme: 'striped', headStyles: { fillColor: [45, 102, 193] }, styles: { cellPadding: 3 }, }); yPos = doc.previousAutoTable.finalY + 15; doc.setFontSize(8); doc.setTextColor(150); const disclaimer = "Disclaimer: This document is for general informational purposes only and does not constitute legal advice. Laws vary by jurisdiction. Consult with a qualified legal professional for advice on your specific situation."; const disclaimerLines = doc.splitTextToSize(disclaimer, 180); doc.text(disclaimerLines, 14, yPos); doc.save(`Legal_Rights_Summary_${scenarioSelect.value}.pdf`); }); // --- INITIALIZATION --- updateNavButtons(); lucide.createIcons(); scenarioSelect.addEventListener('change', () => { updateContent(); updateNavButtons(); }); prevBtn.addEventListener('click', () => navigateTabs(-1)); nextBtn.addEventListener('click', () => navigateTabs(1)); });
Scroll to Top